.txt からすべての情報を取得するための Python コードを書いています。そして、私はコードを書きましたが、常にエラーが発生します: 「NoneType」オブジェクトには属性「groupdict」がありません
コード:
import re
readfile = open("test.txt")
try:
all_the_text =readfile.read()
m = re.match("(pdflink=[\w\s/]*)author=([\w\s/]*/n)",unicode(all_the_text),flags=re.UNICODE)
m.groupdict()
print m.groupdict()
finally:
readfile.close()
writefile = open('test5.txt','w')
print >> writefile, m.groupdict()
writefile.close()
助けてください!どうも!