import tkinter as tk
from tkinter import *
import math
pencere=tk.Tk()
pencere.title(“Entry İşlemleri”)
pencere.geometry(“350x550”)
pencere.configure(background=“black”)
def islemcıkar():
ekran[“text”]=ekran[“text”]+cıkarma[“text”]
def islemtopla():
ekran[“text”]=ekran[“text”]+toplama[“text”]
def islemcarp():
ekran[“text”]=ekran[“text”]+carpma[“text”]
def islembol():
ekran[“text”]=ekran[“text”]+bölme[“text”]
def islemsil():
ekran[“text”]=“”
result[“text”]=“”
def nokta():
ekran[“text”]=ekran[“text”]+nokta[“text”]
def kökle():
ekran[“text”]=ekran[“text”]+kök[“text”]
def yüzdelik():
ekran[“text”]=ekran[“text”]+yuzde[“text”]
def gerigit():
ekran[“text”]=ekran[“text”][:-1]
def sayı0():
#sy=“sy”+str(x)+“[”+‘“text”’+“]”
#ekran[“text”]=ekran[“text”]+sy
ekran[“text”]=ekran[“text”]+sy0[“text”]
def sayı1():
ekran[“text”]=ekran[“text”]+sy1[“text”]
def sayı2():
ekran[“text”]=ekran[“text”]+sy2[“text”]
def sayı3():
ekran[“text”]=ekran[“text”]+sy3[“text”]
def sayı4():
ekran[“text”]=ekran[“text”]+sy4[“text”]
def sayı5():
ekran[“text”]=ekran[“text”]+sy5[“text”]
def sayı6():
ekran[“text”]=ekran[“text”]+sy6[“text”]
def sayı7():
ekran[“text”]=ekran[“text”]+sy7[“text”]
def sayı8():
ekran[“text”]=ekran[“text”]+sy8[“text”]
def sayı9():
ekran[“text”]=ekran[“text”]+sy9[“text”]
def kökünüal():
k=int(ekran[“text”][1:])
result[“text”]=math.sqrt(k)
def yüzdeal():
yüz=ekran[“text”]
syüz=“”
for v in yüz:
if v !=“%”:
syüz=syüz+v
else:
syüz=syüz+“*”
result[“text”]=eval(syüz)/100
def sonuc():
s1=“”
for i in ekran[“text”]:
if i==“×”:
s1=s1+“*”
elif i==“÷”:
s1=s1+“/”
elif i==“√”:
kökünüal()
return
elif i==“%”:
yüzdeal()
return
else:
s1=s1+i
result[“text”]=eval(s1)
ekranb=tk.Label(text="İşlemler ",font="Arial 16 ",fg=“gray”,bg=“black”)
ekranb.place(x=10,y=100)
ekrans=tk.Label(text="Sonuç ",font="Arial 16 ",fg=“gray”,bg=“black”)
ekrans.place(x=20,y=500)
ekran=tk.Label(text=“”,font="Arial 16 ",fg=“white”,bg=“black”)
ekran.place(x=50,y=300)
result=tk.Label(text=“”,font="Arial 16 ",fg=“white”,bg=“black”)
result.place(x=50,y=700)
sy0=tk.Button(text=“0”,font=“Arial 25 bold”,bg=“black”,fg=“white”,bd=10,command=sayı0)
sy0.place(x=300, y=1900, width=200,height=200)
sy1=tk.Button(text=“1”,font=“Arial 25 bold”,bg=“black”,fg=“white”,bd=10,command=sayı1)
sy1.place(x=50, y=1650, width=200,height=200)
sy2=tk.Button(text=“2”,font=“Arial 25 bold”,bg=“black”,fg=“white”,bd=10,command=sayı2)
sy2.place(x=300, y=1650, width=200,height=200)
sy3=tk.Button(text=“3”,font=“Arial 25 bold”,bg=“black”,fg=“white”,bd=10,command=sayı3)
sy3.place(x=550, y=1650, width=200,height=200)
sy4=tk.Button(text=“4”,font=“Arial 25 bold”,bg=“black”,fg=“white”,bd=10,command=sayı4)
sy4.place(x=50, y=1400, width=200,height=200)
sy5=tk.Button(text=“5”,font=“Arial 25 bold”,bg=“black”,fg=“white”,bd=10,command=sayı5)
sy5.place(x=300, y=1400, width=200,height=200)
sy6=tk.Button(text=“6”,font=“Arial 25 bold”,bg=“black”,fg=“white”,bd=10,command=sayı6)
sy6.place(x=550, y=1400, width=200,height=200)
sy7=tk.Button(text=“7”,font=“Arial 25 bold”,bg=“black”,fg=“white”,bd=10,command=sayı7)
sy7.place(x=50, y=1150, width=200,height=200)
sy8=tk.Button(text=“8”,font=“Arial 25 bold”,bg=“black”,fg=“white”,bd=10,command=sayı8)
sy8.place(x=300, y=1150, width=200,height=200)
sy9=tk.Button(text=“9”,font=“Arial 25 bold”,bg=“black”,fg=“white”,bd=10,command=sayı9)
sy9.place(x=550, y=1150, width=200,height=200)
toplama=tk.Button(text=“+”,font=“Arial 30 bold”,bg=“green”,fg=“white”,bd=10,command=islemtopla)
toplama.place(x=800, y=1650, width=200,height=200)
cıkarma=tk.Button(text=“-”,font=“Arial 40 bold”,bg=“green”,fg=“white”,bd=10,command=islemcıkar)
cıkarma.place(x=800, y=1400, width=200,height=200)
carpma=tk.Button(text=“×”,font=“Arial 30 bold”,bg=“green”,fg=“white”,bd=10,command=islemcarp)
carpma.place(x=800, y=1150, width=200,height=200)
bölme=tk.Button(text=“÷”,font=“Arial 30 bold”,bg=“green”,fg=“white”,bd=10,command=islembol)
bölme.place(x=800, y=900,width=200,height=200)
silme=tk.Button(text=“C”,font=“Arial 25 bold”,bg=“black”,fg=“red”,bd=10,command=islemsil)
silme.place(x=50, y=900, width=200,height=200)
yuzde=tk.Button(text=“%”,font=“Arial 25 bold”,bg=“black”,fg=“red”,bd=10,command=yüzdelik)
yuzde.place(x=300, y=900, width=200,height=200)
kök=tk.Button(text=“√”,font=“Arial 30 bold”,bg=“black”,fg=“red”,bd=10,command=kökle)
kök.place(x=550, y=900, width=200,height=200)
esit=tk.Button(text=“=”,font=“Arial 30 bold”,bg=“green”,fg=“white”,bd=10,command=sonuc)
esit.place(x=800, y=1900, width=200,height=200)
nokta=tk.Button(text=“.”,font=“Arial 30 bold”,bg=“green”,fg=“white”,bd=10,command=nokta)
nokta.place(x=50, y=1900, width=200,height=200)
geriye=tk.Button(text="⌫ ",font=“Arial 18 bold”,bg=“green”,fg=“white”,bd=10,command=gerigit)
geriye.place(x=550, y=1900,width=200,height=200)
pencere.mainloop()