Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- # pip install ttkbootstrap (Instale essa belezinha)
- import ttkbootstrap as ttk
- from ttkbootstrap.constants import *
- root = ttk.Window(themename="journal")
- def calcular():
- F = float(textbox_one.get())
- C = (F-32) * 5/9
- valor_final.set(str(round(C, 1)) + 'ºC Graus Celsius')
- valor_final = ttk.StringVar()
- label_one = ttk.Label(root, text='Graus Fahrenheit:',
- bootstyle='info')
- label_one.place(x=100, y=10)
- textbox_one = ttk.Entry(root)
- textbox_one.place(x=100, y=35)
- button_one = ttk.Button(root, text='Calcular',command=lambda:calcular(),
- bootstyle=(INFO, OUTLINE))
- button_one.place(x=100, y=75)
- label_two = ttk.Label(root, textvariable=valor_final, bootstyle='info')
- label_two.place(x=100, y=120)
- root.title('App - Conversor de Temperatura')
- root.resizable(False, False)
- root.eval('tk::PlaceWindow . center')
- root.geometry('350x150')
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement