import os, time

def get_information(directory):
    file_list = []
for i in os.listdir(directory):
    a = os.stat(os.path.join(directory, i))
file_list.append([i, time.ctime(a.st_atime), time.ctime(a.st_ctime)])
return file_list
print(get_information('/'))
Python: Get a list of all files and folders in a directory, the time of creation, the time of last modification. System independent solution?