[Python] What is the purpose of the -m switch?

Discussão em 'Python' iniciado por Stack, Agosto 7, 2025.

  1. Stack

    Stack Membro Participativo

    Could you explain to me what the difference is between calling

    python -m mymod1 mymod2.py args


    and

    python mymod1.py mymod2.py args


    It seems in both cases mymod1.py is called and sys.argv is

    ['mymod1.py', 'mymod2.py', 'args']


    So what is the -m switch for?

    Continue reading...

Compartilhe esta Página