摘要: open # with open('log','r') as f: 或者 r=open(filename,r+) with open ('1.txt','r',encoding='utf-8')as r,open ('2','x',encoding='utf-8')as w: 同时操作两行。 rea 阅读全文
posted @ 2016-06-03 10:58 小秒 阅读(2208) 评论(0) 推荐(0) 编辑
摘要: lamdba 表达式。 # f1=lamdba x:x+1 三元运算 # b=True if 1 < 2 else False with open(xxx,'r,coding='utf-8') as f: #打开文件赋值给F ,并且执行完了之后不需要 f.close(). def f1(a,*a,* 阅读全文
posted @ 2016-06-03 10:27 小秒 阅读(240) 评论(0) 推荐(0) 编辑