Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-16 Thread Mats Wichmann
On 10/15/20 5:09 PM, Samuel Marks wrote: > Yes it’s my module, and I’ve been using argparse > https://github.com/SamuelMarks/ml-params > > No library I’ve found provides a solution to CLI argument parsing for my > use-case. > > So I’ll write one. But what should it look like, syntactically and >

Re: How do I get datetime to stop showing seconds?

2020-10-16 Thread Cameron Simpson
On 16Oct2020 22:07, Albert-Jan Roskam wrote: > I was using datetime.now().isoformat('T', 'seconds') > Not 100% sure, but the strings seemed to be 2hrs off. Could it be that > this Linux server was using the wrong time zone? Maybe. This is why timezones are such a nightmare, and programmes

Re: How do I get datetime to stop showing seconds?

2020-10-16 Thread sjeik_appie
On 16 Oct 2020 12:50, Eryk Sun wrote: On 10/16/20, Steve wrote: > -Original Message- > From: Python-list On > Behalf Of Frank Millman > Sent: Friday, October 16, 2020 4:34 AM > To: python-list@python.org > Subject: Re: How do I get datetime to

Re: How do I get datetime to stop showing seconds?

2020-10-16 Thread Cousin Stanley
Steve wrote: > d2 = datetime.datetime.now() #Time Right now > > Show this: 2020-10-16 02:53 > and not this: 2020-10-16 02:53:48.585865 > > > == > Footnote: > If you double major in psychology and reverse psychology, to they cancel > e

Re: How do I get datetime to stop showing seconds?

2020-10-16 Thread Eryk Sun
On 10/16/20, Steve wrote: > -Original Message- > From: Python-list On > Behalf Of Frank Millman > Sent: Friday, October 16, 2020 4:34 AM > To: python-list@python.org > Subject: Re: How do I get datetime to stop showing seconds? > > On 2020-10-16 9:42 AM, Steve wrote: >> d2 = datetime.dat

RE: How do I get datetime to stop showing seconds?

2020-10-16 Thread Steve
Right on target, Many Thanks FootNote: If money does not grow on trees, then why do banks have branches? -Original Message- From: Python-list On Behalf Of Frank Millman Sent: Friday, October 16, 2020 4:34 AM To: python-list@python.org Subject: Re: How do I get datetime to stop show

Re: How do I get datetime to stop showing seconds?

2020-10-16 Thread Marco Sulla
Another way is: '{:%Y-%m-%d %H:%M}'.format(d2) -- https://mail.python.org/mailman/listinfo/python-list

Re: How do I get datetime to stop showing seconds?

2020-10-16 Thread Frank Millman
On 2020-10-16 9:42 AM, Steve wrote: d2 = datetime.datetime.now() #Time Right now Show this: 2020-10-16 02:53 and not this: 2020-10-16 02:53:48.585865 >>> >>> str(d2) '2020-10-16 10:29:38.423371' >>> >>> d2.strftime('%Y-%m-%d %H:%M') '2020-10-16 10:29' >>> Frank Millman -- https://mail.pyt

Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-16 Thread Samuel Marks
Yeah, but the risk with config files is you need a website—and/or full JSON schema output—to figure out what’s needed. (Although I should mention that with my doctrans project you can generate a config class—and class method—from/to your argparse parser; enabling the config file scenario rather cl

How do I get datetime to stop showing seconds?

2020-10-16 Thread Steve
d2 = datetime.datetime.now() #Time Right now Show this: 2020-10-16 02:53 and not this: 2020-10-16 02:53:48.585865 == Footnote: If you double major in psychology and reverse psychology, to they cancel each other out? -- -- https://m