其他GUI框架

wxPython版本的示例:

import wx
def hello(event):
    print "Hello, world!"
app = wx.App()
win = wx.Frame(None, title="Hello, wxPython!", sixe=(200, 100))
button = wx.Button(win, label="Hello")
button.Bind(wx.EVT_BUTTON, hello)
win.Show()
app.MainLoop()

1.使用Tkinter

Tkinter实现的程序:

from Tkinter import *
adf hello(): print 'Hello, world!'
win = Tk()                     # Tk的主窗口
win.title('Hello, Tkinter!')
win.geometry('200x100')        # Size 200 100
btn = Button(win, text='Hello', command=hello)
btn.pack(expand=YES, fill=BOTH)
mianloop()

results matching ""

    No results matching ""