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
-
@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. -
@cvp I use the last version (v 3.3 (330025)) from the App Store
-
@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))
-
And sorry, I'm in holidays and I didn't see that there was a new version in App Store π’
-
@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'] -
@Jo but, did you open the external folder?
-
@Jo, all you need to do is:
- In Excel: share, open in another app
- On the Share sheet, scroll down to Run Pythonista Script (or similar)
- 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.
-
@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.
-
@cvp Thx for your help.
The status now is:- I see under "EXTERNAL FILES" "File Provider Storage"
- I see the files , but i can't open the files with a Pythonista-Script
- 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 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.
-
@cvp My mistake. The screenshot is not there. Sorry
I see i have to wait 180 seconds -
@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"
-
@Jo Thus all is ok?
-
@pvg No, it's not o.k.. I make the following steps:
- Save the Excelfile with Excel on "Auf meinem iPad"
- Change to Pythonista
- Under "EXTERNAL FILES" choose "Open..." then "Folder..." then "Auf meinem iPad". The file is not there
- I chosse the subdirectory "Excel" an there i found the file
- When i choose the subdirectory, i see the name at the top "Documents"
- 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) -
@Jo said:
When i choose the subdirectory, i see the name at the top "Documents"
Unfortunately, Pythonista displays Documents for each such external folder
-
@Jo please try (with your Id)
path = '/private/var/mobile/Containers/Data/Application/B287D045-9D65-45AC-B31C-B957D4A475C6/Documents/Mappe.xlsx'
-
@cvp The same errormessage "[Errno 2] No such file or directory"
-
@Jo for me, this works with last iOS, last Pythonista
path = '/private/var/mobile/Containers/Data/Application/B287D045-9D65-45AC-B31C-B957D4A475C6/Documents/Mappe.xlsx' with open(path,mode='rb') as fil: r = fil.read() print(len(r))
Files app
Pythonista open external folder