There are two ways to open a text file in Python:
f = open(filename)
And
import codecs f = codecs.open(filename, encoding=\
When you're working with text files and want transparent encoding and decoding into Unicode objects.