python 命令行参数打印
# -*- coding:utf-8 -*-
import sys
print 'the num of argv ', len(sys.argv)
print 'argv', str(sys.argv)
输出结果
argv [‘D:/test_argv.py’]
# -*- coding:utf-8 -*-
import sys
print 'the num of argv ', len(sys.argv)
print 'argv', str(sys.argv)
输出结果
argv [‘D:/test_argv.py’]