Shared files on the ipad
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 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
@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.
@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)
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))
Pythonista open external folder
@Jo just to be sure you get the correct path of your Mappe.xlsx file when it is defined as an external file,
- create this little script as a Pythonista tool
import editor def main(): print(editor.get_path()) if __name__ == '__main__': main()
- édit your Mappe.xlsx in a Pythonista tab and execute the tool
@cvp You are right the path has changed. It looks like the path for external files is "/private/var/mobile/Containers/Data/Application/37E6A0DC-0618-4E14-9AD2-75E03BA90884/Documents/Mappe.xlsx"
The path of the Pythonista Files is Path='.../6ABBAC2F-5C86-4FDE-9028-6379CF4EE774/...'
That solved my problem. Thank you very much for your continued support.