时间:2021-07-01 10:21:17 帮助过:7人阅读
#-*- coding: utf-8 -*-
#上面的字符编码说明非常重要,否则代码内有中文会报错
import sys
import json
import urllib
import urllib2
import cookielib
import time
import re
try:
f = open('test', 'r+')
content = f.read()
f.close()
matchReg = re.compile(r'(\s.)', re.DOTALL)
content = re.sub(matchReg, '', content)
print content
f = open('test', 'w')
f.write(content)
f.close()
except Exception as e:
print e
谢谢两位大神,都pass了