There are two ways to open a text file in Python:
f = open(filename)
And
import codecs f = codecs.open(filename, encoding=\
When you need to open a file that has a certain encoding, you would use the codecs module.
codecs