r/learnpython • u/Rahul_Desai1999 • Sep 19 '20
When you automate something in python, you'd obviously have to run the script forever. Where can we run the script?
I want to automate something, and whenever that event occurs, I get an email But I was thinking I can't use my laptop for this as it's not on forever and when I run another script, the previous one stops and I don't get emails How do you approach your automations? Like, do you put it on some server that can run 24 7 or something?
473
Upvotes
78
u/mm11wils Sep 19 '20 edited Sep 20 '20
I have a Twitter bot that reads subreddits on existentialism, generates tweets and posts every hour. He's been going for about
43 years. @CanDennisDream (he's running on heroku, haven't paid a cent for it,since you pay for compute time, and he's not constantly computing(edit: I might have been incorrect on this, but if I were to do it I'd look into something like: https://elements.heroku.com/addons/process-scheduler)https://github.com/foxyblue/dennis_bot
edit: I don't recommend following the bot he's a prolific writer of mostly garbage