I'd like to run wolverine.py from within my project folder. But I get:
$ python /tmp/wolverine/wolverine.py script.py
Traceback (most recent call last):
File "/tmp/wolverine/wolverine.py", line 20, in <module>
with open("prompt.txt") as f:
^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'prompt.txt'
The fix is to calculate the path to prompt.txt relative to wolverine.py.
The allows running in the following way.
cd project
python ../wolverine/wolverine.py script.py
Imagine this folder structure:
I'd like to run
wolverine.py
from within myproject
folder. But I get:The fix is to calculate the path to
prompt.txt
relative towolverine.py
.The allows running in the following way.