programming python 之tkinter初学

#!/usr/bin/env python

from Tkinter import *
from tkMessageBox import showinfo

def reply( ):
    showinfo(title='popup', message='Button pressed!')

window = Tk( )
button = Button(window, text='press', command=reply)
button.pack( )
window.mainloop( )

编程技巧