📜  python 读取文件到变量 - Python 代码示例

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

代码示例1
with open('data.txt', 'r') as file:
    data = file.read().replace('\n', '')