用raw_input是没问题的, 在tkinter中,这样有哪里不对吗
from Tkinter import *
import tkMessageBox
master = Tk()
e = Entry(master)
e.pack()
e.focus_set()
def clr_text():
e.delete(0, END)
def nameget():
namelist = []
morename = "yes"
n = 0
while morename == "yes":
name = e.get()
namelist = namelist + [name]
n = n + 1
morename = tkMessageBox.askyesno("Question","yes:input another name;no:view name list")
print n,namelist
b2 = Button(master, text="clear", width=10, command=clr_text)
b2.pack()
b1 = Button(master, text="comfirm", width=10, command=nameget)
b1.pack()
mainloop()
from Tkinter import *
import tkMessageBox
master = Tk()
e = Entry(master)
e.pack()
e.focus_set()
def clr_text():
e.delete(0, END)
def nameget():
namelist = []
morename = "yes"
n = 0
while morename == "yes":
name = e.get()
namelist = namelist + [name]
n = n + 1
morename = tkMessageBox.askyesno("Question","yes:input another name;no:view name list")
print n,namelist
b2 = Button(master, text="clear", width=10, command=clr_text)
b2.pack()
b1 = Button(master, text="comfirm", width=10, command=nameget)
b1.pack()
mainloop()