--help option: sys.exit or return?
Miguel A Figueroa-Villanneva <[email protected]> Mon, 18 Oct 2004 14:42:55 -0400 (EDT)
| Newsgroups | gmane.comp.python.optik.user |
|---|---|
| Message-ID | <Pine.GSO.4.58.0410181424580.6348@scully> |
Hi, I'm new to this list and also new to python and optik. So, first I would like to say thank you for the optik (optparse) module, because it is a very good improvemnet over getopt and second, please forgive any naive or dumb thoughts I might have due to the lack of python knowledge. Now to my question... When Optik calls sys.exit(), because it encounters --version, --help, or an error your interactive Python interpreter will exit. Is there a better solution to this? For example, a way to 'exit' only if the script was run from outside the python interpreter (i.e. if __name__ == "__main__") and only 'return' from the main function if it was run from the interpreter. Thanks Miguel. ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl