A question related to the PYTHONPATH

dieter dieter at handshake.de
Tue Mar 27 01:42:28 EDT 2018


oyono <adrienoyono at gmail.com> writes:
> ...
> I was thinking, maybe it could have been done this way to enforce not running module files that are supposed to be bundled into packages as "independant" python scripts...Therefore, running "python script.py" should be reserved to effectively independant python scripts that do not import from a user-created package or module.

When you run "python <script>", the path to "<script>" is
added to "sys.path" (the target for "PYTHONPATH").
Motivation: "<script>" may depend on modules in its container.




More information about the Python-list mailing list