MATERIAS DEL BLOG

martes, 17 de abril de 2018

PROGRAMA 4-5: PROGRAMA QUE CONVIERTE CM A METROS, YARDAS, PIES Y PULGADAS

PROGRAMA 4: CONVERTIR CM A PIES, YARDAS, METROS Y PULGADAS


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

def METROS():
    resultado1=float(primer_numero.get())*0.01
    tkMessageBox.showinfo('A METROS ES:', resultado1)


def PULGADAS():
    resultado2=float(primer_numero.get())*0.393701    tkMessageBox.showinfo('A PULGADAS ES:', resultado2)

def PIES():
    resultado3=float(primer_numero.get())* 0.032808    tkMessageBox.showinfo('A PIES ES:', resultado3)

def YARDA():
    resultado4=float(primer_numero.get())*0.0109    tkMessageBox.showinfo('A YARDAS ES:', resultado4)

Ventana = Tk()
Ventana.title("DE CENTIMETROS A OTRAS UNIDADES")
Ventana.geometry("750x200")
Ventana.configure(background ='PeachPuff2')

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="CONVERTIDOR DE CENTIMETROS A..", bg='dark slate gray',fg='deep sky blue', font="Eurostitle")
Etiqueta0.grid(row=2,column=4, padx=(10,10),pady=(10,10))

Etiqueta1 = Label(vp, text="INGRESA LOS CETIMETROS", 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='medium aquamarine', fg='dark slate gray')
primer_numero.grid(row=4, column=5, padx=(10,10),pady=(10,10))

Boton1=Button(vp, text="METROS", command=METROS, bg='black', fg='white', activebackground='dark slate gray', activeforeground='white')
Boton1.grid(row=60, column=4, padx=(10,10),pady=(10,10))

Boton2=Button(vp, text="PULGADAS", command=PULGADAS, bg='black', fg='white', activebackground='dark slate gray', activeforeground='white')
Boton2.grid(row=60, column=5, padx=(10,10),pady=(10,10))

Boton3=Button(vp, text="PIES", command=PIES, bg='black', fg='white', activebackground='dark slate gray', activeforeground='white')
Boton3.grid(row=60, column=6, padx=(10,10),pady=(10,10))

Boton4=Button(vp, text="YARDAS", command=YARDA, bg='black', fg='white', activebackground='dark slate gray', 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...