from sys import argv #從python功能庫中導入功能 “features"真正的名稱是:modules / libraries
print "Your first variable is:", first #屏幕上顯示第一個變量的名字
print "Your second variable is:", second #屏幕上顯示第二個變量的名字
print "Your third variable is:", third #屏幕上顯示第三個變量的名字
The script is called: ex13.py
Your first variable is: first
Your second variable is: 2nd
Your third variable is: 3rd
from sys import argv
script, first = argv
print "How %s are your?" % first
write = raw_input()
print "Your %s is %s." % (first, write)
root@he-desktop:~/mystuff# python ex13.py old
How old are your?
25
Your old is 25.
總結:
script(腳本)是在命令行裏給變量
raw_input是屏幕提示鍵盤鍵入變量
from sys import argv
script, first = argv
print "How %s are you?" %first
age=raw_input("How %s are you?")
print "I'm %s years %s." %(age, first)