Home  >  Magazine  >  #73 May 2000  >  Python Programming for Beginners  >  Listing 1. Help Option Handler
Wednesday, March 29, 2000 | Last Updated 03:42:15 PM


  

Listing 1. Help Option Handler

#! /usr/local/bin/python
import sys
if '-h' in sys.argv or '--help' in 
sys.argv or '--help' in sys.argv: print '''
help.py--does nothing useful (yet)
options: -h, -help, or --help-display this help
Copyright (c) Jacek Artymiak, 2000 '''
    sys.exit(0)
else:
    print 'I don't recognize this option' sys.exit(0)