[Tutor] Variables

Steven D'Aprano steve at pearwood.info
Mon Aug 1 22:15:47 EDT 2016


On Mon, Aug 01, 2016 at 01:26:19PM -0600, Palmer Gutke wrote:
> I'm trying to write a program w/ python that runs once a day and every time
> it does it adds 20 to a variable. How do I do this so it doesn't reset the
> variable to the original value every time I run it?

You have to read the variable from a file saved to disk, add 20, then 
write back to the file.

Does that answer your question? Do you need help reading and writing 
files?


-- 
Steve


More information about the Tutor mailing list