美文网首页
Python学习笔记03文件操作

Python学习笔记03文件操作

作者: YX_Andrew | 来源:发表于2019-07-13 15:37 被阅读0次

使用Python对文件进行打开,关闭,读取,写入等操作

目标:达到excel和R tidyverse的水平。

data = open("D:/Users/Desktop/Length.txt","r")
while True:
    line = data.readline()
    if len(line)==0:
        break
    print(line)
data.close()

多个Excel表格里内容合并到一个文件中

相关文章

网友评论

      本文标题:Python学习笔记03文件操作

      本文链接:https://www.haomeiwen.com/subject/nhopkctx.html