[EMAIL PROTECTED] wrote:
> I think I read a suggestion somewhere to wrap the code where a Python
> script starts in a main() function, so one has

<snip>

> What are the advantages of doing this?

Others have stated all the good ones, so I'll state a slightly dumber
one for us part time amateur hackers :)

If you start off writing all your python module inside a main function
then as you chop your code up into other functions (refactoring), the
code inside main is already at the proper indentation level for the new
top level functions. No more indenting it one level further to  suit
the functions indentation.

-- 
Cheers
Anton

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to