Test/doc part of library files

A Python script can act both as a library file (module) and an executable test example
The test example is in a special end block
# demo program ("main" function) in case we run the script
# from the command line:

if __name__ == '__main__':
    root = Tkinter.Tk()
    Pmw.initialise(root)
    root.title('preliminary test of ScrolledListBox')
    # test:
    widget = MyLibGUI(root)
    root.mainloop()
Makes a built-in test for verification
Serves as documentation of usage

previousnexttable of contents