def splitwords(s):
 if (not s):
  return []
 return filter(bool, map(str.strip, re.split('[ ,\n]+', s)))

def splitwords ( s ) : if ( not s ) : return [ ] return filter ( bool , map ( str . strip , re . split ( '[ ,\n]+' , s ) ) )
helper to split words on any comma .