Huh?!?!? What is it that I'm seeing here?

John Hunter jdhunter at
Mon Sep 15 01:12:25 CEST 2003

>>>>> "Don" == Don Bruder <dakidd at> writes:

    Don> if __name__ == '__main__': run(argv[1:])

You can safely ignore these in your conversion project.  

  if __name__ == '__main__'

This means if the text file "" holding the module code is
run as the main file, as in 

  > python
  > ./ 
if the file has an executable bit set


This means "call the function run, passing command line arguments as

Basically, the code at the bottom allows any python module to save the
same purpose as the C/C++ function 'main'.  Once you have converted
the python module, and implemented the function "run" in your C/C++
code, you would do something like

int main( int argc , char** argv ) {

John Hunter

More information about the Python-list mailing list