On 4/26/22, Victor Stinner <vstin...@python.org> wrote: > > There are 4 main ways to run Python: > > (1) python -m module [...] > (2) python script.py [...] > (3) python -c code [...] > (4) python [...] > > (1) and (2) insert the directory of the module/script at sys.path[0].
Running a module with -m inserts the current working directory (the path, not an empty string) at sys.path[0], followed by the module directory at sys.path[1]. Only one entry is added if they're the same directory. _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/63CBL373SWD7P24TMQOHCJYDP76J4NTL/ Code of Conduct: http://python.org/psf/codeofconduct/