1,参数和脚本:
程序的运行,在终端中我们运行自己编写的Python程序时会输入以下命令:
simengred$ python ex13.py
那么命令中ex13.py这个部分就是所谓的参数(argument),ex13.py这个文件就是脚本。
这个习题中,就是要写一个可以介绍参数的脚本。
首先,还是代码部分:
from sys import argv
script,first,second,third = argv
print"The script is called:",script
print"Your first variable is:",first
print"Your second variable is:"