Script not finding .pyui file in folder on iCloud drive
SyntaxErrorSoft last edited by
Hi all, I have been trying to get the redux paint script here (http://www.superrune.com/tools/reduxpaint.php) to run in Pythonista, but every time I try and run the main .py script file, it says that it can't find the associated .pyui file.
The error is:
[Errno 2] No such file or directory: 'c64_painter.pyui'
I have tried extracting all the files into a separate folder on my iCloud folder (from my PC; I don't have a MAC) and also extracted straight into the home iCloud drive folder, with the same issue as above.
I have also tried importing the zip file into Pythonista, but it is greyed out and I can't select it.
I can't copy anything into the "Pythonista 3" folder that is generated by Pythonista (not visible from my PC), and Pythonista won't let me put anything but the .ui file into it.
The author Rune has suggested I ask here too...
I'm finding this rather frustrating :)
dgelessus last edited by
In general, if you open a script from an external location (such as iCloud Drive), the script cannot read files in the same folder. This is because iOS handles file access permissions very strictly - if you open a script from an external location in Pythonista, iOS gives Pythonista access to only that one file, but not to anything else in the same folder. This is probably why Pythonista can't find the pyui file in the same folder.
One exception to this rule is Pythonista's own iCloud folder. Since that folder belongs to Pythonista, it can always access all files in it. Normally I would suggest copying the files into that folder, but apparently that's not an option for you... It's strange that the "Pythonista 3" folder doesn't show up on Windows. Do you see any other app-specific folders on Windows, or do you only see the files under the root folder of iCloud Drive? You could try creating an empty file in Pythonista's iCloud folder (from inside the Pythonista app) - sometimes iCloud Drive doesn't display app folders until the app in question puts something into the folder.
If you want to copy arbitrary files (such as ZIP files) into Pythonista, you can use Pythonista's share extension for that. To do this, you need to "share" the ZIP file (if it's in iCloud Drive, tap on the "(i)" button next to the file, then on the share icon). This should bring up the standard iOS share sheet. In the bottom row of icons, you need to look for an action called "Run Pythonista Script". (If you can't see it, you need to scroll to the end of the row, tap on the three dots, then enable "Run Pythonista Script" in the list that comes up.) When you tap on that icon, a small Pythonista window pops up, and one of the options listed there is "Import File". Once you select that, the file is copied into Pythonista, where you can unzip it.
SyntaxErrorSoft last edited by SyntaxErrorSoft
I still couldn't see the Pythonista 3 folder from Windows, but I hadn't tried sharing via iCloud, only DropBox and that didn't give me the File Import option from Pythonista.
Doing it from my iCloud drive works - it imported fine and I was able to extract it to a folder and then run it :)
I did have to run it using version 2.7 of Python, otherwise I got an error, but that is a different issue :)