def head_tail(line):
    """Returns the first word in 'line' and the rest of 'line' or None if the
    line is too short."""
    generator = (t.strip() for t in line.split(None, 1))
    head = next(generator).strip()
    tail = ''
    try:
        tail = next(generator).strip()
    except StopIteration:
        pass
    return head, tail