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.


    Accessing files elsewhere on iPad

    Pythonista
    2
    3
    538
    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.
    • rwms
      rwms last edited by

      I have a set of jpg files that I have uploaded into a folder on my iPad. I can see the folder in the External files list, and I can see the content of the folder when I select that folder.
      I want to open the files individually within a Python script, so that I can display specific images under interactive control.
      How do I create the full file path for each file to allow me to open it in my script?
      I am reasonably familiar with Linux and have used Python on Ubuntu, for example. So I am expecting to be able to construct a path to the directory where my jpg files are.
      I tried using the os package to navigate on the console, but when I tried to navigate up from the ".../Pythonista3" directory, I got an "Operation not permitted" error. Does iOS prevent accessing directories outside Pythonista's own directories?
      Thanks in advance!

      cvp 1 Reply Last reply Reply Quote 0
      • cvp
        cvp @rwms last edited by

        @rwms said

        How do I create the full file path for each file to allow me to open it in my script?

        Create in the folder that you want to access a little .py file with

        import editor
        print(editor.get_path())
        

        Run it and it will print this full path

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

          Thanks. This works perfectly!

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