python - 为什么argparse输入变成数组
PHPz
PHPz 2017-04-17 17:09:30
0
1
758

输入10但是获得的是一个数组[10],这个是什么问题呢?

PHPz
PHPz

学习是最好的投资!

Antworte allen(1)
黄舟

因为用了 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.

argparse 文档关于 nargs 的说明

Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage