[Tutor] boolean raw_input
python at bernardlebel.com
Thu Aug 19 09:07:31 CEST 2004
I thought you could get a checkbox inside a raw_input call.
Any suggestion in that regard will be welcomed :-)
----- Original Message -----
From: "Alan Gauld" <alan.gauld at blueyonder.co.uk>
To: "Bernard Lebel" <python at bernardlebel.com>; <tutor at python.org>
Sent: Thursday, August 19, 2004 12:32 AM
Subject: Re: [Tutor] boolean raw_input
> > Recently I saw on this list a bit of code that used a boolean
> > inside a raw_input call, and of course realized after I deleted the
> > that I actually need that.
> > If I remember correctly, it was something like:
> > raw_input( 'text', [y/n] )
> More, likely it was:
> raw_input("text [y/n]")
> ie the default values shown inside the prompt string.
> raw_input only takes one parameter, a prompt string.
> The only way I can think of to use boolean expressions inside
> raw_input is to use a single input line to do two jobs. ie
> value = raw_input(SomeTest() and "Sometest value:" or "Something
> Which does the same as:
> if someTest():
> value = raw_input("Sometest value:")
> value = raw_input("Something else:")
> Other than that I can't think what you mean.
> Alan G.
More information about the Tutor