diff --git a/pythonProject1/test.py b/pythonProject1/test.py index a474602..53b7ad0 100644 --- a/pythonProject1/test.py +++ b/pythonProject1/test.py @@ -32,4 +32,10 @@ try: connection.close() except pymysql.MySQLError as e: - print(f"连接数据库时发生错误: {e}") \ No newline at end of file + print(f"连接数据库时发生错误: {e}") + + + + + + \ No newline at end of file diff --git a/pythonProject1/test1.py b/pythonProject1/test1.py index bd4fa89..a3479db 100644 --- a/pythonProject1/test1.py +++ b/pythonProject1/test1.py @@ -158,10 +158,9 @@ class Window2(tk.Toplevel): def check_spelling(self): user_input = self.entry_var.get().strip().lower() if user_input == self.current_word.lower(): + self.user_entry.config(fg="green") # 将输入框文字颜色设为绿色 self.result_label.config(text="正确!", fg="green") self.next_button.config(state=tk.NORMAL) # 正确后启用按钮 - self.entry_var.set("") # 清空输入框 - self.result_label.config(text="") self.word_error_count[self.current_word] = 0 # 重置错误计数 else: self.result_label.config(text=f"错误!", fg="red")