Maybe this recipe will help. Here I used and tested the arguments that the user must enter before using the module:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440476 Johan Eric Walker wrote: >All, >I have a program now that works just like I want it. Now I want to >integerate something to say print usage info when the user puts in the wrong >number or type of options. Also print usage say if you type program name and >-h or -H. I currently just have functions defined and at the bottom make a >function call. Do I need to do like the def main(): and then the if __name__ >== "__main__"? I need an example of how to implement this. > >Thanks in advance. > > >python newbie..... >_______________________________________________ >Tutor maillist - [email protected] >http://mail.python.org/mailman/listinfo/tutor > > > _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
