from sys import argv script, first, second, third = argv print "The script is called:", script print "Your first variavle is:", first print "Your second variavle is:", second print "Your third variavle is:", third
可以使用sys模塊的argv類讀取參數
用戶執行命令時就輸入,本例中有三個參數。