Create Python Shortcuts on iOS

Home | Articles | Programming | Create Python Shortcuts on iOS Log in | Sign up

Photo by Rubaitul Azad on Unsplash

Pythonista is one of the best iOS apps for coding and running Python scripts. The latest version, updated for Python 3.10, no longer supports creating a Home Screen icon for running your scripts. This can be overcome with Apple’s Shortcuts app, but it took me a while to work out how to do it...

While iOS doesn’t natively support creating shortcuts for third-party apps, you can use the Shortcuts app to create custom shortcuts that interact with Pythonista. Here’s a guide on how to create a shortcut to run a Python script in Pythonista:

  1. Open the Shortcuts app on your iOS device.
  2. Select “All Shortcuts”.
  3. Tap the + icon to create a new shortcut.
  4. Use the search bar to find the “Run Pythonista Script” action. Tap on it to add it to your shortcut.
  5. In the “Run Script” action, tap “Script” and select the script you want to run from Pythonista.
  6. Tap ( > ) and select “Run in Pythonista App”.
  7. Tap ( v ) (at the top of the screen after “Run Pythonista Script”).
  8. Select “Rename” and edit the name.
  9. Select “Choose Icon”, then select a colour and an icon.
  10. Select “Add to Home Screen”.

Now, you can run your shortcut by going to your Home Screen and tapping the icon you created. It will execute the Python script within Pythonista.

This doesn’t bear a lot of resemblance to a native app, but it is a convenient way of accessing and running your Python scripts. Web apps have a more native look, and I’ll be writing an article on how to create these.

328   128

Become a member or supporter to get early access to new articles.

Support the Learning Pages project | ☕️ Buy me a coffee