单词训练系统当前版本2.3

高中会考单词练习

源码下载
windows版下载
linux版下载 测试系统 Ubuntu 22.04.2


    import tkinter as tk
    import os
    import random
    from urllib import request, parse
    import json
    import tkinter.messagebox
    import webbrowser
    from PIL import Image, ImageTk
    #from tkhtmlview import HTMLLabel
    '''
    from ttkbootstrap import Style
    '''
    from tkinter import ttk
    import sys
    import datetime
    #sudo apt-get install espeak  ps:ubuntu系统需要先安装这个不然pyttsx3用不了
    import pyttsx3
    #加锁为True解锁为Flase
    count_state = False
    error_count = 0 
    root = tk.Tk()
    '''
    style = Style(theme='darkly')
    root = style.master
    '''
    root.resizable(False, False)
    root.geometry('900x700+250+0')
    root.title("背单词工具——一起背单词,一起向未来")
    
    #root.iconbitmap('wushan\icon.ico')
    
    #导入英文单词
    try:
        classes_path = os.path.expanduser("wushan/ci")
        with open(classes_path,'r',encoding = 'UTF-8') as f:
            ci = f.readlines()
        ci = [c.strip() for c in ci]
    except:
        classes_path = os.path.expanduser("wushan/ci")
        with open(classes_path,'r',encoding = 'gbk') as f:
            ci = f.readlines()
        ci = [c.strip() for c in ci]
    
    #导入中文翻译
    try:
        classes_path = os.path.expanduser("wushan/fanyi")
        with open(classes_path,'r',encoding = 'UTF-8') as f:
            fanyi = f.readlines()
        fanyi = [c.strip() for c in fanyi]
    except:
        classes_path = os.path.expanduser("wushan/fanyi")
        with open(classes_path,'r',encoding = 'gbk') as f:
            fanyi = f.readlines()
        
            

因为程序太长仅展示部分代码,
如有需要请到开头下载源码,或者打包好的程序