发布时间:2019-08-21 07:50:57编辑:auto阅读(2006)
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与字符串详
49361
48553
39253
36337
30751
27560
26559
21377
21235
19581
221°
458°
445°
543°
889°
611°
1288°
1408°
1217°
1205°