lazyopt:懒惰编码器的 python 选项解析器

时间:2021-05-29 10:20:17
【文件属性】:
文件名称:lazyopt:懒惰编码器的 python 选项解析器
文件大小:6KB
文件格式:ZIP
更新时间:2021-05-29 10:20:17
Python 懒惰选择 pip install lazyopt 懒惰编码器的选项解析器 大多数python脚本积累了一堆常量。 最终,您可能希望能够使用命令行为其中一些常量设置值。 你可以像这样永远用编写一个参数解析器: # main.py import argparse IT_WAS_A_CONST = 5 BUT_NOW_I_WANNA_CHANGE_IT = "damn" UGH_I_HATE_THIS = True def main(): parser = argparse.ArgumentParser(description="some stupid script") parser.add_argument("--it-was-a-const", default=5, dest='was_const') parser.add_argu
【文件预览】:
lazyopt-master
----test_me.py(477B)
----setup.py(436B)
----README.md(3KB)
----.gitignore(336B)
----lazyopt()
--------tests.py(3KB)
--------__init__.py(3KB)
--------fake_module.py(55B)

网友评论