Python/Tkinter Button and Entry on the same window -
i'm beginner in python (2.7.5). here basic question
i'm trying create window both button , entry reason doesn't work. if try make window entries or button works not both button , entry @ same time.
so question basically: how create window both button , entry ?
below script:
from tkinter import* def super_function(): fen1.quit fen1 = tk() entr = [] in range(10): entr.append(entry(fen1)) entr[i].grid(row=i) button(fen1,text='store in list',command=fen1.quit).pack(side=bottom) fen1.mainloop()
thank !
the problem using pack
, grid
@ same time. instead, should use one:
from tkinter import * def super_function(): fen1.quit fen1 = tk() entr = [] in xrange(10): entr.append(entry(fen1)) entr[i].grid(row=i) # use grid instead of pack here button(fen1,text='store in list',command=super_function).grid() fen1.mainloop()
Comments
Post a Comment