PEP 263 specifies how that can change on a per-file basis. Either the first or second line can contain the encoding line [encoding first line] encoding second line]. If the file has the BOM marker it ...