FAQ  •  Register  •  Login

How to transfer .py docs to and from PC/Mac [No Jailbreak]

Moderators: Skyler, Jonathan Hosmer

<<

Redjericho

Posts: 1

Joined: Sat Apr 28, 2012 6:10 pm

Post Sat Apr 28, 2012 6:34 pm

How to transfer .py docs to and from PC/Mac [No Jailbreak]

It's quite simple and I'm sure some of you have already heard of it, and if you are jailbroken there are easier methods, but here is a quick tutorial on how to transfer .py documents to and from your PC/Mac simply over USB.

First: Go to this website http://www.macroplant.com/iexplorer/ and download the version of iExplorer for your operating system. iExplorer is a simple GUI for viewing, editing, and manipulating files on your iOS device.

Second: Run the installer, and follow directions given, connect your device to your USB port and a list of files on your device will appear.

Third: See the "Apps" icon on the left side and click the + sign. A list of files will appear, these are your applications, the names are messed up, so it may take some searching to find Python for iOS, mine is personally called "com.hoz.ipython" it is probably the same for you. **Sometimes iExplorer will tell you that you can only open 5 directories per session after your first install, just close and run it again to fix it**

Four: Open the folder called "Documents" located in the Python for iOS directory, et voila! A list of all saved files is there, (If you are participating in the Test Flight beta, you will need to open the corresponding file that you saved your script in eg. "User Scripts" or "Modules" before you see your scripts) and you simply drag them onto your desktop to get them onto your computer, or drag them from your computer to that folder and they will be capable of being edited in Python for iOS.


There is so much you can do with iExplorer, you can transfer any documents from any other app that doesn't/can't support iTunes/Dropbox/cloud transfer, or even move a file from one app to another app. Warning though, transferring files to and from apple created apps doesn't always play nicely, and I wouldn't recommend screwing around with files that you don't understand.

Side note: Can't wait for Python 3 support so I can use this app effectively again!
<<

nice_guy

Posts: 8

Joined: Tue May 15, 2012 4:25 pm

Post Sat May 19, 2012 2:56 pm

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

...there is another easy way to transfer .py-files from your PC to python-for-iOS:

(1) put your py-script into a plain text email (as text, not as attachment)
(2) mail this to your iPad
(3) open the mail --> select all --> copy
(4) go to python-for-iOS
(5) open new (empty) document --> paste

That's it. This worked fine for me.

Best regards from the nice_guy.
<<

sregor.egroeg

Posts: 1

Joined: Sun May 27, 2012 2:42 pm

Post Sun May 27, 2012 2:45 pm

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

Great tips from both Redjericho and nice_guy, thanks.
<<

bassman

Posts: 5

Joined: Tue Jul 24, 2012 4:37 pm

Post Tue Jul 24, 2012 4:40 pm

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

Doesn't Python for iOS include "file sharing" in iTunes? Can't you just drag/drop via "file sharing" in iTunes?

Note: I'm looking into Python for iOS, but don't have it yet. Kind-of a "must have" feature for me...
<<

bassman

Posts: 5

Joined: Tue Jul 24, 2012 4:37 pm

Post Tue Jul 24, 2012 5:23 pm

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

I see that exchange of .py files is indicated as restricted by Apple (FTP, iCloud, Dropbox, etc.). I'm confused. techBasic has iTunes "file sharing": http://itunes.apple.com/us/app/techbasic/id470781862?mt=8

The Apple limitations on the iPad really have me ready to "jump ship". The huge sales of iPads made me want to give the iPad a try, but if Apple doesn't "loosen-up" a bit, I'll eagerly be moving away from iOS.
<<

Jonathan Hosmer

Site Admin

Posts: 215

Joined: Mon Feb 27, 2012 7:47 pm

Post Wed Jul 25, 2012 1:51 am

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

They restrict file sharing/syncing only for Apps that actually "execute" the code in those files. I think it is a safeguard against those people who would import a (potentially malicious) python script and run it without actually understanding what the script is doing. I understand the intent of the policy, but disagree with the general idea of protecting a user from themselves (just one of the many reasons I switched from Windows to Linux many years ago).
<<

bassman

Posts: 5

Joined: Tue Jul 24, 2012 4:37 pm

Post Wed Jul 25, 2012 11:45 am

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

Please see page 11 of the iPad techBASIC app: http://www.byteworks.us/Byte_Works/Documentation_files/techBASIC%20Manual%202.2.pdf

iTunes File Sharing *is* allowed for the techBASIC iPad app, which provides a rather robust BASIC programming environment.

Maybe Apple app policy is "subject to interpretation"?

I almost understand the "sandbox" for individual apps to protect the overall iOS system (though it is making me less happy with Apple each day), but I can't understand protecting an iPad app from itself. I'm reminded of one of "Murphy's Corollaries": "Build a system even an idiot can use, and only an idiot would want to use it."

