0

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

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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)?

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.