fname = raw_input("Enter file name: ")
fh = open(fname)
for line in fh:
print line.strip().upper()
Explanation
- Prompt to enter a file name
- set a file open handle as fh
- loop through entire handle
- print each line out with new line and all in upper case.