What arguments was Python called with?
Summary
The article explains how Python's invocation method (-m vs a script) affects how Werkzeug and similar tools reconstruct the command line for rerunning processes. It covers detecting -m via __main__.__package__, Windows entry point quirks, and the introduction of sys.orig_argv in Python 3.10 for accurate arg capture; the result is guidance for building more reliable Python-based automation and tooling.