outputhtmlemail contentor csv or xml filesyou'll probably want to use str and text-mode files notice that the mode string argument to built-in function open (its second argumentbecomes fairly crucial in python --its content not only specifies file processing modebut also implies python object type by adding to the mode stringyou specify binary mode and will receiveor must providea bytes object to represent the file' content when reading or writing without the byour file is processed in text modeand you'll use str objects to represent its content in your script for examplethe modes rbwband rbimply bytesrw+and rt (the defaultimply str text-mode files also handle the byte order marker (bomsequence that may appear at the start of files under some encoding schemes in the utf- and utf- encodingsfor examplethe bom specifies bigor little-endian format (essentiallywhich end of bit-string is most significant)--see the leading bytes in the results of the utf- and utf- encoding calls we ran earlier for examples utf- text file might also include bom to declare that it is utf- in general when reading and writing data using these encoding schemespython skips or writes the bom according to rules we'll study later in this in python xthe same behavior is supportedbut normal files created by open are used to access bytes-based dataand unicode files opened with the codecs open call are used to process unicode text data the latter of these also encode and decode on transferas we'll see later in this firstlet' explore python' unicode string model live coding basic strings let' step through few examples that demonstrate how the string types are used one note up frontthe code in this section was run with and applies to only stillbasic string operations are generally portable across python versions simple ascii strings represented with the str type work the same in and (and exactly as we saw in of this bookmoreoveralthough there is no bytes type in python (it has just the general str)it can usually run code that thinks there is--in and the call bytes(xis present as synonym for str( )and the new literal form bis taken to be the same as the normal string literal you may still run into version skew in some isolated casesthoughthe bytes callfor instancedoes not require or allow the second argument (encoding namethat is required by ' bytes unicode and byte strings