for w in spacechars:
    s = re.sub('(' + w + '+)', w, s)
return s
if __name__ == '__main__':
    doctest.testmod()
How can I include special characters (tab, newline) in a python doctest result string?