1

All I am trying to do is copy the contents of one file, called 'example.txt' and put them into the output file. Here is what I have but nothing happens when I run it. I am probably missing something obvious but can't figure out what.

def fcopy(fileName1,fileName2):
    fileIn=open(fileName1, 'r')
    fileOut=open(fileName2, 'w')
    for word in fileIn.readlines():
        fileOut.write(word)
    fileIn.close()
    fileOut.close()

This is how I call it:

fcopy('example.txt','output.txt')
open('output.txt')
ᴀʀᴍᴀɴ
  • 4,443
  • 8
  • 37
  • 57
Hawk Student
  • 147
  • 3
  • 9

0 Answers0