In Python 3.X there are three string types:
Files work in two modes:
Mode | Description |
---|---|
text | represents content as str and implements Unicode encodings, |
binary | deals in raw bytes and does no data translation. |
In Python 2.X:
Normal files' content is simply bytes represented as str.
A codecs module opens Unicode text files, handles encodings, and represents content as unicode objects.