Forum Archive

How to get code into pythonista?

bitbucket158

I see that you can export a python script from pythonista and Email it to yourself (or export an xcode project, etc). But how do you go the other direction? If I have a python script on my desktop computer how do I get that into pythonista on my iOS device?

Sebastian

Have a look at this thread
Is this what you are looking for?

bitbucket158

I think so. Thanks!

eliskan175

You can always just cut and paste the code into Pythonista but the gisthub trick is also useful.

bitbucket158

I'm actually having trouble with that - I pulled up the link for the "New from Gist" script in safari on the iPhone and I don't see any way to copy the script contents to the clipboard. If that worked it would be fine. If I use the "copy" command it only copies the page link. Tapping on the page contents doesn't give any select/copy options. How do you copy code from a Safari page so you can then paste it into pythonista?

eliskan175

Alright here's what I do:

Open up a gisthub code. Then place your finger on a word until a magnifying glass appears, then release to select one word (or you can double tap a word). You will notice two little circles on the corners of the highlighted word. You can pull those apart to select more text.

Once you select the block of text, an option to "Copy" should automatically appear somewhere on your screen.

http://static.iphonelife.com/sites/iphonelife.com/files/2009Fall/Thumbs/CopyPaste2.jpg

http://www.wikihow.com/Select-Phrases-of-Text-on-an-iPhone/iPod-Touch/iPad

Then just open up Pythonista and paste the code into Pythonista. To paste, all you need to do is tap on the empty line 1 of Pythonista's code window and it will give you the option to paste.

I hope that helps.

bitbucket158

awesome, thanks! As an aside, I see you can save a script to a gist on github. I noticed, though, that if the script already exists it adds a new one with the same name in github as opposed to updating the existing script.

Any idea how to update an existing gist as opposed to adding a new one with the script contents?

n8henrie142

.