class BMI():
def init(self,name,age,tizhong,shengao):
self.name=name
self,age=age
self.tizhong=tizhong
self.shengao=shengao
def getName(self):
name=self.name
return name
def getBMI(self):
tizhong=self.tizhong
shengao=self.shengao
return tizhong/shengao**2
def getStatus(self)
a = self.get(self):
if a<18.5
return"偏瘦"
elif a<24:
return"正常"
elif
import tkinter
import tkinter.ttk
import tkinter.messagebox
import tkinter.simpledialog
root = tkinter.Tk()
#在这里编写通用代码
def button1Click():
thkinter.messagebox.showinfo(title=‘Hi’,message=xuehao.get())
#此处编写设置窗口属性代码
#此处编写创建窗口上组建的时间代码
#以及按钮,组合框等交互式组件的时间代码
button1 = tkinter.Button(root, text=‘导入学生信息’,command=button1Click)
button1.place(x=20,y=20,height=30,width=100)
xuehao = tkinter.StringVar(root)
entryXuehao = tkinter.Entry(root,width=15,textvariable=xuehao)
entryXuehao.place(x=100,y=100,height=20)
#msgbox = tkinter.messagebox.showinfo(title=‘Hi’,message=xuehao)
#启动消息主循环,启动应用程序
root.mainloop()