using notepad to view text files from command lines run in arbitrary places and wrote the script in example - to launch pyedit in more general and automated fashion this script disables the dos pop uplike example - when clicked or run via desktop shortcut on windowsbut also takes care to configure the module search path on machines where haven' used control panel to do soand allows for other launching scenarios where the current working directory may not be the same as the script' directory example - pp \gui\texteditor\pyedit pyw #!/usr/bin/python ""convenience script to launch pyedit from arbitrary places with the import path set as requiredsys path for imports and open(must be relative to the known top-level script' dirnot cwd -cwd is script' dir if run by shortcut or icon clickbut may be anything if run from command-line typed into shell console windowuse argv paththis is pyw to suppress console pop-up on windowsadd this script' dir to your system path to run from command-linesworks on unix tooand handled portably""import sysos mydir os path dirname(sys argv[ ]sys path insert( os sep join([mydir[']* )exec(open(os path join(mydir'texteditor py')read()use my dir for openpath importspp root up to run this from command line in console windowit simply has to be on your system path--the action taken by the first line in the following could be performed just once in control panel on windowsc:\pp \internet\webset path=%path%; :\pp \gui\texteditor :\pp \internet\webpyedit pyw test-cookies py this script works on unixtooand is unnecessary if you set your pythonpath and path system variables (you could then just run texteditor py directly)but don' do so on all the machines use for more funtry registering this script to open txtfiles automatically on your computer when their icons are clicked or their names are typed alone on command line (if you can bear to part with notepadthat ismain implementation file and finallythe module in example - is pyedit' implementation this file may run directly as top-level scriptor it can be imported from other applications its code is organized by the gui' main menu options the main classes used to start and embed pyedit object appear at the end of this file study this listing while you experiment with pyeditto learn about its features and techniques complete gui programs