Guest User

Untitled

a guest
Nov 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. #python 2.7
  2.  
  3. import ttk
  4. from Tkinter import *
  5. from math import *
  6.  
  7. root=Tk()
  8. root.title('convert bitwen MAD and EUR , USD')
  9.  
  10. f1=Frame(root, width =500, height =500, bg="green")
  11. f1.grid(row=0, column=0)
  12.  
  13.  
  14. entr1=ttk.Entry(f1, text="enter MAD", width=10)
  15. entr1.pack()
  16.  
  17.  
  18. chaine1= Label(f1)
  19. chaine1.configure(text = "USD", fg='royal blue',bg='green',)
  20. chaine1.pack()
  21.  
  22. def buClick():
  23. b= float(entr1.get())*9.4915 f 9.4915
  24. chaine.configure(text = "Equal to = " + str(b)+ " MAD",bg='green')
  25.  
  26. bout1=ttk.Button(f1, text="Convert")
  27. bout1.pack()
  28.  
  29. ttk.Button.configure(bout1, command=buClick)
  30. chaine = Label(f1)
  31. chaine.pack()
  32.  
  33. style=ttk.Style()
  34. style.configure('TButton', background='green')
  35.  
  36. f2=Frame(root, width =1000, height =500, bg="green")
  37. f2.grid(row=0, column=3)
  38.  
  39. entr2=ttk.Entry(f2, width=10)
  40. entr2.pack()
  41. chaine2= Label(f2)
  42. chaine2.configure(text = "MAD", fg='royal blue',bg='green',)
  43. chaine2.pack()
  44. def buClick():
  45. b= float(entr2.get())*0.1054
  46. chaine5.configure(text = "Equal to = " + str(b)+ " USD",bg='green')
  47. bout2=ttk.Button(f2, text="Convert")
  48. bout2.pack()
  49. ttk.Button.configure(bout2, command=buClick)
  50. chaine5 = Label(f2)
  51. chaine5.pack()
  52.  
  53. f3=Frame(root, width =500, height =500, bg="green")
  54. f3.grid(row=1, column=0)
  55.  
  56. entr3=ttk.Entry(f3, width=10)
  57. entr3.pack()
  58. chaine3= Label(f3)
  59. chaine3.configure(text = "EUR", fg='royal blue',bg='green',)
  60. chaine3.pack()
  61. def buClick():
  62. b= float(entr3.get())*10.8960
  63. chaine4.configure(text = "Equal to = " + str(b)+ " MAD",bg='green')
  64. bout3=ttk.Button(f3, text="Convert")
  65. bout3.pack()
  66. ttk.Button.configure(bout3, command=buClick)
  67. chaine4 = Label(f3)
  68. chaine4.pack()
  69.  
  70. f4=Frame(root, width =500, height =500, bg="green")
  71. f4.grid(row=1, column=3)
  72.  
  73. entr4=ttk.Entry(f4, width=10)
  74. entr4.pack()
  75. chaine6= Label(f4)
  76. chaine6.configure(text = "MAD", fg='royal blue',bg='green',)
  77. chaine6.pack()
  78. def buClick():
  79. b= float(entr4.get())*0.0918
  80. chaine7.configure(text = "Equal to = " + str(b)+ " EUR",bg='green')
  81. bout4=ttk.Button(f4, text="Convert")
  82. bout4.pack()
  83. ttk.Button.configure(bout4, command=buClick)
  84. chaine7 = Label(f4)
  85. chaine7.pack()
  86.  
  87. root.mainloop()
Add Comment
Please, Sign In to add comment