摘要: 1 # Author;Tsukasa 2 ''' 3 f = open('yesterday','w') #文件句柄...注意open分为‘r’读模式,‘w’写模式(d会先创建文件或者覆盖文件),‘a’为追加模式(添加), 4 #data = f.read()#读取文件read() 5 f.write('hello') #注意如果要写文件的话 上面open模式要改 6 7 ... 阅读全文
posted @ 2017-03-14 22:22 Tsukasa鱼 阅读(1539) 评论(0) 推荐(0)
摘要: 1 C:\Users\Administrator\AppData\Local\Programs\Python\Python35\python.exe E:/python/day2/op.py 2 Somehow, it seems the love I knew was always the mos 阅读全文
posted @ 2017-03-14 19:47 Tsukasa鱼 阅读(380) 评论(0) 推荐(0)
摘要: 对文件操作流程 1 f = open('lyrics') #打开文件 2 first_line = f.readline() 3 print('first line:',first_line) #读一行 4 print('我是分隔线'.center(50,'-')) 5 data = f.read( 阅读全文
posted @ 2017-03-14 01:27 Tsukasa鱼 阅读(216) 评论(0) 推荐(0)