Danke für die hilfe, aber wenn ich das da einbaue klappt es immer noich nicht.
Code: Alles auswählen
import Tkinter
from Tkinter import *
class rechner:
def eins(self):
self.fenster=Tkinter.Tk()
self.fenster.geometry("300x300")
self.fenster.title('Rechner')
self.entry1=IntVar()
entry1=Entry(fenster,width=8,textvariable=self.entry1)
entry1.place(x=50,y=50)
button_7=Button(self.fenster,text='7',width=4,height=2)
button_7.grid(row=1,column=1,sticky=N)
button_8=Button(self.fenster,text='8',width=4,height=2)
button_8.grid(row=1,column=2,sticky=N)
button_9=Button(self.fenster,text='9',width=4,height=2)
button_9.grid(row=1,column=3,sticky=N)
button_4=Button(self.fenster,text='4',width=4,height=2)
button_4.grid(row=2,column=1,sticky=N)
button_5=Button(self.fenster,text='5',width=4,height=2)
button_5.grid(row=2,column=2,sticky=N)
button_6=Button(self.fenster,text='6',width=4,height=2)
button_6.grid(row=2,column=3,sticky=N)
button_1=Button(self.fenster,text='1',width=4,height=2)
button_1.grid(row=3,column=1,sticky=N)
button_2=Button(self.fenster,text='2',width=4,height=2)
button_2.grid(row=3,column=2,sticky=N)
button_3=Button(self.fenster,text='3',width=4,height=2)
button_3.grid(row=3,column=3,sticky=N)
button_0=Button(self.fenster,text='0',width=4,height=2,)
button_0.grid(row=4,column=1,sticky=N)
button_div=Button(self.fenster,text='/',width=4,height=2,foreground = "red")
button_div.grid(row=1,column=4,sticky=N)
button_mul=Button(self.fenster,text='*',width=4,height=2,foreground = "red")
button_mul.grid(row=2,column=4,sticky=N)
button_sub=Button(self.fenster,text='-',width=4,height=2,foreground = "red")
button_sub.grid(row=3,column=4,sticky=N)
button_add=Button(self.fenster,text='+',width=4,height=2,foreground = "red")
button_add.grid(row=4,column=4,sticky=N)
button_vorz=Button(self.fenster,text='+/-',width=4,height=2)
button_vorz.grid(row=4,column=2,sticky=N)
button_com=Button(self.fenster,text=',',width=4,height=2)
button_com.grid(row=4,column=3,sticky=N)
button_ist=Button(self.fenster,text='=',width=3,height=2,foreground = "red")
button_ist.grid(row=4,column=5,sticky=N)
self.fenster.mainloop()
#def createMenuBar(self):
# self.menuBar = Menu(self)
#self["menu"] = self.menuBar
horst = rechner()
horst.eins()