ich steh grad völlig auf dem Schlauch. Ich habe schon einige TK-Programme geschrieben aber folgendes macht mir Probleme:
Code: Alles auswählen
from Tkinter import *
import hashlib
class Control:
def __init__(self, mf):
self.mf = mf
self.__createGui()
def __createGui(self):
print self.mf
self.lblDate = Label(self.mf, text="Date:", width=15, anchor=E).grid(row=0, column=0)
self.etyDate = Entry(self.mf, width=40).grid(row=0, column=1)
print self.etyDate
self.lblProjectNbr = Label(self.mf, text="Projectnumber", width=15, anchor=E).grid(row=1, column=0)
self.etyProjectNbr = Entry(self.mf, width=40).grid(row=1, column=1)
self.btnCreatePassword = Button(self.mf, text = "Create password", command=self._CreatePassword).grid(row=2, column=0)
self.lblPassword = Label(self.mf, text = "Password:", width=15, anchor=E).grid(row=3, column=0)
self.etyPassword = Entry(self.mf, width=40).grid(row=3, column=1)
def _CreatePassword(self):
print("password")
m = hashlib.md5()
m.update(str(self.etyDate.get()))
m.update(str(self.etyProjectNbr.get()))
self.etyPassword = m.hexdigest()
if __name__ == '__main__':
mf = Tk()
#feld=Toplevel(root)
c = Control(mf)
#d = Control(mf, "a", "b")
mf.mainloop()
und zwar bekomme ich kein Objekt für
Code: Alles auswählen
print self.etyDate
Danke und Gruß
alpha