Re: [Tutor] input with default value option

2006-04-11 Thread Alan Gauld
>> With raw_input(), it allows to input value. Can it be used to input value >> with default value option? >> > response = raw_input("Enter some data:") > if not response: response = "default value" This is one of the few places where I do use the short-circuit evaluation trick: val = raw_input

Re: [Tutor] input with default value option

2006-04-10 Thread Danny Yoo
> With raw_input(), it allows to input value. Can it be used to input > value with default value option? Hi Phon, We can build your own function to do this. Bob showed how to set up code so that the default's taken if the user just presses enter in his reply. Let's take a look at it again:

Re: [Tutor] input with default value option

2006-04-10 Thread Bob Gailer
Keo Sophon wrote: > Hi, > > With raw_input(), it allows to input value. Can it be used to input value > with default value option? > response = raw_input("Enter some data:") if not response: response = "default value" ___ Tutor maillist - Tutor@pyt

[Tutor] input with default value option

2006-04-10 Thread Keo Sophon
Hi, With raw_input(), it allows to input value. Can it be used to input value with default value option? Phon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor