[Tutor] Main program confusion
les.hazlett at navteq.com
Mon Feb 19 17:15:08 CET 2007
I am trying to understand some sample code that includes the following
for a main program:
def runTest(frame, nb, log):
win = TestPanel(nb, log)
if __name__ == '__main__':
run.main(['', os.path.basename(sys.argv)] + sys.argv[1:])
I understand that win is an object of the class TestPanel. The class
code for TestPanel preceded
the code which I copied above. The object win clearly is instantiated.
I understand how the
if__name__=='__main__' only runs when this program file is executed.
But, I can't find any reference to a module run and I don't see how the
"run.main([" line casues
the "runTest(" function to run.
What am I missing?
Thanks for any help.
The information contained in this communication may be CONFIDENTIAL and is intended only for the use of the recipient(s) named above. If you are not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication, or any of its contents, is strictly prohibited. If you have received this communication in error, please notify the sender and delete/destroy the original message and any copy of it from your computer or paper files.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor