摘要: print('我考了%d分'%20) msg=''' ---------info of %s----------- name: %s age: %d #字符串不能放到%d处 job: %s salary: %f you will be retired in %s years #数字可以放到%s处 ---------end----------... 阅读全文
posted @ 2018-08-01 19:48 香蕉都驼背 阅读(1483) 评论(0) 推荐(0) 编辑
摘要: >>> f=open("E:/pythonLearn/140.txt") >>> f.seek(8) #如果文件里是汉字的话,这地方seek括号里面只能是偶数,因为奇数的话就相当把汉字拆分成两半了。 >>> f.readline() 阅读全文
posted @ 2018-08-01 15:47 香蕉都驼背 阅读(193) 评论(0) 推荐(0) 编辑
摘要: >>> f=open("E:/pythonLearn/140.txt") >>> for line in f.readlines(): print(line) #在此连续点两次回车即可 阅读全文
posted @ 2018-08-01 14:50 香蕉都驼背 阅读(3766) 评论(0) 推荐(0) 编辑