3 ms·
That's not what the article says. The part about PYTHONPATH comes later and points to a different issue. When you run a script, the location of the script is a
by kgwgk 6y ago
That's not what the article says. The part about PYTHONPATH comes later and points to a different issue.
When you run a script, the location of the script is added to the path.
# cat > /tmp/test.py
import sys
print(sys.path)
^D
# /usr/bin/python /tmp/test.py
['/private/tmp', .....]
And when you don't, the current directory is added to the path.
# cd /tmp
# /usr/bin/python
>>> import test
['', .....]