Setup
Either you could get PyPad which is a very simplistic Python runtime environment (as of today, version 2.7.1 there is not even a way to save/import/export your code) or you could go for the full-blown thing:- Jailbreak your iPad. I did it with this tutorial.
- From the Cydia app (which will get installed once you jailbreak your iPad), install the Python package.
- Either get MobileTerminal or iSSH to be able to open a console. If you choose iSSH, make sure to get OpenSSH from Cydia, too.
- Change your root and mobile (which is the default user) password to something else than the default "alpine".
- Get Textastic. This is the best Python-capable text editor I've found so far. Let me know if you know a better one.
Workflow
This is the workflow I'd recommend:- You edit your .py files in Textastic. No need to save, it gets auto-saved every 10 seconds.
- Change to iSSH or MobileTerminal, go to the directory where Textastic saved your .py and run it with
python yourcode.py
/private/var/mobile/Applications/CA9452ED-D107-4D79-B774-1DFEF7097573/DocumentsIf you can't find your files, just do a
find / -name filename.pyto find the correct directory.
Alias
To make things easier, you could set up a neat little alias, that'll make it easier to change to your Textastic document directory:- Add this line to your /var/root/.bashrc
alias textastic="cd /private/var/mobile/Applications/CA9452ED-D107-4D79-B774-1DFEF7097573/Documents"
- Add this line to /etc/profile
source /var/root/.bashrc
Keyboard
Typing code on the iPad is no joy with the screen keyboard. Get yourself a bluetooth keyboard like this, it helps tremendously.
Hope this help you all get started, be sure to leave some feedback, I'd appreciate it. Thanks!