I am new to python.
I was trying to write a program that will read files from a .txt file.
(that means I have a 'filenames.txt' file and have filenames with their paths in that file) How can I read those file names from that .txt file and get the date the file was created?
Heres the code I came up with:
import sys, os
import pathlib
# list of filenames with their paths separated by comma
file_list = []
# input file name which contains list of files separated by \n
with open ('filenames.txt' , 'r+' ) as f :
list_file = f.readlines().splitlines()
input_list = file_list + list_file
def file_check(input_list):
if input_list is none:
print ("input_list is null")
print (input_list)
Thanks in advance.