MATERIAS DEL BLOG

martes, 17 de abril de 2018

PROGRAMA 3-5: CONVERTIDOR DE GRADOS CELSIUS A OTROS.

PROGRAMA 3: PROGRAMA QUE CONVIERTE GRADOS CELSIUS A OTROS.


#-*- coding: utf-8 -*-
import sys
from Tkinter import *
import tkMessageBox

def FAHRENHEIT():
    resultado1=(int(primer_numero.get())- 1.8)+32
    tkMessageBox.showinfo('GRADOS FAHRENHEIT :', resultado1)
   

def KELVIN():
    resultado2=int(primer_numero.get())+273.15    tkMessageBox.showinfo('RADOS KELVIN :', resultado2)

def RANKINE():
    resultado3=(int(primer_numero.get())* 1.8) + 491.67    tkMessageBox.showinfo('GRADOS RANKINE:', resultado3)

def REAUMUR():
    resultado4=(int(primer_numero.get())*4)/5    tkMessageBox.showinfo('GRADOS REAUMUR:', resultado4)

Ventana = Tk()
Ventana.title("CONVERSION DE GRADOS")
Ventana.geometry("750x200")
Ventana.configure(background ='tan')


vp = Frame(Ventana)
vp.grid(column=0, row=0, padx=(10, 10), pady=(0, 0))
vp.configure(background = 'snow2')
vp.columnconfigure(0, weight=1)
vp.rowconfigure(0, weight=1)

Etiqueta0 = Label(vp, width=35, text="PROGRAMA CALCULADOR DE GRADOS", bg='dark slate blue', font="Eurostitle")
Etiqueta0.grid(row=2,column=4, padx=(10,10),pady=(10,10))

Etiqueta1 = Label(vp, text="INGRESA LOS GRADOS CELSIUS", bg='snow2', fg='dark slate gray', font="Eurostitle")
Etiqueta1.grid(row=4,column=4, padx=(10,10),pady=(10,10))

v1=""primer_numero= Entry(vp, width=30, textvariable=v1, bg='bisque3', fg='dark slate blue')
primer_numero.grid(row=4, column=5, padx=(10,10),pady=(10,10))


Boton1=Button(vp, text="FAHRENHEIT", command=FAHRENHEIT, bg='rosy brown', fg='black', activebackground='sea green', activeforeground='white')
Boton1.grid(row=60, column=4, padx=(10,10),pady=(10,10))

Boton2=Button(vp, text="KELVIN", command=KELVIN, bg='rosy brown', fg='black', activebackground='sea green', activeforeground='white')
Boton2.grid(row=60, column=5, padx=(10,10),pady=(10,10))

Boton3=Button(vp, text="RANKINE", command=RANKINE, bg='rosy brown', fg='black', activebackground='sea green', activeforeground='white')
Boton3.grid(row=60, column=6, padx=(10,10),pady=(10,10))

Boton4=Button(vp, text="REAUMUR", command=REAUMUR, bg='rosy brown', fg='black', activebackground='sea green', activeforeground='white')
Boton4.grid(row=60, column=7, padx=(10,10),pady=(10,10))

Ventana.mainloop()

No hay comentarios:

Publicar un comentario

FIGURA 3D EN PYTHON

import pygame from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * verticies = ( (1, -1, -1), (1...