Learn Python the Hard Way: ex13
I am currently trying to execute an 'argv' command similar to one found in exercise 13 of this book.
Currently, I am having issues with the syntax and am receiving 'invalid syntax' errors.
Is there anyone here that is familiar with this book as well as pythonista that could let me know if pythonista has limitations making it difficult to solve this exercise?
Omega0 last edited by
You probably left out a comma somewhere or are you typing
$ Python ex13.pyto run it?. I tried the example and it worked perfectly.
omz last edited by
It might be worth noting that you can hold the run button for a second in order to pass arguments to it. This is different from how you'd usually do this on a desktop computer.
- Paste the text of the exercise into the Pythonista editor.
- Tap and hold the "run" button in the upper-right corner of the screen. The hold should last for a second or two.
- If you held the "run" button down long enough the a Run With Arguments text entry dialog will appear.
- Type "one two three" (with no commas) and tap Run.
- Rock and Roll...
Is there any way to reproduce this from the command line perspective?
If I'm following this book as a resource to help me learn python, is there any way for me to const the pythonista documentation and find out where exactly pythonista deviates from the regular desktop applications?
Edit: thank you much omz and ccc for the FYI. I've got it to run. Spent roughly 5 hours trying to figure this one out xD
You could do so using Shellista but don't go there yet. Command lines are for the previous millennium.
Instead, just recognize that an iPad is not a desktop computer and that means you do things slightly differently on an iPad than on a desktop computer. Typing into a dialog box is not that hard.
"you can hold the run button for a second in order to pass arguments" ... does anyone else find this causes a crash? I've tested it on IPad mini (original) and iPhone 4, both from a clean startup of Pythonista... both crash immediately you click 'Run'
@ccc Thank you much for the help provided this weekend.
omz's applications are game changing!