import os import re import tkinter from PIL import Image,ImageTk import zdy_center_tip class Search_word: # 图形界面 def main(self): self.root = tkinter.Toplevel() self.root.title("电子词典") self.root.config(bg="#FFF") zdy_center_tip.Center_window(self.root,600,360,False) self.label1 = tkinter.Label(self.root, text="请输入单词:", font=("微软雅黑",12), bg="#FFF") self.label1.grid(row=0,column=1,pady=20) self. entry1 = tkinter.Entry(self.root, font=("微软雅黑",12),width=30,highlightthickness=0) self.entry1.focus() self.entry1.grid(row=0,column=2,pady=20,sticky='w') self.btn1 = tkinter.Button(self.root, text="立即查询",font=("微软雅黑",12), bg="#FFF", bd=0,command=self.search_mean) self.btn1.grid(row=0,column=3,pady=20) self.text1 = tkinter.Text(self.root,font=("微软雅黑",12), width=60,height=10,highlightthickness=0) self.text1.grid(row=1,column=1,columnspan=3,padx=25) # 所有控件的合成的列表 self.list = [self.root,self.label1,self.entry1,self.btn1,self.text1] self.root.mainloop() entry1 = tkinter.Entry(self.root, font=("微软雅黑",12),width=30,highlightthickness=0) self.entry1.focus() self.entry1.grid(row=0,column=2,pady=20,sticky='w') self.btn1 = tkinter.Button(self.root, text="立即查询",font=("微软雅黑",12), bg="#FFF", bd=0,command=self.search_mean) self.btn1.grid(row=0,column=3,pady=20) self.text1 = tkinter.Text(self.root,font=("微软雅黑",12), width=60,height=10,highlightthickness=0) self.text1.grid(row=1,column=1,columnspan=3,padx=25) # 所有控件的合成的列表 self.list = [self.root,self.label1,self.entry1,self.btn1,self.text1] self.root.mainloop()