Python programming on the touch?

Discussion in 'iOS Jailbreak & Cydia' started by 16gbofmagic., Feb 9, 2008.

  1. 16gbofmagic.

    16gbofmagic. New Member

    Joined:
    Jan 24, 2008
    Messages:
    299
    Likes Received:
    3
    Device:
    iPod touch
    Hey guys. I just downloaded Python runtime environment so that I could *hopefully* program on my touch, not just run programs saved as .py. So, my question, is there something I can do to make programming on my touch possible?
  2. 16gbofmagic.

    16gbofmagic. New Member

    Joined:
    Jan 24, 2008
    Messages:
    299
    Likes Received:
    3
    Device:
    iPod touch
    I hate to bump threads, but it sure is better than making a new one.

    No one has any idea?
  3. junk

    junk New Member

    Joined:
    Feb 8, 2008
    Messages:
    2
    Likes Received:
    0
    can try using vim in vt100

    Please Register or Log in to view images



    but guess you are referring more to 'native' iphone applications, that i have no clue

    Please Register or Log in to view images

  4. spinner

    spinner New Member

    Joined:
    Nov 9, 2007
    Messages:
    377
    Likes Received:
    14
    Yes, if you go to /usr/bin and find the "python" command file (this is the interperator) just copy that into any app you make. Then write it into the program to navigate to the app folder and launch the python interperator before doing anything else. This also means anyone can run the app on their touch, even if the never install python runtime! Why? Because just like jiggy, a copy of the interperator is include in each app you make! This will also work with perl and ruby, as long as you include the interperator of that language in every app. (I don't know if you need to include modules)
  5. spinner

    spinner New Member

    Joined:
    Nov 9, 2007
    Messages:
    377
    Likes Received:
    14
    What does "vim" do?
  6. junk

    junk New Member

    Joined:
    Feb 8, 2008
    Messages:
    2
    Likes Received:
    0
  7. 16gbofmagic.

    16gbofmagic. New Member

    Joined:
    Jan 24, 2008
    Messages:
    299
    Likes Received:
    3
    Device:
    iPod touch
    I may be reading the responses wrong, but to clarify, I am trying to program on my ipod, not for it.

    Basically, I figured out the command line version using a terminal emulator, but I want to be able to program the way IDLE works on my PC. So write the whole program THEN run it. Any way to do that?
  8. spinner

    spinner New Member

    Joined:
    Nov 9, 2007
    Messages:
    377
    Likes Received:
    14
    Ohhhhh, okay, Yes, just use mobiletexedit.app and you can write all the scripts and save them as .py files. Then open terminal and type "python cheese.py" without the quotes. (cheese.py is just a generic I used, you would type in whatever you named the .py file. But make sure you save the .py file in /bin and make it 755 permissions. Then it will run your program and you can begin debugging.
  9. 16gbofmagic.

    16gbofmagic. New Member

    Joined:
    Jan 24, 2008
    Messages:
    299
    Likes Received:
    3
    Device:
    iPod touch
    Thanks Spinner. I'm still a bit confused, though. I installed Terminal and MobileTextEditJ or whatever and wrote my program (It was a simple print "hi" ), saved it as Program.py, opened up Terminal and wrote python Program.py and got a syntax error. Can you explain what the /bin and permissions are?

    Thanks again.
  10. steve19137

    steve19137 New Member

    Joined:
    Feb 8, 2009
    Messages:
    706
    Likes Received:
    0
    i hate to bump this thread thats over a year old, but you have to go into cydia, search python, then install the first one you see (before you do that, make sure that you have yourself known as a developer in the cydia settings. click settings in the manage tab, then choose the no filters one. i dont remember what it says, but choose developer). that will install all the stuff you need for python debugging. then do something else.

    you need to store your script in /var/private/mobile/

    go to terminal, type "su root" then it will ask you for a password. what ever password you use to log into your ipod through winscp is the one you type in.

    then type "python (yourFileName).py" without the punctuation. that will start it. hope this helps.

    again, sorry for bumbing a year old thread. just wanted to share what i found.

Share This Page