Best method for a menu in a command line program?

Ben Finney ben+python at
Fri Nov 5 00:51:26 CET 2010

Terry Reedy <tjreedy at> writes:

> Others have answered that, but I would point to the inefficiency for
> users of having to enter unit and value on two separate lines. The
> prompt could be "Enter value and unit (f, c, or k) or q to quit: "
> Allow upper and lower case, with or without a space between.

Well, if we're going to critique the design, I'd say that I find the GNU
Units program <URL:> to be a
good flexible implementation of a command-line units converter.

I suspect, though, that the object of the OP was not so much to make a
good unit converter, but rather to learn from a simple example exercise.

 \      “I am too firm in my consciousness of the marvelous to be ever |
  `\       fascinated by the mere supernatural …” —Joseph Conrad, _The |
_o__)                                                     Shadow-Line_ |
Ben Finney

More information about the Python-list mailing list