thebaselab / codeapp

Building a full-fledged code editor for iPad
https://code.thebaselab.com
MIT License
2.95k stars 202 forks source link

Working with multiple files (.txt or .py) #692

Closed Bschoy closed 1 year ago

Bschoy commented 1 year ago

I am using multiple .txt files to read and write to in python. These all are in the same folder as the Script. Testing it using a MAC worked fine but on IPad it says File not found. I tried giving the PATH in Addition to the file name but it still doesn't work.

from: "test.txt"

to: "Auf meinem iPad/Code/Newly-Seen-Analyse/final/test.txt" (My system is in German)

Any workarounds or solutions?

bummoblizard commented 1 year ago

Can you show me the source code?

bummoblizard commented 1 year ago

Try to cd into the folder containing your source code and run Python in the terminal manually there. The paths are incorrect because they are relative to the current working directory.

「Bschoy @.***>」在 2022年12月12日 週一,23:12 寫道:

[image: image] https://user-images.githubusercontent.com/96501815/207081086-d4d0a7d7-551e-4f0c-9a80-ad81074346ae.png

[image: image] https://user-images.githubusercontent.com/96501815/207081128-647588d5-c7fb-4c2d-9a91-cec2370b6767.png

— Reply to this email directly, view it on GitHub https://github.com/thebaselab/codeapp/issues/692#issuecomment-1346676138, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJE6T22T6HN6P2QVRRSGF7LWM46FFANCNFSM6AAAAAAS374RCQ . You are receiving this because you commented.Message ID: @.***>

bummoblizard commented 1 year ago
cd Newly-Seen-Analyse
cd final
python preparation.py
bummoblizard commented 1 year ago

It's related to relative paths. Paths inside your Python code are relative to the working directory. When clicking the button to run, the working directory is always the root of your project folder.