Write a python code that reads a directory, lists all the files found in that directory, and returns metadata about the files (filename, filetype, filesize (MB/KB/etc.), Author, Creation Date, Last Modified Date, …). These should be output as a csv file, with 1 file per row. It should be tested against a variety of files: JPG, PNG, .XLSX, …others? The code should be written as a function that can be called, where it takes as input the working directory of interest, and any other pertinent parameters. It should return a CSV file as output, whose name should be specified as a parameter input to the function.
Answers
Answered by
1
Answer:
'
Explanation:
Answered by
0
Explanation:
Listing All Files in a Directory
import os # List all files in a directory using os.listdir basepath = 'my_directory/' for entry in os. ...
import os # List all files in a directory using scandir() basepath = 'my_directory/' with os. ...
from pathlib import Path basepath = Path('my_directory/') files_in_basepath
Similar questions
History,
4 months ago
Political Science,
4 months ago
English,
8 months ago
Math,
8 months ago
Geography,
1 year ago