Hey guys, thanks a lot for the help.
Here's the code I have for going through each file in a directory I specify:
for root, dirs, files in os.walk('%s'%(DOSEnvironVar)):
for this_file in files:
if this_file.find('.csv')>-1:
filepath = os.path.join(root, this_file)
currentfile=open(filepath,'r')
filelines = currentfile.readlines()
I would like to add a way to if the file was created (or modified) in the past three hours. So a change like this (pseudo code):
if this_file.find('.csv')>-1 and this_file was created in the past three hours:
filepath = os.path.join(root, this_file)
I'm not very good with the time module yet, which is why I'm asking for help. Thanks!