On 2007-04-01, [EMAIL PROTECTED] <[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> -- Grant Edwards grante Yow! I'm RELIGIOUS!! I at love a man with a visi.com HAIRPIECE!! Equip me with MISSILES!! -- http://mail.python.org/mailman/listinfo/python-list