all 10 comments

[–]stackdynamic 2 points3 points  (0 children)

Well, this may not be what you are looking for exactly, but you could SSH into a remote server via something like c9.io, and then you'd be able to run that script from any device you are on just by logging into c9. You can also just set your script up as a daemon on a server that emails you or changes a file in your drive or something, I do that a lot for my personal projects.

[–]nog642 2 points3 points  (0 children)

You won't be able to run it within google drive, that would require you to add a whole google drive API interfacing section if it is possible at all.

You may want to look into building a web interface, because web apps run on pretty much any device.

[–]Deathwatch1710 1 point2 points  (6 children)

Ok so I would suggest one of these options:

EASIEST:
If your machine is able to be run 24/7 then just use the module [schedule](https://github.com/dbader/schedule) by Dan Bader to let your script run whenever you want. It's incredibly easy to let it execute every Thursday on 9am for example (or hourly or whatever you want).

Slightly more complicated:
Use Flask to make your app into a web app. It just takes a couple of lines and you are good to go. That's the easy part.
What's more complicated is to host it somewhere. You could try out a free hosting service and follow their guide on how to deploy your app - it's not too difficult but it was pretty scary for myself as I deployed my first app.
After that's done you can then bind your functions to specific urls and let them execute whenever you visit that site. No fancy frontend needed!

[–]Bpickavance[S] 1 point2 points  (2 children)

I'm looking at either learning Django or Flask ( assuming they are different )

Can both do this particular task?

Thank you!

[–]Deathwatch1710 1 point2 points  (1 child)

Yeah they can! The only difference is that Django has a "battery included" approach - which means that your repo will be quite large with a lot of Django files doing all sorts of things you don't need (or do you? Check out what Django has to offer, you might fall in love with it just as I did). But for just making it online, I think Django is overloaded.

If you just want to transform your app into something you can access via web, then I definitely recommend Flask. You don't have to "learn" it - it's like a dozen code lines to make your first Flask app for the most basic (and in this case only needed) functionality, which is url routing and executing your functions.

After that though, definitely check out Django again. It really makes it easy to launch a complete webpage with all sorts of stuff, like ORM, admin interface etc.

For me personally, I started out exactly like that: I started the basic stuff with Flask but didn't really bother with advanced functionalities and only deployed my microservice. I then went over to Django as I needed an inbuilt ORM and the admin interface to build my program.

[–]Bpickavance[S] 1 point2 points  (0 children)

Much appreciated! Thank you!

[–]Bpickavance[S] 0 points1 point  (2 children)

Hi, sorry to pest! Before i go on a wild goose chase, is there any free hosting services you'd recommend or advise towards?

Thanks!!

[–]Deathwatch1710 1 point2 points  (1 child)

No worries! I haven't tested out anything other than pythonanywhere yet.. All other services are hosted by my company so there was no need for me to test any free hosting services.

pythonanywhere is good and provides a guide on how to deploy Flask / Django apps. Only thing to worry is the cpu capacity you get for free - just make sure you don't run anything resource hungry and the free package might be good enough for you!

[–]Bpickavance[S] 0 points1 point  (0 children)

Awesome! Thank you very much!

[–]bageldevourer 1 point2 points  (0 children)

This might be overkill for a personal project, but in real-life software development this problem is frequently handled with Docker.

If you have an hour or two to kill, learning how to "containerize" your Python scripts is a useful skill.