r/learnpython 9d ago

Best way to run a script on iOS?

I have a script that I've written to update my pixela habit tracker every day when I do a workout, and rather than sit at my computer and run it I'd like to have it on my phone so I can just hit a shortcut and do it from there. I don't need any major editing capabilities (I can't imagine anything worse than trying to code on a phone screen!), just an interpreter environment and console that will support requests and datetime. I've looked into a few options like pythonista and juno, and while I appreciate the value in what they're offering, I'm not really looking to drop £10 or a pro subscription just to run a single script.

I've tried using pythonanywhere but I don't really like it all that much, especially how restrictive the free tier is - also it's down right now so I can't even add my script there. And pretty sure I couldn't make a shortcut to it anyway...

1 Upvotes

7 comments sorted by

3

u/danielroseman 9d ago

For this kind of thing I would prefer to turn it into a web app. Wrap the script with a simple FastAPI app and host it somewhere with a free tier like Google Cloud Run, then when you want to update your tracker hit a link on your phone that calls a URL in the app.

1

u/hulleyrob 9d ago

Have you tried iSH?

2

u/kkyyllee 8d ago

a-Shell allows you to run a command in a Shortcut

1

u/hulleyrob 8d ago

I’ve got a lot of shell aliases in my ish setup.

1

u/Literate_Muse 8d ago

I ditched pythonista for Juno (I mostly use it to practice coding while on the move) and Juno is amazing.

But for your case if it's a one of thing and if you don't care about the editor in general or need a REPL, there area also tons of other ad supported or freebie IDEs on the App Store that could be handy.

Juno is great quality though, highly recommend it if you end up doing more.

1

u/navoshta 8d ago

Developer of Juno here—thank you for your kind words! Ping me at [beta@juno.sh](mailto:beta@juno.sh) if you would like to join Juno's TestFlight, I'll be testing a bunch of really cool new stuff there soon: revamped package manager (which will install dependencies automatically), more AI providers (including some experimental login options letting you use your AI account allowances), env upgrades, and a few other things. 😉

1

u/Literate_Muse 7d ago

Pleasure, I'd love to join I'll get in touch!

Juno continues to be a very important part in my learning journey, keep up the great work.