i trying create program restaurant named neelam. here's sample
from tkinter import * root=tk() w=label(root,text="**welcome neelam**")#this comes label w.pack() s=label(root,text="*fine dine restaurant*")#so 1 s.pack() category=raw_input('bf-breakfast s-snacks\n')#how make 1 ? q=input('enter quantity\n')
you can use other entry asks quntity. bryan said @ comments shall not use raw_input in gui programming.
you can use entry this:
from tkinter import * def callback(sv): print sv.get() top = tk() l1 = label(top, text="quantity") l1.pack( side = left) sv = stringvar() sv.trace("w", lambda name, index, mode, sv=sv: callback(sv)) e1 = entry(top, bd =5, textvariable=sv) e1.pack(side = right) top.mainloop() edit:
added on text change event, catching user input inside entry.
Comments
Post a Comment