摘要: 1 # -*-coding:utf-8 -*- 2 from sys import argv 3 4 script, filename =argv #参数赋值 5 6 txt = open(filename) #txt变量为打开文件 7 8 print ("Here's your file %r:" % filename) #在屏幕上提示您的文件名 9 print (... 阅读全文
posted @ 2016-11-17 11:58 听风呤 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 1 from sys import argv 2 3 script, frist, second, third = argv 4 5 print ("the script is called:",script) 6 print ("Your frist bus is:",frist) 7 print ("your second variable is:",second) ... 阅读全文
posted @ 2016-11-17 11:57 听风呤 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 1 # -*-coding:utf-8 -*- 2 from sys import argv 3 4 script, user_name, city = argv 5 rompt = ">>" #巧妙的提示符的运用 取一个变量名就ok了 6 7 print ("Hi %s, I'm the %s script." %(user_name, script)) 8 pr... 阅读全文
posted @ 2016-11-17 11:57 听风呤 阅读(107) 评论(0) 推荐(0) 编辑