|
You are here |
ouroboros.rocks | ||
| | | | |
dusty.phillips.codes
|
|
| | | | | I really appreciate Python's pathlib module for managing filesystem stuff. While I don't love the argparse module for command line parsing, I don't think it's worse than other available options. I usually choose it for my CLI scripts, since nothing else is good enough to overcome the inertia of using a third party library. Not many people seem to be aware that the two can very easily be combined such that argparse will return Path objects instead of strings that need to be adapted after you query them: | |
| | | | |
www.paepper.com
|
|
| | | | | Python is a great language to build command-line tools in as it's very expressive and concise. You want to have the ability to parse arguments in your scripts as you don't want to hard-code the relevant variable values to make the tool useful. So how do we go about this in Python? It's easily done using the argparse module. With argparse, you define the different arguments which you expect, their default values and their shortcuts to call them. | |
| | | | |
me.micahrl.com
|
|
| | | | | All rituals restricted. All rites reserved. | |
| | | | |
jan.schnasse.org
|
|
| | | [AI summary] The content discusses website cookies, user consent for analytics and advertising, and privacy policies. | ||