Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #python 2.7
- import ttk
- from Tkinter import *
- from math import *
- root=Tk()
- root.title('convert bitwen MAD and EUR , USD')
- f1=Frame(root, width =500, height =500, bg="green")
- f1.grid(row=0, column=0)
- entr1=ttk.Entry(f1, text="enter MAD", width=10)
- entr1.pack()
- chaine1= Label(f1)
- chaine1.configure(text = "USD", fg='royal blue',bg='green',)
- chaine1.pack()
- def buClick():
- b= float(entr1.get())*9.4915 f 9.4915
- chaine.configure(text = "Equal to = " + str(b)+ " MAD",bg='green')
- bout1=ttk.Button(f1, text="Convert")
- bout1.pack()
- ttk.Button.configure(bout1, command=buClick)
- chaine = Label(f1)
- chaine.pack()
- style=ttk.Style()
- style.configure('TButton', background='green')
- f2=Frame(root, width =1000, height =500, bg="green")
- f2.grid(row=0, column=3)
- entr2=ttk.Entry(f2, width=10)
- entr2.pack()
- chaine2= Label(f2)
- chaine2.configure(text = "MAD", fg='royal blue',bg='green',)
- chaine2.pack()
- def buClick():
- b= float(entr2.get())*0.1054
- chaine5.configure(text = "Equal to = " + str(b)+ " USD",bg='green')
- bout2=ttk.Button(f2, text="Convert")
- bout2.pack()
- ttk.Button.configure(bout2, command=buClick)
- chaine5 = Label(f2)
- chaine5.pack()
- f3=Frame(root, width =500, height =500, bg="green")
- f3.grid(row=1, column=0)
- entr3=ttk.Entry(f3, width=10)
- entr3.pack()
- chaine3= Label(f3)
- chaine3.configure(text = "EUR", fg='royal blue',bg='green',)
- chaine3.pack()
- def buClick():
- b= float(entr3.get())*10.8960
- chaine4.configure(text = "Equal to = " + str(b)+ " MAD",bg='green')
- bout3=ttk.Button(f3, text="Convert")
- bout3.pack()
- ttk.Button.configure(bout3, command=buClick)
- chaine4 = Label(f3)
- chaine4.pack()
- f4=Frame(root, width =500, height =500, bg="green")
- f4.grid(row=1, column=3)
- entr4=ttk.Entry(f4, width=10)
- entr4.pack()
- chaine6= Label(f4)
- chaine6.configure(text = "MAD", fg='royal blue',bg='green',)
- chaine6.pack()
- def buClick():
- b= float(entr4.get())*0.0918
- chaine7.configure(text = "Equal to = " + str(b)+ " EUR",bg='green')
- bout4=ttk.Button(f4, text="Convert")
- bout4.pack()
- ttk.Button.configure(bout4, command=buClick)
- chaine7 = Label(f4)
- chaine7.pack()
- root.mainloop()
Add Comment
Please, Sign In to add comment