1 |
import sys |
2 |
print "脚本名:" , sys.argv[ 0 ] |
3 |
for i in range ( 1 , len (sys.argv)): |
4 |
print "参数" , i, sys.argv[i] |
>>>python test.py hello world
脚本名:test.py
参数 1 hello
参数 2 world
e.g.
def main(argv=None):
path, probility = max_path(int(sys.argv[1]))
a, b, end = readcsvdict()
if end in path:
path.remove(end)
print path, probility
原文:http://www.cnblogs.com/lucky-ana/p/6360636.html