Python includes the wonderful "shelve" feature, which allows the developer to store the content of variable to disk so that they are preserved between executions of the program.
import shelve
dbase = shelve.open("mydbase")
try:
sunSetTime = dbase['sunSetTime']
except:
sunSetTime = datetime.datetime(now.year, now.month, now.day, 18, 00, 15)
finally:
dbase.close()
|
Python >