-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [EMAIL PROTECTED] wrote: > I started using Python a couple of days ago - here are a few > questions: > > * Doesn't the __main__() method automatically execute when I run my > python program? > * Only when I do an import of my test.py file within python and then > run test.__main__() I can see where my bugs are. Is this correct? > (right now this is my only way of running my python program and see > where I have problems) > * Once I've done an import and then I wish to make a change to the > file I've imported I have to quit Python, restart and import that > module again in order for the module to be refreshed. Is there no "re- > import" ? > * Finally, could someone tell me why I'm having problems with the > small module below? > - Python pretends I provide chassis_id() with three parameters, even > though I clearly only provide it with two - why? No, Python is executing a module. You should explicit call __main__() at top scope of your module. For ex.
if __name__ == '__main__': __main__() This snippet calls __main__() when the module is executed directly, but not imported as a module. Once a module had been imported, you should invoke reload() function to reload it from filesystem. - -- Thinker Li - [EMAIL PROTECTED] [EMAIL PROTECTED] http://heaven.branda.to/~thinker/GinGin_CGI.py -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF9i/j1LDUVnWfY8gRAgidAKCxHUWf/XTuT8fRQmeL3hnsO4fohQCgt27R jCNoz4hgp2CxD7H5HPwkfgM= =4g/m -----END PGP SIGNATURE-----
-- http://mail.python.org/mailman/listinfo/python-list