发布时间:2019-08-21 07:50:57编辑:auto阅读(1961)
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与字符串详
48870
47939
38718
35863
30288
27042
26075
20909
20714
19072
511°
609°
613°
616°
593°
577°
643°
717°
834°
936°