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!
Forum Archive
Accessing files elsewhere on iPad
rwms
Feb 11, 2022 - 17:51
cvp
Feb 11, 2022 - 18:05
@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
rwms
Feb 13, 2022 - 11:39
Thanks. This works perfectly!