Does Python have something like an empty string variable where you can do:
if myString == string.empty:
Regardless, what\'s the most elegan
I once wrote something similar to Bartek's answer and javascript inspired:
def is_not_blank(s): return bool(s and s.strip())
Test:
print is_not_blank("") # False print is_not_blank(" ") # False print is_not_blank("ok") # True print is_not_blank(None) # False