Forum Archive

Pass command line params?

kojack

Is there a way to pass parameters to a script? In other words, if I have a script that connects to a site entered by the user is there a way for me to enter the target site in Pythonista?

ccc

Press and hold the 'run' button for an extra second or two and you will be asked for sys.args.

dgelessus

Nice trick, didn't know that one yet.

If you want to you can also use the console module to show an input prompt, or the clipboard module to use a URL from the clipboard, or both.

kojack

Awesome! Thanks for the replies