Tkinter app=App(root) problem
- From: snoylr@xxxxxxxxx
- Date: 30 Apr 2005 07:08:03 -0700
This is my first day working with Tkinter. I'm using python2.3 on
WindowsXP. I found this program and entered it.
from Tkinter import *
class App:
def _init_(self,master):
frame = Frame(master)
frame.pack()
self.button = Button(frame, text = "Quit", fg = "red", command
=frame.quit)
self.button.pack(side=LEFT)
self.hi_there = Button(frame, text = "Hello", command =
self.say_hi)
self.hi_there.pack(side=LEFT)
def say_hi(self):
print "hi there, everyone!"
root = Tk()
app = App(root)
root.mainloop()
When I run the code in IDLE I get the initial frame but no buttons with
the following error:
Traceback (most recent call last):
File "C:\Documents and Settings\INTERNET\Desktop\hello2.py", line 18,
in ?
app = App(root)
TypeError: this constructor takes no arguments
I have also tried to save the program as with a pyw extension. Nothing
happens when I try to run it with that extension.
.
- Follow-Ups:
- Re: Tkinter app=App(root) problem
- From: Steve Holden
- Re: Tkinter app=App(root) problem
- Prev by Date: Re: interactive web graphics
- Next by Date: Re: Python Challenge ahead [NEW] for riddle lovers
- Previous by thread: date to digit
- Next by thread: Re: Tkinter app=App(root) problem
- Index(es):