or opening files in binary modesince grep might not be able to interpret some of the files it visits as text at allit takes the former approach reallyopening even text files in binary mode to read raw byte strings in mimics the behavior of text files in xand underscores why forcing programs to deal with unicode is sometimes good thing--binary mode avoids decoding exceptionsbut probably shouldn'tbecause the still-encoded text might not work as expected in this caseit might yield invalid comparison results for more details on grep' unicode supportand set of open issues and options surrounding itsee the source code listed ahead for suggested enhancementsee also the re pattern matching module in -- tool we could use to search for patterns instead of specific strings update for initial positioning also in this versiontext editor updates itself before inserting text into its text widget at construction time when it is passed an initial file name in its loadfirst argument sometime after the third edition and python either tk or tkinter changed such that inserting text before an update call caused the scroll position to be off by one--the text editor started with line at its top in this mode instead of line this also occurs in the third edition' version of this example under python but not adding an update correctly positions at line initially obscure but true in the real world of library dependencies!clients of the classes here should also update before manually inserting text into newly created (or packedtext editor object for accurate positioningpyview later in this as well as pymailgui in now do pyedit doesn' update itself on every constructionbecause it may be created early byor even hidden inan enclosing gui (for instancethis would show half-complete window in pyviewmoreoverpyedit could automatically update itself at the start of setalltext instead of requiring this step of clientsbut forced update is required only once initially after being packed (not before each text insertion)and this too might be an undesirable side effect in some conceivable use cases as rule of thumbadding unrelated operations to methods this way tends to limit their scope improvements for running code the run code option in the tools menu was fixed in three ways that make it more useful for running code being edited from its external filerather than in-processinterestinglypython' own idle text editor in python suffers from two of the same bugs described here and resolved in this edition' pyedit--in idle positions at line instead of line on file opensand its external files search (similar to pyedit' grepcrashes on unicode decoding errors when scanning the python standard librarycausing idle to exit altogether insert snarky comment about the shoemaker' children having no shoes here pyedita text editor program/object