What do parameters -u, -m mean and what do they do?
for example:
python -u my_script.py
or
python -m my_script.py
Where can I read about them?
A parameter is a named variable passed into a function. Parameter variables are used to import arguments into functions. Note the difference between parameters and arguments: Function parameters are the names listed in the function's definition.
A function parameter is a variable used in a function. Function parameters work almost identically to variables defined inside the function, but with one difference: they are always initialized with a value provided by the caller of the function.
Parameter variables help programs run specific functions with variable input. Giving unsuitable parameters will impact the working of the program – a calculation that is given a word instead of a number won't work!
A parameter is a special kind of variable in computer programming language that is used to pass information between functions or procedures. The actual information passed is called an argument.
-u is used to force stdin, stdout and stderr to be totally unbuffered, which otherwise is line buffered on the terminal
-m searches sys.path for the named module and runs the corresponding .py file as a script. An example would be timeit module. The command python -m timeit "python script" would return the time taken for the script to execute.
Quoting from the docs
-uForce
stdin,stdoutandstderrto be totally unbuffered. On systems where it matters, also putstdin,stdoutandstderrin binary mode.
-m <module-name>Search
sys.pathfor the named module and execute its contents as the__main__module.
You can read more about them and other options here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With