HTTPServer classes
Peter Hansen
peter at engcorp.com
Thu May 1 22:17:45 EDT 2003
Drazen Gemic wrote:
>
> > Note: you should really not do just "httpLoop()" since that will
> > execute during import, even if the module is to be imported from
> > another module. Instead, use the __name__ == '__main__' convention
> > above to ensure that it runs the code only when you are executing
> > the script from the command line.
>
> It is not a module, it is just an example to show how does
> BaseHTTPServer and SimpleHTTPServer work.
Point taken, but all the more reason to show proper usage so
that beginners trying to follow along or use the code when they
find it in an archive will not make actual or stylistic mistakes
as a result of their misunderstanding the distinction.
-Peter
More information about the Python-list
mailing list