📜  python 在读取时写入文件 - Python 代码示例

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

代码示例2
# writin content of one file to the other
with open("source.txt", "r") as inFile, open("target.txt", "w") as outFile:
    for line in inFile:
        print(line.strip("\n"), file=outFile)