omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Download script into Pythonista

    Pythonista
    18
    39
    36164
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • omz
      omz last edited by

      There are various options, my current favorite is the script I've already linked to on Twitter:

      → PythonistaFTP.py (GitHub)

      It basically starts an FTP server on your device that you can then connect to from a Mac/PC.

      If you're new here, it might seem a little odd that you need a custom script for something as basic as this, but unfortunately, it's not possible for me to include any kind of file import as a built-in feature because of Apple's app review guidelines. In short: downloading or importing executable code is not allowed.

      1 Reply Last reply Reply Quote 0
      • userista
        userista last edited by

        You can even use this with an FTP client on your device to transfer files into Pythonista locally. E.g. Transmit which has a share sheet extension.

        EDIT: and now I see that @omz already thought of that ;)

        1 Reply Last reply Reply Quote 0
        • Obelisk
          Obelisk last edited by

          I'm new here, after downloading .py and .pyui files into Pythonista's a folder, how to make it run if report erros: no module named numpy, no module named ui etc.

          1 Reply Last reply Reply Quote 0
          • ccc
            ccc last edited by

            • If you put just one line, import numpy, into a .py file and run it, does it report an error?
            • If you put just one line import ui into a .py file and run it, does it report an error?
            • If you go into Apple's App Store application, does it indicate that there is an upgrade available for Pythonista?
            1 Reply Last reply Reply Quote 1
            • Webmaster4o
              Webmaster4o last edited by

              I would try uninstall/reinstall pythonista, or update it. If you have no UI or numpy, you're running a pre-1.5 version.

              1 Reply Last reply Reply Quote 0
              • ccc
                ccc last edited by

                Make sure to use PythonistaBackup.py or something like it to save all of your scripts onto another device BEFORE you uninstall Pythonista or your scripts could be lost forever.

                1 Reply Last reply Reply Quote 0
                • Obelisk
                  Obelisk last edited by

                  Much obliged. Its a pre-1.5 version.

                  1 Reply Last reply Reply Quote 0
                  • drscheme
                    drscheme last edited by

                    There's also a webdav server written in Python that you can execute in pythonista. Search for "pythonista webdav" in github.

                    1 Reply Last reply Reply Quote 0
                    • mbl1230
                      mbl1230 last edited by

                      I am a real neophyte regarding networking so this may sound like a stupid question. I copied the PythonistaFTP file to my iPad and it appears to work correctly. But when I try to connect as guest to my macbook pro the connection attempt times out without actually connecting. Does something in the wireless router need to be changed to enable the connection to go through? I have previously successfully made connections between my computer and portable devices on port 8080 without needing to configure the router, but perhaps port 2121 is different.

                      1 Reply Last reply Reply Quote 0
                      • dgelessus
                        dgelessus last edited by

                        Try connecting to your device by IP address (192.168.x.x), not the name (my-device-name.local). You can find your device's IP address in the wi-fi settings by tapping on the network that you're currently connected to.

                        1 Reply Last reply Reply Quote 0
                        • mbl1230
                          mbl1230 last edited by

                          That did the trick. Thanks for the suggestion. Perhaps Ole could add this suggestion to the instructions that are printed to the console when the server starts to aid other neophytes such as myself.

                          1 Reply Last reply Reply Quote 0
                          • mbl1230
                            mbl1230 last edited by

                            I have a general question about PythonistaFTP. I used finder on the mac to start an ftp session to verify that dgelessus' suggestion worked. After closing the link I noticed that a log of the communication was printed to the console and that a new session was started and, after each file retrieved from Pythonista on the iPad, that session was then closed. I also noticed that at the start of the connection it seemed like there were two identical sessions opened that were not closed until the end of the communication. Is this the way that PythonistaFTP is supposed to work? My limited knowledge is many years old, but in years gone by when I would manually use ftp, I would log in to the remote machine and keep the session open until I had moved all the files that I wanted. Only then would I log out of the session.

                            1 Reply Last reply Reply Quote 0
                            • farf
                              farf last edited by

                              I am also trying to use the FTP server to manually sync scripts between my iPhone and iPad. I downloaded the script on both devices and had difficulty connecting from my Mac until I used the IP addresses instead of the device names. Not a big problem.

                              I was then able to drag scripts from each device to a folder on my Mac. The problem is that I can't upload any of those scripts to the other device to complete the manual sync.

                              It seems to be a permissions issue because the FTP "drive" is read only to me.

                              Any thoughts?

                              1 Reply Last reply Reply Quote 0
                              • mbl1230
                                mbl1230 last edited by

                                I don't really have an answer to help you with uploading from a Mac to your mobile device, but I had the same problem. Uploads from the Mac are blocked for some reason. My solution was to send the file I wanted to upload to a Linux machine (Ubuntu 14.04 running Gnome). On the Linux machine the upload action to the iPad was essentially the same as used on the Mac. On the "Places" menu that opens a file manager menu there is a "Connect to Server" menu item. Because this worked on the Linux machine the problem is apparently due to some security restrictions in place on the Mac. I, too, would be interested in a solution for the Mac if someone has one. Although I haven't verified that it works, I think that you can also do the transfer via the Windows 7 or greater file manager.

                                1 Reply Last reply Reply Quote 0
                                • farf
                                  farf last edited by

                                  Hopefully someone will be able to shed some more light on this. Thanks for showing that it's not a general problem but specific to the mac platform or some mac configuration that I'm not familiar with.

                                  1 Reply Last reply Reply Quote 0
                                  • ManuelU
                                    ManuelU last edited by

                                    @farf Hi, do you refer to the IP Address In the iOS devices?. In your Mac what do you use as User and Password?. The Mac OS X you use is Yosemite. Thanks in advance for your Help

                                    1 Reply Last reply Reply Quote 0
                                    • omz
                                      omz last edited by

                                      @ManuelU You can find the IP address of your iOS device in the WiFi settings (tap the "(i)" next to your connected WiFi network in the Settings app).

                                      The local IP address of my iPad is 10.0.1.5, so I connect to ftp://10.0.1.5:2121.

                                      Select "Guest/Anonymous" when you're asked for authorization.

                                      1 Reply Last reply Reply Quote 0
                                      • ManuelU
                                        ManuelU last edited by

                                        @omz,@farf thanks. It worked at an incredible speed

                                        1 Reply Last reply Reply Quote 0
                                        • ovrCaffeinatd
                                          ovrCaffeinatd last edited by

                                          Anyone try this with iOS 9? Guest/Anonymous is logging: USER 'guest' failed login (twice, fwiw).

                                          1 Reply Last reply Reply Quote 0
                                          • JonB
                                            JonB last edited by

                                            you might try adding

                                            import logging
                                            logging.basicConfig(level=logging.DEBUG)

                                            before the lines that start the server. Then, check the console in pythonista to see if there are any errors logged server side.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Powered by NodeBB Forums | Contributors