On 01Dec2010 17:27, David Brown <[email protected]> wrote:
| Thanks for the clarification
No worries.
| I like the idea of wrapping all the
| primary code in the script to a main function then calling it if its
| being called by main.
I find that useful too. I've got a few modules-that-implement-commands
that look like this:
def main(argv):
... parse args, do stuff ...
return exit_status
... functions, classes etc ...
if __name__ == '__main__':
sys.exit(main(sys.argv))
It seems fairly effective for keeping the top level logic up the top.
Cheers,
--
Cameron Simpson <[email protected]> DoD#743
http://www.cskk.ezoshosting.com/cs/
It's better, when you're riding with someone you don't know so well, to stick
to the inside line - it's easier to avoid the bits...
- Barry Sheene
--
http://mail.python.org/mailman/listinfo/python-list