📜  用于显示文件内容并在 python 代码示例中打印的代码

📅  最后修改于: 2022-03-11 14:47:19.802000             🧑  作者: Mango

代码示例1
import os

with open("filename", "r+") as file:
    content = file.readline()
    while(content!=""):
          print(content)
        content = file.readline()
    file.close