you need bit more to handle multiple-line statements and expression result displaysread and run python statement stringslike pyedit' run code menu option namespace {while truetryline input('single-line statements only except eoferrorbreak elseexec(linenamespaceor eval(and print result depending on the user' preferencepyedit either does something similar to this to run code fetched from the text widget or uses the launchmodes module we wrote at the end of to run the code' file as an independent program there are variety of options in both schemes that you can customize as you like (this is pythonafter allsee the onruncode method for details or simply edit and run some python code in pyedit on your own to experiment when edited code is run in nonfile modeyou can view its printed output in pyedit' console window as we footnoted about eval and exec in also make sure you trust the source of code you run this wayit has all permissions that the python process does multiple windows pyedit not only pops up multiple special-purpose windowsit also allows multiple edit windows to be open concurrentlyin either the same process or as independent programs for illustrationfigure - shows three independently started instances of pyeditresized and running with variety of color schemes and fonts since these are separate programsclosing any of these does not close the others this figure also captures pyedit torn-off menus at the bottom and the pyedit help pop up on the right the edit windowsbackgrounds are shades of greenredand blueuse the tools menu' pick options to set colors as you like since these three pyedit sessions are editing python source-coded textyou can run their contents with the run code option in the tools pull-down menu code run from files is spawned independentlythe standard streams of code run not from file ( fetched from the text widget itselfare mapped to the pyedit session' console window this isn' an ide by any meansit' just something added because found it to be useful it' nice to run code you're editing without fishing through directories to run multiple edit windows in the same processuse the tools menu' clone option to open new empty window without erasing the content of another figure - shows the single-process scene with window and its clonealong with pop-ups related to the search menu' grep optiondescribed in the next section-- tool that walks directory trees in parallel threadscollecting files of matching names that contain search stringand opening them on request in figure - grep has produced an input dialog complete gui programs