由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - 如果python command line positional arguments 里有些是运算,那这种argument 该怎么处理?
相关主题
python gc questionhow to proof (转载)
About command line in C++How to concatenate two .tar.gz files
[合集] 问个MatLab小问题 (转载)大牛 in Perl and SED?
c++设计一问:如何动态地调用不同的算法的dll ?[合集] 如何能让这个程序快一点呢?太慢了
[合集] 我也花了一小时读了一下pythongvim diff question
python: how to use an array as an argumenthow to assign new value to loop variables?
请教python里面function的arguments的格式问题A problem on string parsing (using either grep or perl)
python 问题,急,在线等。请问call by name是不是C编译器都没实现
相关话题的讨论汇总
话题: arguments话题: 运算话题: python话题: positional话题: argument
进入Programming版参与讨论
1 (共1页)
a*****e
发帖数: 216
1
这两天在研究python command arguments, 有一个python command line script 要执
行多种运算,如 script1.py file1 union file2, script1.py size file3
这里union 是运算,合并两个文件,size 是求file3 的行数.
一个script1.py 可以完成这些运算,而且运算有许多,10来个.
这里的arguments 是positional arguments 吧?但是union, size 又是不一般的
arguments. 那么这种arguments 可以当optional argument 来处理吗?像这个文章里
的"--sum".
http://python.usyiyi.cn/python_278/library/argparse.html
这里还有一个文章:
https://docs.python.org.tw/3/howto/argparse.html
如果union , size 不能当optional argument 来处理,又要怎样处理呢?
这里有关于python optional arguments 的文章:
https://docs.python.org/2/library/getopt.html
多谢.
1 (共1页)
进入Programming版参与讨论
相关主题
请问call by name是不是C编译器都没实现[合集] 我也花了一小时读了一下python
How to fix this? /bin/ls: Argument list too longpython: how to use an array as an argument
matlab: how to set defaul value for function arguments请教python里面function的arguments的格式问题
static如何作为函数?python 问题,急,在线等。
python gc questionhow to proof (转载)
About command line in C++How to concatenate two .tar.gz files
[合集] 问个MatLab小问题 (转载)大牛 in Perl and SED?
c++设计一问:如何动态地调用不同的算法的dll ?[合集] 如何能让这个程序快一点呢?太慢了
相关话题的讨论汇总
话题: arguments话题: 运算话题: python话题: positional话题: argument