So I need to make a code that opens a txt file, and then takes the content of that file and puts it into another txt file, problem is, I don't know how the command to extract the information from the file, I did some research and found this is the closest thing but It just isn't what I need: How do I get python to read only every other line from a file that contains a poem
this is my code so far:
myFile = open("Input.txt","wt")
myFile.close()
myFile = open("Output.txt","wt")
myFile.close()
Answer
A sample code to copy text from one file to another. Maybe it will help you:
inputFile = open("Input.txt","r")
text = inputFile.read()
inputFile.close()
outputFile = open("Output.txt","w")
outputFile.write(text)
outputFile.close()
No comments:
Post a Comment