python 命令行参数

import sys

print 'argc:'
print len(sys.argv)

print "argv:"
print sys.argv

结果:
D:>python testargv.py ahishis hshishi shdhihi
argc:
4
argv:
[‘testargv.py’, ‘ahishis’, ‘hshishi’, ‘shdhihi’]

你可能感兴趣的:(python)