1. Computing

Creating a Whitelist: Calling main()

By August 30, 2008

Today the final part in our series on creating a whitelist from your sent folder was posted. If you missed any of the steps, you can find the index of steps at the bottom of each page of the guide.

This step involves the calling of the main() function of the program when the program is called directly. If the program is not accessed directly, we do not necessarily want main() to be executed. Therefore, we check whether the program's call, its __name__, is equal to __main__. There are many ways to write main() functions; you can read Guido's take on them (as of 2003) on his blog.
Comments
Comments are closed for this post.
Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2014 About.com. All rights reserved.