wxOptParse

''Don't limit yourself to the command line.''

Table of Contents

Introduction

wxOptParse is a Python program that brings up a graphical representation of the options that another python program has for the command line, via the optparse module.

What this means is that if if you have a program that uses optparse you can click on checkboxes, edit boxes, combo boxes, etc. instead of using the command line.

So instead of this:

usage: mytest.py [options]

options:
  -h, --help            show this help message and exit
  -f FILENAME, --file=FILENAME
                        Enter a filename
  -p PATH, --path=PATH  Enter a path
  -2 FILENAME2, --noHelp=FILENAME2
  -n NUMBER, --count=NUMBER
                        Enter a number
  -m FLOAT, --float=FLOAT
                        Enter a floating point number
  -b, --bool            Switch to true
  --nbool               Switch to false
  --choice=CHOICE       Choice

You get

mytest-sample.png

Features

Dependencies

Download

http://developer.berlios.de/project/showfiles.php?group_id=4589

Installing

Choose one of the following methods. In all cases you probably need to run as root.

Egg Download

easy_install.py wxoptparse

Egg File

easy_install.py wxOptParse-0.1.2-py2.4.egg

Easy Install Zip

easy_install.py wxOptParse-0.1.2.zip

Normal Python Install

unzip wxOptParse-0.1.2.zip
cd wxOptParse-0.1.2
python setup.py install

Running

If you want to run your program you should be able to type:

$ wxoptparse myprogram.py

Assuming your program is called myprogram.py

There's a sample program installed called wxFind which runs the GNU find command, if available. The source code shows you how it is done. Unfortunately, GNU's find doesn't use the standard style of parameters so some handling of the parameters needs to be done, but it is still quite useful.

To Do

Related Links

Changelog