Python documentation for `python -m`

I’m sure somewhere there is a documentation page which explains what the python -m switch does in relation to import.

eg: It’s going to do something different when pointed to a directory which is a package and which contains __main__.py or __init__.py. (IIRC?)

Can any direct me to the right place?

1 Like

Perhaps here: 1. Command line and environment — Python 3.13.0 documentation

1 Like

hmm, unfortunatly not quite the page I was expecting to see

So what exactly were you hoping for? What is it that you need to know, which that section of the docs don’t cover?

4 Likes