mardi 30 décembre 2014

What's the best way to get the next row from a sqlite table everytime my python script runs?

I have a python script that pulls one image url from a sqlite database and submits it to my blog. Cron runs this script once every hour. Everytime the script runs, it needs to get the next row in the table so it would need to somehow remember the id of the row that was "fetched" the last time the script ran. I'm wondering what the best way to do this is. Right now I'm just saving the id of the last fetched row in a file which my script reads on startup.


Aucun commentaire:

Enregistrer un commentaire