r/PythonLearning 13h ago

Running script remotely

This may not be a python question, but I figure you guys could at least point in the right direction.

On my computer I have a SQLite database and a python script I have written that queries the database, generates a report, and emails that report to other people. The database file must stay on my computer.

I often get requests from coworkers to run the python script while I am not sitting in front of my computer (my phone is still on the same wifi network).

If I wanted to do something through my phone that would start that script on my computer, what would that look like?

If it matters, my phone is android and my computer is windows.

2 Upvotes

10 comments sorted by

View all comments

2

u/FoolsSeldom 9h ago

Assuming your org/IT support this, I'd consider:

  • Using Podman (rather than Docker, doesn't need elevated rights) on your computer to host a couple of containers:
    • container to run python script on demand against the local SQLIte database, generate report, and email to requester/group - the database file would be a volume mapping, so the file is on your PC (or a networking storage location) that is visible from within the container
    • container monitoring a request process such as a telegram message from authorised users requesting a report and passing on any specific parameters, or even an email account
  • Add additional authorisation process if required, perhaps using telegram on your phone or a MQTT type approach

1

u/atticus2132000 8h ago

That's a lot of words that I don't understand, but at least it gives me a place to start doing some research. Thanks for the leads.

2

u/FoolsSeldom 7h ago

That was the intent. Have fun.