python check if string and not empty