Advertisement
Guest User

Untitled

a guest
May 17th, 2012
625
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. # P2PU - Python Programming 101 - Chapter 9 - Working with Files
  4. # Python for Informatics - Chapter 7 - Files
  5. # Exercise 7.1
  6.  
  7. print '\n# Exercise 7.1\n'
  8. fname =  raw_input('Enter a file name: ')
  9. try:
  10.     ffile = open(fname)
  11. except:
  12.     print 'File', fname, 'cannot be opened!'
  13.     exit()
  14. for line in ffile:
  15.     line = line.rstrip()
  16.     print line.upper()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement