标签: python arguments
我们可以做这件事来输入任何参数:
from sys import argv script, argument_1, argument_2 = argv
是否可以在代码中间输入参数,而不是在开头?
我想做同样的事情:
print "La-la-la" print "Any string" # and here i want the program will take a file name as an argument to work with the file then
答案 0 :(得分:0)
查看argparse用于命令行解析的python类