-1

I have a folder with different folders in it. In one of the folder I have a python script. The python script reads an excel file (which is in the same folder), scrapes information from the internet, updates the excel file and creates another excel file in the main directory.

My question is: As I can't run my computer non stop, I imagine it's possible (easy? and free) to upload all my folders on a website which will allow me to run my python (3.8) script. Do you have any suggestions ? Which website could be appropriate ? Pythonanywhere.com ? Plus, I'd like to run this script every morning at 6am.

Thank you for your answers ! :)

manny-
  • 129
  • 2
  • 10
  • Unluckily your question is off topic. Running a program periodically is not a programming problem and also we do not suggest third party resources including services here. – Klaus D. Dec 17 '19 at 07:57
  • Please have a look at https://stackoverflow.com/help/on-topic . – Klaus D. Dec 17 '19 at 08:00
  • I guess I know how to run a program periodically locally. However I need my script to run somewhere else as my own computer. So first I need to find where (with the help of people that know way more than me about this topic (that's why I've created this post)). And then I've just mentionned that the script should run periodically. So, you maybe don't want to suggest me any direction to solve my problem, it's okay for me, but maybe some other users would like to help me ;) – manny- Dec 17 '19 at 08:11

3 Answers3

2

Yes, you could use PythonAnywhere -- free accounts allow you to create one scheduled task, which can run once a day. If you have an account, you can set it up on the "Tasks" page.

Giles Thomas
  • 6,039
  • 2
  • 33
  • 51
  • I've managed to create all the folders with Pythonanywhere however I get an error when running my script. First time I run it : If I run it again : RuntimeError: implement_array_function method already has a docstring – manny- Dec 18 '19 at 09:41
  • Ah, I'd missed the fact that you're scraping something from the Internet in your original question -- sorry! If you're trying to scrape a site that's not on the PythonAnywhere whitelist for free accounts (https://www.pythonanywhere.com/whitelist/) then you'll get 403 errors when you try to do that. Free accounts can only access specific sites with public APIs :-( – Giles Thomas Dec 18 '19 at 12:40
1

Some public cloud providers, such as GCP, AWS, and Azure, offer free tier VMs. Simply run the code on those and set up a cron job. Though the network usage probably still costs you a few cents a month, this is a very cheap way to go. You could also consider setting up a FaaS solution against very low cost.

bartcode
  • 589
  • 4
  • 14
  • Ok I'll check your providers out. What do you think about Pythonanywhere? Could it also be a solution ? – manny- Dec 17 '19 at 08:26
  • Pythonanywhere offers a similar service as what's also offered by the mentioned cloud providers. I'd rather go for one of those, since there are more services available there and they don't charge you a fixed fee. If you set it up correctly, you only pay for the resources you actually use. – bartcode Dec 17 '19 at 08:52
  • I've managed to create all the folders with Pythonanywhere however I get an error when running my script. First time I run it : If I run it again : RuntimeError: implement_array_function method already has a docstring – manny- Dec 17 '19 at 10:38
  • I'm afraid I can't help with this specific error. Perhaps the source you're extracting the data from doesn't allow connections from Pythonanywhere or vice versa (although both explanations seem unlikely to me). As Doodle Dee mentioned, you should also consider using Heroku. [This page](https://www.heroku.com/python) gives a clear example on how to implement it. If these managed services are too hard to figure out, then I can only recommend to get yourself a (free tier) VM on one of the public cloud providers. – bartcode Dec 17 '19 at 11:03
0

As @Klaus said, this is not a programming question. If you are on linux you can use crontab to schedule your process.

crontab

And if you want to run it on the cloud you can use free services like Heroku

Doodle Dee
  • 13
  • 5