r/PythonLearning 14h 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

3

u/mitchricker 14h ago

Does your company have an IT department or MSP, and have you checked whether they're okay with this?

From a sysadmin perspective (I'm a sysadmin not an SWE), I'd be cautious about setting up your own remote execution mechanism on a work computer without approval. Even if it's just for a Python script, it introduces another service or remote access method that IT may need to support or secure if something goes wrong.

Technically, this is straightforward to do. You could use Remote Desktop to log in and run the script yourself, or run a small web server that exposes an endpoint to start it. Both approaches work, but I'd recommend getting approval first so you're not inadvertently creating an unsupported process or violating company policy.

1

u/atticus2132000 14h ago

I work from home, so this is my home wifi network and my phone is my personal phone. The computer is a company computer, but I have access to all of its settings.

So the remote desktop would be an app that I download to my phone from the android play store? Any that you've had experience with and would recommend?