What do the -u, -m options do?

What are the parameters -u, -mand what do they do?

eg:

python -u my_script.py 

or

python -m my_script.py

Where can I read about them?

-1
source share
1 answer

-uused to force formatting stdin, stdoutand stderrwhich otherwise is string buffered on the terminal

-mperforms a search sys.pathfor the named module and runs the corresponding .py file as a script. An example is a module timeit. The command python -m timeit "python script"will return the time taken to execute the script.

Quote from the docs

-u

Force stdin, stdout stderr . , , stdin, stdout stderr .

-m <module-name>

sys.path __main__.

+6

All Articles