Computer Science, asked by sainiabhi48, 8 months ago

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 laxmidevi6739
1

Answer:

'

Explanation:

Answered by suridhiraj901
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