发布时间:2019-08-21 07:50:57编辑:auto阅读(1449)
import tkinter as tk
class APP:
def __init__(self, master):
frame = tk.Frame(master)
frame.pack(side=tk.LEFT, padx=10, pady=10)
self.hi_there = tk.Button(frame, text="打招呼", bg="black", fg="white", command=self.say_hi)
self.hi_there.pack()
def say_hi(self):
print("互联网的广大朋友们大家好,我是闫晋文!")
root = tk.Tk()
app = APP(root)
root.mainloop()
打招呼
按钮后控制台输出互联网的广大朋友们大家好,我是闫晋文!
上一篇: 手把手教你将sublime3打造成pyt
下一篇: python3.x中bytes与字符串详
46449
44333
35786
33338
28044
24608
23532
18748
18001
16686
4513°
5072°
4603°
4744°
5407°
4365°
4422°
4967°
4862°
6110°