|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 Mike_python小 于 2020-3-19 13:42 编辑
明天有更高级的哟
记得评论哟
计算器 闪亮登场:
- from tkinter import *
- from tkinter import messagebox as g
- from PIL import Image, ImageTk
- root = Tk()
- root.geometry('300x150+550+300')
- image1 = Image.open('C:\\Users\\Python\\Desktop\\你好.png ')
- image2 = ImageTk.PhotoImage(image1)
- to = Label(root, image=image2)
- to.pack()
- def ji():
- b_g = str(eval(b.get()))
- g.showinfo('结果', '%s' % b_g)
- Label(root, text='请输入', font=('宋体', 15)).place(x=10, y=30)
- b = Entry(root, font=('宋体', 15))
- b.place(x=80, y=30)
- c = Button(root, text='计算', bg='yellow', fg='blue', command=ji)
- c.place(x=80, y=70)
- root.mainloop()
复制代码
记得评论哟 |
评分
-
查看全部评分
|