先打开文档比如walden注意格式
f = open ("D:/aaa\Walden.txt","w")
f.close()
f = open("D:/aaa\Walden(1)","w")
同意大小写
Walden.txt = text lower()
File "<ipython-input-23-aaab1ce9ca07>", line 1
Walden.txt = text lower()
^
SyntaxError: invalid syntax
t=t.replace(',','').replace('.','').replace('"','').replace(':','')
t=t.split()
r=collections.Counter(t)
print(r)