Newbie Help Please.(OO and Tkinter)

Matt Gerrans mgerrans at mindspring.com
Sun Jun 16 22:37:22 CEST 2002


Did you intend to be defining the method apply() inside the method savein()
or did accidentally get that extra indentation?

>     def savin(self, question):
>         Label(question, text="Directory:").grid(row=0)
>         Label(question, text="Filename:").grid(row=1)
>         self.e1 = Entry(question)
>         self.e2 = Entry(question)
>         self.e1.grid(row=0, column=1)
>         self.e2.grid(row=1, column=1)
>         def apply(self):
>             self.dir = self.e1.get()
>             self.fn = self.e2.get()
>             self.sav = self.dir + self.fn
>             self.savfile = open(self.sav, "w")
>             for line in self.t1.readlines():
>                 self.savefile.write(line)
>             self.savefile.close()






More information about the Python-list mailing list