import sys
print sys.argv[1]
print 'You arguments are:',sys.argv[1],sys.argv[2]
执行方式:
D:\>cd D:\TOOL\PycharmProjects\python\Dome\webselenium
D:\TOOL\PycharmProjects\python\Dome\webselenium>python pathtest.py liwen nihao
liwen
You arguments are: liwen nihao
D:\TOOL\PycharmProjects\python\Dome\webselenium>
本文转自 知止内明 51CTO博客,原文链接:http://blog.51cto.com/357712148/2045807,如需转载请自行联系原作者