Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain the -m flag in more detail #26930

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Misc/python.man
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ Further restrictions may be imposed to prevent the user from injecting
malicious code.
.TP
.BI "\-m " module-name
Searches
Adds the current directory to the start of
.I sys.path
for the named module and runs the corresponding
and runs the corresponding
Comment on lines -164 to +166
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fact that the current directory is added to sys.path is not specific to -m option, see https://docs.python.org/3/library/sys.html#sys.path. For instance, given the current directory:

.
└── pkg
    ├── __init__.py
    └── mod.py

any python command will find pkg.mod (e.g. pydoc pkg.mod).

As the current wording explicitly refers to sys.path, I believe this is sufficient.

.I .py
file as a script. This terminates the option list (following options
are passed as arguments to the module).
Expand Down