扫码关注官方订阅号
输入10但是获得的是一个数组[10],这个是什么问题呢?
学习是最好的投资!
因为用了 nargs。
nargs
Note that nargs=1 produces a list of one item. This is different from the default, in which the item is produced by itself.
nargs=1
argparse 文档关于 nargs 的说明
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
因为用了
nargs。argparse 文档关于 nargs 的说明