so farwe've coded general shell tools class libraryas well as an application-specific tool set module that names callback handlers in its option menus to complete the picturewe still need to define the callback handlers run by the guias well as the scripts they ultimately invoke non-gui scripts to test the shell gui' ability to run command-line scriptswe need few commandline scriptsof course at the bottom of the hierarchythe following two scripts make use of system tools and techniques from part ii to implement simple text file archive utility the firstexample - simply concatenates the contents of multiple text files into single filewith predefined separator lines between them example - pp \gui\shellgui\packer py pack text files into single file with separator lines (simple archiveimport sysglob marker ': 'textpak=>hopefully unique separator def pack(ofileifiles)output open(ofile' 'for name in ifilesprint('packing:'nameinput open(name' 'read(if input[- !'\ 'input +'\noutput write(marker name '\ 'output write(inputopen the next input file make sure it has endline write separator line and write the file' contents if __name__ ='__main__'ifiles [for patt in sys argv[ :]ifiles +glob glob(pattpack(sys argv[ ]ifilesnot globbed auto on windows pack files listed on cmdline the second scriptexample - scans archive files created by the firstto unpack into individual files again example - pp \gui\shellgui\unpacker py unpack files created by packer py (simple textfile archiveimport sys from packer import marker mlen len(markerdef unpack(ifileprefix='new-')for line in open(ifile)if line[:mlen!markeroutput write(lineuse common separator key filenames after markers for all input lines write real lines shellguiguis for command-line tools