On 9 March 2015 at 23:11, Nick Coghlan <ncogh...@gmail.com> wrote: > While I like the idea of offering something more "built in" in this space, > my initial inclination is to prefer extending "-m" to accept the > "module.name:function.name" format to let you invoke entry points by the > name of the target function (Possible API name: runpy.run_cli_function), and > then add a "runpy.call" that can be used to call an arbitrary function with > positional and keyword string arguments based on sys.argv and (optionally?) > print the repr of the result. > > It wouldn't be a universal panacea (and would need a PEP to work out the > exact UX details), but would likely make quite a few libraries more command > line accessible without needing to modify them.
Personally I doubt it would make much difference. If the docs say "pygmentize" I'm unlikely to dig around to find that the incantation "python -m pygments.somemodule:main" does the same thing using 3 times as many characters. I'd just add Python to my PATH and say stuff it. Paul _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com