creating a file with current date as file name and checking for the file's existence with python -
I'm trying to do something like that.
data = "test data" + '\ N' now = datetime.now () now = str (now) f1 = str ((Now) .split ( "") [0] ) f2 = "Makdres" file_name = f1 + '_' + f2 fout = open 1: fout.write ( "data")
the file has been successfully created with the current date because File name and data are written on file. But the problem I am facing if I check the existence of the file, it is showing that the file does not exist, even if the file exists.
I has tried to force examined using (os.path.isfile (file_name)):
Comments
Post a Comment