'\xa \ \ \ \ %\ \ \ \ %if all your text is ascii you generally can ignore encoding altogetherdata in files maps directly to characters in stringsbecause ascii is subset of most platformsdefault encodings if you must process files created with other encodingsand possibly on different platforms (obtained from the webfor instance)binary mode may be required if encoding type is unknown keep in mindhoweverthat text in still-encoded binary form might not work as you expectbecause it is encoded per given encoding schemeit might not accurately compare or combine with text encoded in other schemes againsee other resources for more on the unicode story we'll revisit the unicode story at various points in this bookespecially in to see how it relates to the tkinter text widgetand in part ivcovering internet programmingto learn what it means for data shipped over networks by protocols such as ftpemailand the web at large text files have another featurethoughwhich is similarly nonfeature for binary dataline-end translationsthe topic of the next section end-of-line translations for text files for historical reasonsthe end of line of text in file is represented by different characters on different platforms it' single \ character on unix-like platformsbut the two-character sequence \ \ on windows that' why files moved between linux and windows may look odd in your text editor after transfer--they may still be stored using the original platform' end-of-line convention for examplemost windows editors handle text in unix formatbut notepad has been notable exception--text files copied from unix or linux may look like one long line when viewed in notepadwith strange characters inside (\nsimilarlytransferring file from windows to unix in binary mode retains the \ characters (which often appear as ^ in text editorspython scripts that process text files don' normally have to carebecause the files object automatically maps the dos \ \ sequence to single \ it works like this by default-when scripts are run on windowsfor files opened in text mode\ \ is translated to \ when input for files opened in text mode\ is translated to \ \ when output for files opened in binary modeno translation occurs on input or output on unix-like platformsno translations occurbecause \ is used in files you should keep in mind two important consequences of these rules firstthe end-of-line character for text-mode files is almost always represented as single \ within python scriptsregardless of how it is stored in external files on the underlying platform by mapping to and from \ on input and outputpython hides the platform-specific difference the second consequence of the mapping is subtlerwhen processing binary filesbinary open modes ( grbwbeffectively turn off line-end translations if they did notthe file tools