Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- #import math as m
- # raiz = m.sqrt(23)
- #print(raiz))
- import tkinter as tk
- def clic():
- datos = []
- datos.append(caja_nombre.get())
- datos.append(caja_apellido.get())
- datos.append(caja_mail.get())
- datos.append(caja_tel.get())
- datos.append(caja_dir.get())
- datos.append(caja_nac.get())
- print("Se han guardado los datos:")
- for dato in datos:
- print(dato, end= " ")
- ventana = tk.Tk()
- ventana.config(width=400, height=350, bg="cadet blue")
- ventana.title("FORMULARIO")
- ventana.resizable(0,0)
- ################## FORMULARIO ########################
- #### campo nombre #####
- caja_nombre = tk.Entry()
- caja_nombre.place(x=120, y=20, width=200, height=25)
- etiqueta = tk.Label(text="Nombre", bg="cadet blue")
- etiqueta.place(x=20, y=20)
- #### campo apellido #####
- caja_apellido = tk.Entry()
- caja_apellido.place(x=120, y=60, width=200, height=25)
- etiqueta = tk.Label(text="Apellido", bg="cadet blue")
- etiqueta.place(x=20, y=60)
- #### campo mail #####
- caja_mail = tk.Entry()
- caja_mail.place(x=120, y=110, width=200, height=25)
- etiqueta = tk.Label(text="email", bg="cadet blue")
- etiqueta.place(x=20, y=110)
- #### campo telefono #####
- caja_tel = tk.Entry()
- caja_tel.place(x=120, y=160, width=200, height=25)
- etiqueta = tk.Label(text="Teléfono", bg="cadet blue")
- etiqueta.place(x=20, y=160)
- #### campo direccion #####
- caja_dir = tk.Entry()
- caja_dir.place(x=120, y=210, width=200, height=25)
- etiqueta = tk.Label(text="Dirección", bg="cadet blue")
- etiqueta.place(x=20, y=210)
- #### campo nacionalidad #####
- caja_nac = tk.Entry()
- caja_nac.place(x=120, y=260, width=200, height=25)
- etiqueta = tk.Label(text="Nacionalidad", bg="cadet blue")
- etiqueta.place(x=20, y=260)
- #### Botón del formulario
- boton = tk.Button(text="GUARDAR", command=clic)
- boton.place(x=180, y=300, width=80, height=35)
- ventana.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement