[Tutor] Main program confusion

Hazlett, Les les.hazlett at navteq.com
Mon Feb 19 17:15:08 CET 2007


Hello,

 

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)

    return win

 

if __name__ == '__main__':

    import sys,os

    import run

    run.main(['', os.path.basename(sys.argv[0])] + 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.

 

Les Hazlett



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...
URL: http://mail.python.org/pipermail/tutor/attachments/20070219/f7e414b7/attachment-0001.htm 


More information about the Tutor mailing list