下面4行代码是python创建图形界面必须要得代码
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tkinter as tk # 导入tkinter 模块并创建一个别名tk
win = tk.Tk() # 实例化tk.TK
win.title("Python GUI") # 添加标题
win.mainloop() # 当调用mainloop()时,窗口才会显示出来
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tkinter as tk # 导入tkinter 模块并创建一个别名tk
win = tk.Tk() # 实例化tk.TK
win.title("Python GUI") # 添加标题
win.mainloop() # 当调用mainloop()时,窗口才会显示出来