On 2007-04-02, Shane Geiger <[EMAIL PROTECTED]> wrote:
>>> how can i compare a string which is non null and empty?
>>>
>> [...]
>>
>>> In java,I do this:
>>> if (str != null) && (!str.equals("")) ....
>>>
>>> how can i do that in python?
>>
>> If you want to litterally do that, it's
>>
>> if (str != None) and (str != ""):
>> <whatever>
>>
>> However, the standard idiom for doing that in Python is
>>
>> if str:
>> <whatever>
>
> It is probably worth noting that the example is not executable code:
> str() is a function.
Yea, sorry about that.
--
Grant Edwards grante Yow! Now I'm concentrating
at on a specific tank battle
visi.com toward the end of World
War II!
--
http://mail.python.org/mailman/listinfo/python-list