发布时间:2019-08-21 07:50:57编辑:auto阅读(1975)
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与字符串详
48930
48048
38809
35930
30351
27128
26130
20967
20791
19143
668°
745°
721°
720°
698°
653°
756°
838°
952°
1193°