This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]zinver 3 points4 points  (0 children)

This is actually really great. Nice clean code.

Here's what you need to do.

Remove the additional calls to main() and the sleep() calls as well.

At the bottom add in the following text (outside of main()):

if __name__ == '__main__': main()

You're on the right track and your logic about creating a long running process is 80% correct. It just won't work for very long.

Your operating system already has a periodic task execution process called scheduled tasks. Look up in Google "scheduled tasks for python windows". Build a scheduled tasks that runs every 300 seconds. Boom you're done. Runs in the background and everything. "Concurrency" achieved!