[Python-ideas] Provide __main__ for datetime and time

Alexander Belopolsky alexander.belopolsky at gmail.com
Fri Apr 1 20:49:25 EDT 2016


On Fri, Apr 1, 2016 at 2:02 PM, Michel Desmoulin <desmoulinmichel at gmail.com>
wrote:

> As with my previous email about __main__ for random, uuid and os, I wish
> to suggest a similar __main__ for datetime. The target audience may not
> be the same, so I'm making it a difference proposal.
>
> E.G:
>
> python -m datetime now => print(str(datetime.datetime.now())
> python -m datetime utcnow => print(str(datetime.datetime.utcnow())
>

+1

In fact, I would not mind seeing a fairly complete GNU date utility [1]
reimplementation as datetime.__main__.

[1]
http://www.gnu.org/software/coreutils/manual/html_node/date-invocation.html#date-invocation
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160401/4fb867c1/attachment.html>


More information about the Python-ideas mailing list