From: Chris Rebert on 10 Jun 2010 05:53 On Thu, Jun 10, 2010 at 2:38 AM, madhuri vio <madhuri.vio(a)gmail.com> wrote: > in this program i tried..i am getting a name error... > > from Tkinter import* > import Tkinter > > a = Tk() > a.title ("TOOL") > entry = Tkinter.Canvas(a)Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â #creating the canvas > under the root > entry.pack()Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â #to call the packer > geometry > entry.create_rectangle(40,30,300,150,fill="white") > b = Button(frame,text = "upload",fg="black",command = "browse") > b.pack() > c = Button(frame,text = "translate",fg="red",command = "still in progress") > c.pack() > d = Button(frame,text="exit",fg="green",command="bye") > d.pack() > > a.mainloop() > > > > > $ python newtool.py > Traceback (most recent call last): > Â File "newtool.py", line 14, in <module> > Â Â Â b = Button(frame,text = "upload",fg="black",command = "browse") > NameError: name 'frame' is not defined > > > i didnt understand hw do i instantiate frame???? Read A Fine Tutorial: http://www.pythonware.com/library/tkinter/introduction/x4822-patterns.htm (After you're finished with "How To Ask Questions The Smart Way" of course) Regards, Chris -- http://blog.rebertia.com
|
Pages: 1 Prev: Problem with libxml2/libxlst Next: xml-rpc UnicodeDecodeError |