Vlad Cofaru
Vlad Cofaru

Reputation: 13

Python automation project to run in the background

i just started working with python and with some scripts to automate some tasks. I manage to create a web scraper using selenium that notifies me daily with the latest news via a mail . Now the script works great if i run it manually , but my question is : How can i make the script to run automatically every day , and what option would you recomand . I know that you can use TaskScheduler and program it , but i was wondering if you know any options to run it directly in the cloud ? Also , i found some tutorials where they say to wrap all the code in an infinite loop and add a timer , and once you run the script it will stay active as a background process, I just started working with scripts and automation , so i would really like to know your opinion on the best way to run the script automatically . Thanks a lot

Upvotes: 1

Views: 1202

Answers (3)

Gokul nath
Gokul nath

Reputation: 524

If you schedule in your computer, i think it may not be proper solution. It's better to deploy it on any cloud platforms & schedule at any particular time.

I personally suggest Heroku, I'm using it for running multiple scripts for free. You can use scheduler addon for scheduling scripts to run at particular time as well. Please refer to heroku documentation & get started! Note: The script may run more time than you expected, please refer here to fix this.

Upvotes: 0

Im not sure if that is what you are looking for, but (if you are on windows) you could attach your program to your autostart. Probably your Startup Folder: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

Upvotes: 0

Evan
Evan

Reputation: 121

If this is on a unix-based OS, check out cron (this is a pretty good guide). You can schedule it to run your python script daily.

Upvotes: 1

Related Questions