How to safely maintain a status file
duncan.booth at invalid.invalid
Mon Jul 9 16:02:54 CEST 2012
Richard Baron Penman <richardbp at gmail.com> wrote:
> Is there a better way? Or do I need to use a database?
Using a database would seem to meet a lot of your needs. Don't forget that
Python comes with a sqlite database engine included, so it shouldn't take
you more than a few lines of code to open the database once and then write
out your status every few seconds.
con = sqlite3.connect('status.db')
cur = con.cursor()
cur.execute('UPDATE ...', ...)
and similar code to restore the status or create required tables on
Duncan Booth http://kupuguy.blogspot.com
More information about the Python-list