"Martin A. Brown" a écrit dans le message de
news:mailman.108.1459179618.28225.python-l...@python.org...
Greetings,
In a program "code.py" I read an external file "foo.txt" supposed
to be located in the same directory that "code.py"
python/src/code.py
python/src/foo.txt
In "code.py": f =
Greetings,
> In a program "code.py" I read an external file "foo.txt" supposed
> to be located in the same directory that "code.py"
>
> python/src/code.py
> python/src/foo.txt
>
> In "code.py": f = open('foo.txt', 'r')
>
> But if I run "python code.py" in an other dir than src/ say in
> python/
Hello
In a program "code.py" I read an external file "foo.txt" supposed
to be located in the same directory that "code.py"
python/src/code.py
python/src/foo.txt
In "code.py": f = open('foo.txt', 'r')
But if I run "python code.py" in an other dir than src/
say in python/, it will not work bec