Also doing some Python things.
If you use nargs="?", use Ellipsis as default, like so:
parser.add_argument("--opt", nargs="?", default=Ellipsis)
If --opt not specifed, Ellipsis will be returned.
If --opt is specified but no argument, None will be returned.
#PythonProgramming #PythonTips #Python
If you use nargs="?", use Ellipsis as default, like so:
parser.add_argument("--opt", nargs="?", default=Ellipsis)
If --opt not specifed, Ellipsis will be returned.
If --opt is specified but no argument, None will be returned.
#PythonProgramming #PythonTips #Python
When configuring the logger using a dict,
Grab the inside contents using the walrus.
(Pic 1)
That makes it easier to modify later.
(Pic 2)
[ _opts is of course the "Namespace" object returned by argparse.ArgumentParser().parse_args() ]
When configuring the logger using a dict,
Grab the inside contents using the walrus.
(Pic 1)
That makes it easier to modify later.
(Pic 2)
[ _opts is of course the "Namespace" object returned by argparse.ArgumentParser().parse_args() ]
I'm on the Android Bluesky app.
Who can I complain to?
I'm on the Android Bluesky app.
Who can I complain to?