[Python-ideas] Idea: msgfmt.py and pygettext..py should be -m executable modules

Nick Timkovich prometheus235 at gmail.com
Mon Jul 30 11:22:39 EDT 2018


On Mon, Jul 30, 2018 at 8:43 AM, Petr Viktorin <encukou at gmail.com> wrote:

> On Mon, Jul 23, 2018 at 2:16 PM, Miro Hrončok <mhroncok at redhat.com> wrote:
>
> > It might be:
> >
> >   $ python3 -m gettext
>
> +1
>
> > And:
> >
> >   $ python3 -m gettext.msgfmt
>
> +1
> Note that this means gettext will need to become a package.
>
> > And (provided as a shortcut):
> >
> >   $ python3 -m msgfmt
>
> -1. This would mean adding a new top-level module to the standard
> library. Let's not pollute that namespace just to provide a shortcut.


Speaking of shortcuts, is there a reason that it should be "python -m
json.tool" versus "python -m json" (keep the old probably forever, but have
the shorter as a synonym)?

And as a broader question, is there opposition to generating patches to
make packages executable that may be useful as a CLI? Would be nice if the
UUID or random modules could directly spit something out, e.g. "python -m
uuid -4". Counterargument that you could "python -c "import
uuid;print(uuid.uuid4())".

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180730/afbd9d1b/attachment-0001.html>


More information about the Python-ideas mailing list