An optparse question

T ty.2006 at yahoo.com
Fri Jul 21 15:39:21 EDT 2006


I have a short program using optparse.OptionParser that prints out help
message with -h flag:

% myprog.py -h
usage: myprog.py [options] input_file

options:
  -h, --help             show this help message and exit
  -v, --verbose        print program's version number and exit
  -o FILE               Output file


My question is, is there a way to print a blank line (or any string)
before "usage: myprog.py [options] input_file" ?  I tried using
callbacks without success.  I think somehow I need to modify the
behavior of optparse.OptionParser.print_usage() function?




More information about the Python-list mailing list