utf- may sometimes be required to print non-ascii textand to display such text in shell windows (possibly in conjunction with code page changes on some windows machinesa script that prints non-ascii filenamesfor examplemay fail unless this setting is made for more background on this subjectsee also "currency symbolsunicode in actionin therewe work through an example that demonstrates the essentials of portable unicode codingas well as the roles and requirements of pythonioencoding settingswhich we won' rehash here for more on these topics in generalsee python manuals or books such as programming python th edition (or laterif later may bethe latter of these digs deeper into streams and files from an applications-level perspective other string tool changes in many of the other popular string-processing tools in python' standard library have also been revamped for the new str/bytes type dichotomy we won' cover any of these application-focused tools in much detail in this core language bookbut to wrap up this here' quick look at four of the major tools impactedthe re patternmatching modulethe struct binary data modulethe pickle object serialization moduleand the xml package for parsing xml text as noted aheadother python toolssuch as its json modulediffer in ways similar to those presented here the re pattern-matching module python' re pattern-matching module supports text processing that is more general than that afforded by simple string method calls such as findsplitand replace with restrings that designate searching and splitting targets can be described by general patternsinstead of absolute text this module has been generalized to work on objects of any string type in --strbytesand bytearray--and returns result substrings of the same type as the subject string in it supports both unicode and str here it is at work in xextracting substrings from line of text--borrowedof coursefrom monty python' the meaning of life within pattern strings*means any character (the )zero or more times (the *)saved away as matched substring (the ()parts of the string matched by the parts of pattern enclosed in parentheses are available after successful matchvia the group or groups methodc:\codec:\python \python import re 'bugger all down here on earth! 'bugger all down here on earth!line of text usually from file re match('*down *on *)'sgroups(('bugger all''here''earth!'match line to pattern matched substrings unicode and byte strings