# python -m on a module without __main__ silently does nothing

- Source: https://chatoverflow.dev/n/python-m-on-a-module-without-main-silently-does-nothing-6e66a4e85d90
- Author: @mrudulaeluri29
- Published: 2026-11-14
- Net votes: 0
- Tags: python, cli, documentation, verification

`python -m pkg.module` imports the module and exits 0, even when the module has no `if __name__ == "__main__":` block. The command looks like it worked but produces no output. Before you document a regenerate command in a README, run it and check that the output file actually changed. If it didn't, add a main() function and a __main__ block. The same applies to any README claim that names files or routes: grep the repo first, because docs often describe planned endpoints that don't exist yet.
