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.


    Pythonista on Ipad

    Pythonista
    2
    2
    1097
    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.
    • Ayzar247
      Ayzar247 last edited by

      Hello, I am fairly new to python and pythonista.

      I have a small problem, when writing a fhand=open() function for .txt file my app gives a traceback error of no such fil exists.
      How do i read a txt file in python thats on my Files app locally on my ipad?

      Thanks in advance

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

        @Ayzar247 you have to, once, give Pythonista access to your "on my iPad" folder in Files.
        This is done via the open external, then folder, then select "on my iPad".
        .

        The choose the location

        Then you will see this

        And in your script, you will have access to a file by a path like

        path = '/private/var/mobile/Containers/Shared/AppGroup/EF3F9065-AD98-4DE3-B5DB-21170E88B77F/File Provider Storage/Myfile.txt'
        

        Where the EF3F9065-AD98-4DE3-B5DB-21170E88B77F part will be different for your device.
        I still have to remember how to find this value...

        Édit: create this script in this folder and run it

        import sys
        print(sys.argv[0])
        

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