Code: Select all
path = ("/tmp/trains.csv")
ftime = os.path.getmtime(path)
curtime = time.time()
difftime = curtime - ftime
if difftime > 3600:
downloaddue()
empty()
importdue()
sleep (10)
display()
display()
sleep (2)
Code: Select all
path = ("/tmp/trains.csv")
ftime = os.path.getmtime(path)
curtime = time.time()
difftime = curtime - ftime
if difftime > 3600:
downloaddue()
empty()
importdue()
sleep (10)
display()
display()
sleep (2)
Code: Select all
path = ("/tmp/trains.csv")
ftime = os.path.getmtime(path)
curtime = time.time()
difftime = curtime - ftime
if difftime > 3600:
print("If new, I shouldn't print!")
downloaddue()
print("downloaddue() was run.")
empty()
print("empty() was run.")
importdue()
print("importdue() was run.")
sleep (10)
display()
display()
sleep (2)
Code: Select all
root@raspberrypi:~/piticker# ./test.py
If new, I shouldn't print!
downloaddue() was run.
empty() was run.
importdue() was run.