摘要: 1 # -*- coding: utf-8 -*- 2 from sys import argv 3 4 script, input_file = argv 5 6 def print_all(f): 7 print (f.read()) 8 9 def rewind(f): 10 f.seek(0) 11 #seek那个函数不返回值,你pri... 阅读全文
posted @ 2016-11-20 12:05 听风呤 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 1 # -*- coding:utf-8 -*- 2 def cheese_and_crackers(cheese_count, boxes_of_crackers): 3 print ("You Have %d cheeses!" % cheese_count) 4 print ("You have %s boxes of crackers!" % boxes_of... 阅读全文
posted @ 2016-11-20 00:44 听风呤 阅读(413) 评论(0) 推荐(0) 编辑
摘要: 1 # this one is like your scripts with argv 2 def print_two(*args): #函数命名规则和变量名一样,只能以字母、数字和下划线组成,数字不可以作为开头 3 arg1, arg2 = args 4 print ("arg1: %r, arg2: %r" % (arg1,arg2)) # 不要混淆TAB键... 阅读全文
posted @ 2016-11-20 00:41 听风呤 阅读(183) 评论(0) 推荐(0) 编辑