def parsemsg(s):
    """Breaks a message from an IRC server into its prefix, command, and arguments.
    """
prefix = ''
trailing = []
if not s:
    raise IRCBadMessage('Empty line.')
if s[0] == ':':
    prefix, s = s[1:].split(' ', 1)
if s.find(' :') != -1:
    pass
Python & parsing IRC messages