#-*- coding: utf-8 -*-import sys from Tkinter import * import tkMessageBox def SUMA(): resultado1=int(primer_numero.get())+int(segundo_numero.get()) tkMessageBox.showinfo('LA SUMA TOTAL ES:', resultado1) def RESTA(): resultado2=int(primer_numero.get())-int(segundo_numero.get()) tkMessageBox.showinfo('LA RESTA TOTAL ES:', resultado2) def MULTIPLICACION(): resultado3=int(primer_numero.get())*int(segundo_numero.get()) tkMessageBox.showinfo('LA MULTIPLICACION TOTAL ES:', resultado3) def DIVISION(): resultado4=int(primer_numero.get())/int(segundo_numero.get()) tkMessageBox.showinfo('LA DIVISION TOTAL ES:', resultado4) Ventana = Tk() Ventana.title("SUMA, RESTA, MULTIPLICCION Y DIVISION") 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="PROGRAMA CALCULADOR DE NUMEROS", bg='steel blue', font="Eurostitle") Etiqueta0.grid(row=2,column=4, padx=(10,10),pady=(10,10)) Etiqueta1 = Label(vp, text="INGRESA EL PRIMER NUMERO", bg='snow2', fg='dark slate gray', font="Eurostitle") Etiqueta1.grid(row=4,column=4, padx=(10,10),pady=(10,10)) Etiqueta2 = Label(vp, text="INGRESA EL SEGUNDO NUMERO", bg='snow2', fg='dark slate gray', font='typewriter') Etiqueta2.grid(row=6,column=4, padx=(10,10), pady=(10,10)) v1=""primer_numero= Entry(vp, width=30, textvariable=v1, bg='indian red', fg='black') primer_numero.grid(row=4, column=5, padx=(10,10),pady=(10,10)) v2=""segundo_numero= Entry(vp, width=30, textvariable=v2, bg='indian red', fg='black') segundo_numero.grid(row=6, column=5, padx=(10,10),pady=(10,10)) Boton1=Button(vp, text="SUMAR", command=SUMA, 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="RESTAR", command=RESTA, 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="MULTIPLICAR", command=MULTIPLICACION, 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="DIVIDIR", command=DIVISION, bg='black', fg='white', activebackground='dark slate gray', activeforeground='white') Boton4.grid(row=60, column=7, padx=(10,10),pady=(10,10)) Ventana.mainloop()
martes, 17 de abril de 2018
PROGRAMA 1-5: CALCULA SUMA, RESTA, MULTIPLICACION Y DIVISION
PROGRAMA 1: CALCULADORA DE SUMAS, RESTAS, MULTIPLICACIONES Y DIVISIONES
Suscribirse a:
Enviar comentarios (Atom)
FIGURA 3D EN PYTHON
import pygame from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * verticies = ( (1, -1, -1), (1...
-
MAS DE 16 PROGRAMAS HECHOS EN PYTHON | CONTINUANDO CON LA PROGRAMACION EN PYTHON PROGRAMA 1: PROGRAMA QUE DETERMINA SI UN VALOR ES PA...
-
CAPTURA DE LA FIGURA from turtle import * setup(500,400,0,0) screensize(400,350) title("Figura de Canguro") p...
No hay comentarios:
Publicar un comentario