tkinter - Positioning widget buttons and Entry boxes better in Python -
ok, i'm using tkinter module python, , want have 5 entry boxes, each of variable combines single variable, , used serial key automatic installer office (among other software, install script medium-sized office).
none of relevant, except give idea of content.
i attempting put of entry boxes in small space, preferably 1 or 2 columns (i using 4-6 columns, can check).
is possible tkinter?
here's code far part of script:
label(app, text="office serial key").grid(row=3, column=0) entries = ["e1", "e2", "e3", "e4", "e5"] colnum = 1 item in entries: item = entry(app, width=10) item.grid(row=3, column=colnum) colnum = colnum + 1 i want more professional/like microsoft install.
you can lot layout way want it. think way accomplish put label+entrys frame, when grid frame, use columnspan keyword set how wide should respect other widgets in "app".
( http://effbot.org/tkinterbook/grid.htm )
here's silly example:
import tkinter tk root=tk.tk() in range(7): tk.label(root,text='%d'%i,width=12).grid(row=0,column=i) myframe=tk.frame(root) tk.label(myframe, text="office serial key").grid(row=0, column=0) entries = ["e1", "e2", "e3", "e4", "e5"] column,item in enumerate(entries,start=1): item = tk.entry(myframe, width=10) item.grid(row=0, column=column) myframe.grid(row=1,column=0,columnspan=3) root.mainloop()
Comments
Post a Comment