# -*- coding: utf-8 -*-
import os,sys
from Tkinter import *
def GetValue():
password=ent.get()
if password == 'Elaine':
button['bg']='yellow'
print 'hehe'
else:
ent.delete(0,END)
ent.insert(0,'wrong wrong wrong')
root = Tk()
root.geometry("150x100+400+200")
lab=Label(root,text='阿九,你文章写好没?')
ent=Entry(root,bg='white')
button =Button(root,text='Enter Password',command=GetValue)
lab.pack(ancho=W)
ent.pack(ancho=W)
button.pack(ancho=E)
root.mainloop()
研究了半天,终于找到方法了。。。