python获取英文单词库

清洗文章获得单词库,生成域名

f = open("/home/peter/danci.txt")               # 返回一个文件对象
t = open("/home/peter/dan.txt","a")
line = f.readline()               # 调用文件的 readline()方法
while line:
    print(line)                   # 后面跟 ',' 将忽略换行符
#    print(line, end = " ")     # 在 Python 3 中使用
    line = f.readline() [0:-5]
    t.writelines(line+'\n')
f.close()