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.


    Shared files on the ipad

    Pythonista
    5
    28
    7069
    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.
    • Jo
      Jo last edited by

      Hello,
      i'm new in this forum and i hope i can get a answer to my question which employed me since 2 days.
      I want to create an app on my iPad, which read from an excel-file (xlsx or csv). I save the excel-file from excel in the directory "Auf meinem iPad". The problem is that i can't find the path in pythonista where the file is stored. I won't store the excel-file iin the cloud. I hope someone have an answer for me.
      P.S. sorry for my english
      Jo

      mikael 1 Reply Last reply Reply Quote 0
      • mikael
        mikael @Jo last edited by

        @Jo, share the file from Excel to Pythonista, and you will get it in Pythonista’s Documents root folder.

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

          @mikael, thanks for your quick answer.
          I save the file "mappe.xlsx" with the App "Dateien-App" in the folder "Pythonista 3", but in the folder:
          "/private/var/mobile/Containers/Shared/AppGroup/6ABBAC2F-5C86-4FDE-9028-6379CF436465/Pythonista3/Documents/"
          are only folders or file with ending *.py.

          or are there other ways to share the file?

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

            @Jo do you use the App Store version of Pythonista or the beta of the 3.3 version?
            With this beta, you can open an external folder, and then read a file from this folder.

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

              @cvp I use the last version (v 3.3 (330025)) from the App Store

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

                @Jo then, if you save your xls file in "on my iPad" folder, and if you open "on my iPad" folder as external folder in Pythonista, you can access the file as

                path = '/private/var/mobile/Containers/Shared/AppGroup/E778DE4A-FE79-42E6-9200-353821BFF879/File Provider Storage/Test.XLS'
                with open(path,mode='rb') as fil:
                	r = fil.read()
                	print(len(r)) 
                

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

                  And sorry, I'm in holidays and I didn't see that there was a new version in App Store 😢

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

                    @cvp Thx for your answers even thought your in holiday. I have saved my file in "Auf meinem iPad" and it looks like your screenshot. But their is no directory "File Provider Storage"

                    When i run the code:
                    import os
                    path = '/private/var/mobile/Containers/Shared/AppGroup/6ABBAC2F-5C86-4FDE-9028-6379CF4EE774/'
                    os.chdir(path)
                    print (os.listdir())

                    there are only this files/directories
                    ['.com.apple.mobile_container_manager.metadata.plist', 'Library', 'Pythonista3']

                    cvp mikael 2 Replies Last reply Reply Quote 0
                    • cvp
                      cvp @Jo last edited by cvp

                      @Jo but, did you open the external folder?

                      1 Reply Last reply Reply Quote 0
                      • mikael
                        mikael @Jo last edited by mikael

                        @Jo, all you need to do is:

                        1. In Excel: share, open in another app
                        2. On the Share sheet, scroll down to Run Pythonista Script (or similar)
                        3. In the Pythonista sheet that opens, select Import file...

                        And the file ends in your Pythonista Documents folder. Do not use any file manager app. If some of the above options are missing for you, let’s figure out how to enable them.

                        cvp 1 Reply Last reply Reply Quote 1
                        • cvp
                          cvp @mikael last edited by

                          @mikael I don't entirely agree. You are right if you copy your excel file to Pythonista local folder, but if you want to save your excel file in "on my iPad" folder, not in Pythonista and read your file without passing via a share, you can also access it as an external file via a normal script, outside the appex mode.

                          mikael 1 Reply Last reply Reply Quote 0
                          • Jo
                            Jo last edited by

                            @cvp Thx for your help.
                            The status now is:

                            1. I see under "EXTERNAL FILES" "File Provider Storage"
                            2. I see the files , but i can't open the files with a Pythonista-Script
                            3. Now the files which i will open are in the folder "..../Pythonista3/Documents" and this is sufficient

                            I wish you a few nice days in your holiday

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

                              @Jo files are in Pythonista3/Documents folder if you have imported them there 😀 with the "import file" standard script as adviced by @mikael. Both ways are ok.
                              But, if you have stored them in your "on my iPad" folder, you will reach them with my little script

                              ...and thanks for my holidays

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

                                @cvp, @Jo, my apologies, I really should have first clarified whether this was a one-time need, or something that would need to be repeated/benefit from both apps being able to access the file at the same time. I just somehow assumed the former, while the latter could be so much more powerful.

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

                                  @cvp I make some other test to open the file like your documentation. I have make a screenshot of my situation. I hope the screenshot will be shown. The script can't open the file.

                                  Alt Text

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

                                    @cvp My mistake. The screenshot is not there. Sorry
                                    I see i have to wait 180 seconds

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

                                      @cvp In your last screenshot you ask me if i open "EXTERNAL FILES" an open "Folder". Yes, when i do this, i see the file which i will open and i can open the file with Excel in the "Pythonista App"

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

                                        @Jo Thus all is ok?

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

                                          @pvg No, it's not o.k.. I make the following steps:

                                          1. Save the Excelfile with Excel on "Auf meinem iPad"
                                          2. Change to Pythonista
                                          3. Under "EXTERNAL FILES" choose "Open..." then "Folder..." then "Auf meinem iPad". The file is not there
                                          4. I chosse the subdirectory "Excel" an there i found the file
                                          5. When i choose the subdirectory, i see the name at the top "Documents"
                                          6. I choose the following pathes:
                                            a. path ='/private/var/mobile/Containers/Shared/AppGroup/6ABBAC2F-5C86-4FDE-9028-6379CF4EE774/File Provider Storage/Mappe.xlsx
                                            b. path ='/private/var/mobile/Containers/Shared/AppGroup/6ABBAC2F-5C86-4FDE-9028-6379CF4EE774/File Provider Storage/Excel/Mappe.xlsx'
                                            c. path ='/private/var/mobile/Containers/Shared/AppGroup/6ABBAC2F-5C86-4FDE-9028-6379CF4EE774/File Provider Storage/Documents/Mappe.xlsx'
                                            d. path ='/private/var/mobile/Containers/Shared/AppGroup/6ABBAC2F-5C86-4FDE-9028-6379CF4EE774/Excel/Mappe.xlsx
                                            e. path ='/private/var/mobile/Containers/Shared/AppGroup/6ABBAC2F-5C86-4FDE-9028-6379CF4EE774/Documents/Mappe.xlsx

                                          but when i start the script the command "with open(path,mode='rb') as fil: " >> [Errno 2] No such file or directory

                                          My ios Version ist 13.3.1
                                          My Pythonista Version v 3.3 (330025)

                                          cvp 2 Replies Last reply Reply Quote 0
                                          • cvp
                                            cvp @Jo last edited by

                                            @Jo said:

                                            When i choose the subdirectory, i see the name at the top "Documents"

                                            Unfortunately, Pythonista displays Documents for each such external folder

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