If Apple doesn't loosen-up, I think Microsoft Windoze 8 (Pro) will really cut into Apple's tablet sales in 2013. Non-programmers could care less (and don't know better), but not everyone is content with a "consumption device".

Note: I realize I'm preaching to the choir here. I just see you as one of the last "rays of hope" before I dump the iPad.
<<

bassman

Posts: 5

Joined: Tue Jul 24, 2012 4:37 pm

Post Thu Jul 26, 2012 5:02 pm

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

BTW, I was reading the Apple documentation on the reasoning behind the "sandbox". The intent is to protect apps from each other; not protect an app "from itself".

Since Python is such a pivotal language now, if you do care to speak with Apple about allowing "File Sharing" in iTunes like techBASIC, you may care to refer them to this article: http://brontecapital.blogspot.pt/2012/07/changing-my-mind-on-microsoft.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+BronteCapital+%28Bronte+Capital%29, which talks about the rise of non-Microsoft companies.

For now, I fired-up an old Windoze laptop, and will be using that instead of my iPad (except for "kick-back web-browsing"). Apple is only "shooting themselves in the foot" if they don't loosen up a bit...
<<

Jonathan Hosmer

Site Admin

Posts: 215

Joined: Mon Feb 27, 2012 7:47 pm

Post Fri Jul 27, 2012 1:43 am

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

In v1.3.1 I had registered the ".py" extension to allow scripts to sync to/from the App <-> iTunes. I have also already written the code to handle the "Open In.." menu for .py files to launch the script editor with that file. However, when I submitted 1.3.1 with both of these features to Apple they rejected it citing the 'no file syncing for executable code' policy. So I had to remove it and resubmit to get it approved. I've got the code still written in the App, just commented out (actually it's inside an `#if 0` block) so that if they ever change the policy I can easily add it back in. I do plan to keep trying and even appeal if they reject it again but ultimately it's up to Apple.
<<

pauljohnleonard

Posts: 1

Joined: Thu Aug 02, 2012 4:38 pm

Post Thu Aug 02, 2012 4:47 pm

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

Hi,

I am new to ios python, ipads (or anything apple like).
I am correct in thinking that python for ios supports sockets so I should be able to write my own client/server code in python to transfer files?
I checked that I can create a connection and have sent "Hello world"


cheers Paul.
<<

Jonathan Hosmer

Site Admin

Posts: 215

Joined: Mon Feb 27, 2012 7:47 pm

Post Fri Aug 03, 2012 2:03 am

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

Hi Paul,

Yes, sockets do work in Python for iOS. Check out this example, ran a server and client on 2 different iPad's on the same network:

Image

Image
<<

bassman

Posts: 5

Joined: Tue Jul 24, 2012 4:37 pm

Post Fri Aug 03, 2012 11:19 am

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

If anyone stumbles over code to transfer files from iPad to PC that works with CPython 3.2, it would be great if they could post it. I'd love for my iPad to be useful for something besides a web-enabled paper-weight!

Because of Apple's "closed door policy", I've been lugging my laptop. I'd rather be able to use the iPad to write program modules, and have the flexibility to copy them to a "real computer". I don't use native email on the iPad (tried - hate it), so export via email is non-starter in my case.
<<

iice64

Posts: 3

Joined: Sun Aug 05, 2012 7:32 pm

Location: Germany

Post Tue Aug 07, 2012 5:23 pm

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

Hello,
I added a script to transfer the "User Scripts" via FTP in the Code section.
Carsten
<<

Mark Hamilton

Posts: 12

Joined: Sat Sep 08, 2012 8:34 pm

Post Thu Oct 11, 2012 1:28 am

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

nice_guy wrote:...there is another easy way to transfer .py-files from your PC to python-for-iOS:

(1) put your py-script into a plain text email (as text, not as attachment)
(2) mail this to your iPad
(3) open the mail --> select all --> copy
(4) go to python-for-iOS
(5) open new (empty) document --> paste
.


This worked for me, and with iOS 6 you can now copy from attachments. Just touch and hold the attachment, then pick QuickLook, and copy from there.

However, when I pasted it in the editor I couldn't find a SaveAs option (which is odd, since there is a SaveAs in the interpreter); I could only save it to MyScript.py. I can change it with os.rename(), but it's tedious.

Mark E. Hamilton
<<

Jonathan Hosmer

Site Admin

Posts: 215

Joined: Mon Feb 27, 2012 7:47 pm

Post Thu Oct 11, 2012 2:17 am

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

Tap the title text of the top toolbar where the script name is. It will let you edit the name of the script (which renames the file on the filesystem). I'll make it more obvious that you can edit the script name to directly rename the file in the next update as it does seem a bit hidden now.
<<

mopy

Posts: 6

Joined: Sun Mar 18, 2012 4:37 pm

Post Fri Oct 12, 2012 8:11 pm

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

Hi,

you should have a look at "DiskAid" http://www.digidna.net/products/diskaid/download application,
for which there are free downloadable versions available for Mac and PC.

With the free version of this Apps, you can transfer python files from and to the iDevice directly from your Mac or PC and by the way retrieve many other files on your iDevice ...
The full version provides even more features...

You just have to select the option :
Display all Apps even if they don't have their "File Sharing" enable
in the preferences,
and then to navigate to the folder
Apps>Python 2.7>User Scripts
to access to your Python scripts files.

The Apps is compatible with iOS 5 and 6 at least...

Cheers MoPY
<<

renx99

Posts: 1

Joined: Thu Nov 08, 2012 6:02 pm

Post Thu Nov 08, 2012 6:09 pm

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

do you think it would be possible to add a feature to fetch from and post to pastebin? That we could upload to pastebin from one environment and fetch from another. That might be pushing the limits of apple no file sharing rule.

What do you think?

Rene
<<

peterdq

Posts: 1

Joined: Fri Aug 23, 2013 4:22 pm

Post Fri Aug 23, 2013 4:33 pm

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

Heye Rene, I like this idea. It would be really useful to be able to fetch from and post to pastebin, but the apple restraints probably will prevent this, but if it is somehow possible that would be great.
My tria laser is cool, see tria laser reviews if you like.
<<

cclauss

Posts: 26

Joined: Wed Mar 13, 2013 6:45 am

Location: Lüsai, Switzerland

Post Wed Sep 18, 2013 10:53 pm

Re: How to transfer .py docs to and from PC/Mac [No Jailbrea

On the other python for iOS, you can do:
Dropbox sync (https://gist.github.com/wrenoud/4049625) and
Github sync (https://gist.github.com/davenicholls/5212628)
Perhaps you can adapt these ideas to Python for iOS.

Return to /discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron