import string
iFile = open("input.txt")
oFile = open("output.txt", "w")
for line in iFile:
oFile.write(string.upper(line))
iFile.close()
oFile.close()
Or the more "proper" Python way:
import string
with open("input.txt") as iFile:
with open("output.txt", "w") as oFile:
for line in iFile:
oFile.write( string.upper(line) )
Actually, Python strings have a built-in upper() method, so a solution
may be as short as:
with open("input.txt") as iFile:
with open("output.txt", "w") as oFile:
oFile.write( iFile.read().upper() )