On Mar 4, 10:53 am, Mel wrote:
> bearophileh...@lycos.com wrote:
> > Chris Rebert:
> >> That seems to just be an overly complicated way of writing:
> >> spaces = bool(form.has_key('spaces') and form.getvalue('spaces') == 1)
> > Better:
> > spaces = bool(('spaces' in form) and form.getvalue('spaces
bearophileh...@lycos.com wrote:
> Chris Rebert:
>> That seems to just be an overly complicated way of writing:
>> spaces = bool(form.has_key('spaces') and form.getvalue('spaces') == 1)
> Better:
> spaces = bool(('spaces' in form) and form.getvalue('spaces') == 1)
Is it still necessary to convert
On Feb 27, 7:55 pm, bearophileh...@lycos.com wrote:
> Chris Rebert:
>
> > That seems to just be an overly complicated way of writing:
>
> > spaces = bool(form.has_key('spaces') and form.getvalue('spaces') == 1)
>
> Better:
>
> spaces = bool(('spaces' in form) and form.getvalue('spaces') == 1)
Huh?
On 3/2/09 12:53 AM, Bruno Desthuilliers wrote:
Steve Holden a écrit :
Anjanesh Lekshminarayanan wrote:
How do we know that from the what the OP posted?
Its CGI alright.
spaces = form.has_key('spaces') and form.getvalue('spaces') == '1'
But I just dont see how
spaces = (form.has_key('spaces')
Steve Holden a écrit :
Anjanesh Lekshminarayanan wrote:
How do we know that from the what the OP posted?
Its CGI alright.
spaces = form.has_key('spaces') and form.getvalue('spaces') == '1'
But I just dont see how
spaces = (form.has_key('spaces') ? form.getvalue('spaces') == 1 ?
True: False : F
Anjanesh Lekshminarayanan wrote:
>> How do we know that from the what the OP posted?
> Its CGI alright.
> spaces = form.has_key('spaces') and form.getvalue('spaces') == '1'
>
> But I just dont see how
> spaces = (form.has_key('spaces') ? form.getvalue('spaces') == 1 ?
> True: False : False)
> is c
Chris Rebert:
> That seems to just be an overly complicated way of writing:
>
> spaces = bool(form.has_key('spaces') and form.getvalue('spaces') == 1)
Better:
spaces = bool(('spaces' in form) and form.getvalue('spaces') == 1)
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Feb 26, 2009 at 8:39 PM, Anjanesh Lekshminarayanan
wrote:
>> How do we know that from the what the OP posted?
> Its CGI alright.
> spaces = form.has_key('spaces') and form.getvalue('spaces') == '1'
>
> But I just dont see how
> spaces = (form.has_key('spaces') ? form.getvalue('spaces') ==
> How do we know that from the what the OP posted?
Its CGI alright.
spaces = form.has_key('spaces') and form.getvalue('spaces') == '1'
But I just dont see how
spaces = (form.has_key('spaces') ? form.getvalue('spaces') == 1 ?
True: False : False)
is complicated in anyway. Its not that hard to read
On 2009-02-27, Paul Rubin wrote:
> But the == 1 comparison will always fail, since getvalue returns a string.
How do we know that from the what the OP posted?
--
Grant
--
http://mail.python.org/mailman/listinfo/python-list
Chris Rebert writes:
> spaces = bool(form.has_key('spaces') and form.getvalue('spaces') == 1)
spaces = form.has_key('spaces') and form.getvalue('spaces') == 1
or even (this is about the cgi module, I think)
spaces = form.getvalue('spaces', None) == 1
But the == 1 comparison will always fail,
On 2009-02-27, Anjanesh Lekshminarayanan wrote:
> How do I achieve something like this using python ?
> spaces = (form.has_key('spaces') ? form.getvalue('spaces') == 1 ? True :
> False : False)
if form.has_key('spaces'):
spaces = form.getvalue('spaces') == 1
else:
spaces = Fal
On Thu, Feb 26, 2009 at 7:11 PM, Anjanesh Lekshminarayanan
wrote:
> How do I achieve something like this using python ?
> spaces = (form.has_key('spaces') ? form.getvalue('spaces') == 1 ? True
> : False : False)
>
> spaces = True if form.getvalue('spaces') == 1 if
> form.has_key('spaces') else Fal
Anjanesh Lekshminarayanan wrote:
> How do I achieve something like this using python ?
> spaces = (form.has_key('spaces') ? form.getvalue('spaces') == 1 ? True
> : False : False)
>
> spaces = True if form.getvalue('spaces') == 1 if
> form.has_key('spaces') else False else False
If you've got any
How do I achieve something like this using python ?
spaces = (form.has_key('spaces') ? form.getvalue('spaces') == 1 ? True
: False : False)
spaces = True if form.getvalue('spaces') == 1 if
form.has_key('spaces') else False else False
--
Anjanesh Lekshmnarayanan
--
http://mail.python.org/mailman/l
15 matches
Mail list logo