On 12Oct2019 14:04, Greg Ewing <greg.ew...@canterbury.ac.nz> wrote:
Cameron Simpson wrote:
Python's default sys.path includes the current working directory.

Only in an interactive session, where it usually makes sense.

Personally, I would not consider this:

 % python3 -c 'import sys;print(repr(sys.path))'
['', '/Users/cameron/lib/python', '/Users/cameron/rc/python', '/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python37.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7', '/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload', '/Users/cameron/var/venv/3.7.1/lib/python3.7/site-packages']

to be interactive. It is at a terminal, but that seems a very low bar.

I see that plain "python filename.py" does not include the current directory though.

Cheers,
Cameron Simpson <c...@cskk.id.au>
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to