Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the simply-static domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wp-includes/functions.php on line 6121
python获取英文单词库

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()