Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #1/usr/bin/env python
- # this is from The Python
- # Standard Library by example
- # ISBN13: 9780321767349
- import codecs
- import sys
- encoding = sys.argv[1]
- filename = encoding + '.txt'
- print 'Reading from', filename
- with codecs.open(filename, mode='rt', encoding=encoding) as f:
- print repr(f.read())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement