avoid the redefinition of a function

D'Arcy Cain darcy at druid.net
Wed Sep 12 17:42:16 EDT 2012


On Wed, 12 Sep 2012 18:56:46 +0200
Jabba Laci <jabba.laci at gmail.com> wrote:
> (5) install mc
> 
> You can type just "5" as user input and step_5() is called
> automatically. If I use descriptive names like install_java() then
> selecting a menu point would be more difficult. And I don't want users
> to type "java", I want to stick to simple numbers.

Your users shouldn't be working this out in any case.  Consider,
computer time is cheap.  Programmer time is not cheap but it is short
lived.  User time is forever.  Don't be lazy.  Parse the input and
prepare to present proper error messages just in case your users are
not perfect.

-- 
D'Arcy J.M. Cain <darcy at druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.
IM: darcy at Vex.Net



More information about the Python-list mailing list