代码如下:
点击查看代码
# -*-coding:utf-8- -*-
# 参数、解包、变量
from sys import argv
# argv 是所谓的 “参数变量” ,是一个非常标准的编程术语。
# 包含了你传递给 python 的参数。
script, first, second, third = argv
print "The script is called:", script
print "Your first variable is:", first
print "Your second variable is:", second
print "Your third variable is:", third
执行结果: