12

How can I get a Python shell on my iPhone? I'm looking for step-by-step instructions.

It's jailbroken using greenpo1son, I have SSH enabled and know how to use it.

Michael Currie
  • 13,721
  • 9
  • 42
  • 58
JShoe
  • 3,186
  • 9
  • 38
  • 61
  • 1
    This sounds like more of a superuser.com question. Also you might want to provide more information about the things you have tried so far and what isn't working. – Andrew Hare Apr 05 '11 at 16:19
  • I checked Cydia, no luck. Do I not have the right repos? And I did describe what I tried and what didn't work. I tried some onlie guides but the searches in Cydia brought nothing up. – JShoe Apr 05 '11 at 17:50
  • It's in the Telesphoreo Tangelo repository by Saurik. – Anne Apr 05 '11 at 19:07
  • And I didn't see it in the Telesphoreo Tangelo repository. What;s the name of it? – JShoe Apr 05 '11 at 19:43
  • Cydia has a python 2.5.1. Which is really old. – Steven Lu Aug 21 '13 at 21:17

3 Answers3

13

You can browse the packages manually here:
http://apt.saurik.com/cydia/debs/

These are the Python related packages:
- iPhone/Python = Example applications including source
- PyObjC = Python/Objective-C connection library
- Python = Packages required to run Python
- Setup Tools = Package manager for Python modules

This guide will get you started running the first script:
http://gentechblog.wordpress.com/2009/10/07/how-to-python-on-the-iphoneipod-touch/
Especially: check the developer filter note, this makes the packages show up.

Here is the introduction to PyObjC by Jay Freeman (including example):
http://www.saurik.com/id/5
But you better start with running simple Python scripts!

Response to your comment:
Why do people keep down voting this? It's an honest question looking for an honest answer!

People on StackOverflow generally don't like requests for 'step-by-step' instructions or request for writing complete snippets of code. The scope of your question is just too wide, you better ask more specific questions. Show what you tried so far and what is causing the exact problem. For example, you show the link with the guide you're following and mention the step that's causing the trouble. If you ask it the right way, people are more then willing to help you. Just show what you tried to fix the problem yourself. I understand your intention is right, I voted you up :)

Anne
  • 26,765
  • 9
  • 65
  • 71
  • I'm sorry, but the guide you linked (http://gentechblog.wordpress.com/2009/10/07/how-to-python-on-the-iphoneipod-touch/) didn't say what to do if you were downloading manually the way you told me (which worked by the way). Should I SSH them into the _Applications_ folder on my phone? – JShoe Apr 05 '11 at 23:22
  • I did not mean you need to download the packages manually, those are the packages you should be looking for in Cydia after you added the Telesphoreo repository. Did you change Cydia filter to developer? Otherwhise these packages do not show up! If you really cannot install the packages through Cydia you can always do it manually by running dpkg. In that case first transfer the files onto the device and then run something like `dpkg -i /path/to/package.deb`. Hopefully this helps! – Anne Apr 06 '11 at 00:30
  • Okay I have them on my phone, but "hello python" just shows me a contact list. Why is that? – JShoe Apr 06 '11 at 16:02
  • Congratulations, you got PyObjC working. The HelloPython.app example shows how to import the contacts and display them in an UITableView. In other words, it does exactly what is should do :) – Anne Apr 06 '11 at 19:21
1

I found this app. It runs only a small set of modules but has otherwise few limitations (like having to use raw_input() instead of input())

http://sabonrai.com/wp/pythonmath

0

There is a repo https://github.com/linusyang/python-for-ios that has build script for python 2.7.6 and a prebuilt deb.

ljk321
  • 16,242
  • 7
  • 48
  • 60