Normally when you execute a python file you do python *.py
but if the whole Module which contain many .py files inside
for example MyModule contain many .py file and if I do
python -m MyModule $* what would happen as oppose python individual python file?
2 Answers 2
I think you may be confusing package with module. A python module is always a single .py file. A package is essentially a folder which contains a special module always named __init__.py, and one or more python modules. Attempting to execute the package will simply run the __init__.py module.
Comments
It runs the code in the
MyModule/__init__.py
file. Print sys.argv in that file to see what the shell is giving you in terms of command line arguments. $* is meaningless in this context unless you're in a shell script (I believe)?