Forum Archive

Pythonista: Run Script with Command-Line Parameters?

mr88cet

(Apologize in advance if I just missed it, but I can't seem to find this either in the docs or this forum.)

Is there a way to invoke our scripts such that Pythonista prompts for would-be-command-line parameters, to appear to my script as sys.argv[]?

Conceptually/ideally, it would seem like any query in your code of sys.argv[] should trigger it to prompt for command-line parameters.

JonB

press and hold the play button, it will pop up a dialog asking for arguments.

mr88cet

Ah! Very good. Thanks!

halloleooo

Is Pythonista able to be used to convert this to an iOS app?

Depends on what you mean with "convert this to an iOS app". You should be able to run the bot under Pythonista. But it won't be its own iOS app. The bot will run insde the Pythonista app.

How does pythonista handle command line type parameters and sqlite3 storage?

I don't know about sqlite, but you can certainly give scripts you run under Pythonista command line arguments on run.