【发布时间】:2017-04-17 08:18:38
【问题描述】:
所以我需要编写一个打开一个txt文件的代码,然后将该文件的内容放入另一个txt文件中,问题是,我不知道如何从文件中提取信息的命令,我做了一些研究,发现这是最接近的东西,但这不是我需要的:How do I get python to read only every other line from a file that contains a poem
这是我目前的代码:
myFile = open("Input.txt","wt")
myFile.close()
myFile = open("Output.txt","wt")
myFile.close()
【问题讨论】:
-
您可能错过了教程中的“Reading and Writing Files”。
标签: python