提供类似boost::program_option功能的Python模块

3 投票
1 回答
502 浏览
提问于 2025-04-16 10:19

有没有类似于boost::program_options的模块可以在Python中使用?

1 个回答

6

对于命令行选项,你可以使用 argparse 这个库,或者使用已经不推荐使用的 optparse,还有更老的 getopt。如果你需要处理配置文件,可以使用 ConfigParser

撰写回答