发布时间:2017-12-25 13:31:31编辑:Run阅读(6758)
编写一个st2.py文件,代码如下
#!/usr/bin/env python
# coding: utf-8
__author__ = 'www.py3study.com'
import tkinter as tk
class APP(object):
def __init__(self, master):
frame = tk.Frame(master)
frame.pack()
self.hi_there = tk.Button(frame, text='测试', fg='blue', command=self.say_ceshi)
self.hi_there.pack()
def say_ceshi(self):
print('www.py3study.com')
st = tk.Tk()
app = APP(st)
st.mainloop()运行程序,应该看到的结果

点击测试,点击一次,就会打印一次say_ceshi里面的print内容

下一篇: 没有了
51225
50650
41264
38077
32544
29448
28309
23169
23130
21463
1527°
2238°
1864°
1802°
2100°
1853°
2536°
4258°
4112°
2935°