Ich habe ein Programm geschrieben, was eine Mail versenden soll.
Habe nur ein Problem mit get().
Hier der Code:
Code: Alles auswählen
class mail:
def anfangen(self):
self.root.destroy()
self.rcpt=self.mto.get()
self.absender=self.mailfrom.get()
self.betreff=self.msub.get()
self.mess1=self.textfenster.get(1.0,END)
self.repeats=self.mrep.get()
do=MyMainProgram()
do.begin_MyRegularThread()
def grafik(self):
self.root=Tk()
self.root.geometry("600x400")
self.root.title("Mail-Programm")
self.mailfrom=Entry(self.root,width=60,font=("Arial",10))
self.mto=Entry(self.root,width=60,font=("Arial",10))
self.msub=Entry(self.root,width=60,font=("Arial",10))
self.mtolabel=Label(self.root,width=10,text="An:",font=("Arial",10,"bold"))
self.mfromlabel=Label(self.root,width=10,text="Von:",font=("Arial",10,"bold"))
self.msublabel=Label(self.root,width=10,text="Betreff:",font=("Arial",10,"bold"))
self.textfenster=Text(self.root,width=74,height=10, font=("Arial",10))
self.button=Button(self.root,text="Senden",font=("Arial",15,"bold"),command=self.anfangen)
self.mfromlabel.place(x=5,y=10)
self.mailfrom.place(x=100,y=10)
self.mtolabel.place(x=5,y=50)
self.mto.place(x=100,y=50)
self.msublabel.place(x=5,y=90)
self.msub.place(x=100,y=90)
self.textfenster.place(x=5,y=140)
self.button.place(x=480,y=350,width=100,height=35)
if not usingIDLE:
self.root.mainloop()
Code: Alles auswählen
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python22\lib\lib-tk\Tkinter.py", line 1316, in __call__
return apply(self.func, args)
File "C:\Dokumente und Einstellungen\Roman\Mein Kram\Eigene Programme\mail_provisional.py", line 13, in anfangen
self.rcpt=self.mto.get()
File "C:\Python22\lib\lib-tk\Tkinter.py", line 2202, in get
return self.tk.call(self._w, 'get')
TclError: invalid command name ".11504712"
Weiss jemand warum das nicht geht? Ich habe ein änliches Konzept schon mal geschrieben und da hat es wunderbar funktioniert.
Danke schon mal im Voraus,
Roman