Return to Home Page
      Blog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     FAQ      Search
 

The Python executable is, in my experience, always lowercase "python", so it should probably be:

python SimpleClass.py
f  e  x


You might want to add something about how this can be used
as an aide for unit testing.

f  e  x


This is because when importing, __name__ is the name of the module.


print __name__ # '__main__'
import random
print random.__name__ # 'random'

When random is imported the __name__ == __main__ fails, but when random is executed as a script __name__ == __main__ is true.

f  e  x



Add your comment below. Use an empty line between each paragraph. Paragraphs will be automatically formatted, and single carriage returns will be respected. Use <code> to begin a code block, and </code> to end a code block. Your email address will not be visible to spam harvesters or used in any way except to contact you with further questions.

Your Email Address:

Search     Home     WebLog     Consulting     Seminars     Calendar     Books     CD-ROMS     Newsletter     About     Contact     Site Design     Server Maintenance     Powered by Zope
©2007 MindView, Inc.