I want to create a function that will iterate through a list to file names that I put in, and then when the conditions are met I want it to copy each subsequent file to a file named 'INPUT'.
Here is what I have so far:
file_list = [file1, file2, file3]
def queue():
if condition1_met:
for item in file_list:
os.system('cp item INPUT')
else:
return queue()
However I just don't know what the best way is to iterate and then copy the file, since that os.system bit won't recognize 'item'.
INPUTmeans they each replace the previous version. Only the last such copy will remain.