发布时间:2019-08-21 07:50:57编辑:auto阅读(1965)
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与字符串详
48885
47962
38735
35875
30300
27064
26084
20919
20728
19090
552°
632°
637°
642°
613°
593°
666°
734°
857°
983°