Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- import tkinter as tk
- from tkinter import ttk
- ventana = tk.Tk()
- ventana.title("FORMULARIO")
- ventana.config(width=400, height=600)
- def guardar():
- nombre = nom.get()
- correo = email.get()
- nacionalidad = nac.get()
- telefono = tel.get()
- datos = [nombre, correo, nacionalidad, telefono]
- for dato in datos:
- print(dato)
- etiqueta = ttk.Label(text="INGRESE SUS DATOS")
- etiqueta.place(x=150, y=10)
- ########### campo NOMBRE #################
- etiqueta = ttk.Label(text="Nombre y apellido")
- etiqueta.place(x=20, y=50)
- nom = ttk.Entry()
- nom.place(x=150,y=50, width=150, height=30)
- ########### campo EMAIL #################
- etiqueta = ttk.Label(text="email")
- etiqueta.place(x=20, y=100)
- email = ttk.Entry()
- email.place(x=150,y=100, width=150, height=30)
- ########### campo NACIONALIDAD #################
- etiqueta = ttk.Label(text="Nacionalidad")
- etiqueta.place(x=20, y=150)
- nac = ttk.Entry()
- nac.place(x=150,y=150, width=150, height=30)
- ########### campo TELEFONO #################
- etiqueta = ttk.Label(text="Nro de teléfono")
- etiqueta.place(x=20, y=200)
- tel = ttk.Entry()
- tel.place(x=150,y=200, width=150, height=30)
- ############## BOTONES ################
- boton = ttk.Button(text="ENVIAR", command=guardar)
- boton.place(x=170, y=250, width=120, height=35)
- ventana.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement