print(7)
sleep(10)
print(8)
when i typed this in Spyder's command line, I expected 7 to be printed, then after 10 seconds 8, would be printed, however, what happened was that both 7 and 8 are printed after a 10 second pause, why is this the case?
The reason I need this function is that I want Python to keep on searching for a file in a directory until it eventually appears.
done = os.path.exists ("done.txt")
while not done:
sleep(10)
done = os.path.exists ("done.txt")
will this work?
EDIT: corrected exist as exists.