__name__ in embedded python giving error

Kim Petersen kp at kyborg.dk
Tue Sep 24 14:11:29 CEST 2002


Hi,

First: This is probably my fault in forgetting to consider some call 
when embedding python ....

When doing:

if __name__ == "__main__":

in modules i get the following error:

Traceback (innermost last):
   File "/var/www/cgi-bin/CGIX.py", line 641, in ?
     if __name__=="__main__":
TypeError: function requires at least 2 arguments; 1 given

Could some enlightened head give me a pointer as to what i've done wrong 
  (or am missing)?

Please query for more information - i haven't included much (because the 
program is a bit large)...

Error on Linux 2.4 - using python 1.5 (haven't tried yet with 2.2 - but 
i think the error is there as well)...




More information about the Python-list mailing list