Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # P2PU - Python Programming 101 - Chapter 9 - Working with Files
- # Python for Informatics - Chapter 7 - Files
- # Exercise 7.1
- print '\n# Exercise 7.1\n'
- fname = raw_input('Enter a file name: ')
- try:
- ffile = open(fname)
- except:
- print 'File', fname, 'cannot be opened!'
- exit()
- for line in ffile:
- line = line.rstrip()
- print line.upper()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement