Advertisement
teslariu

form_tkinter

Mar 10th, 2021
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.38 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. import tkinter as tk
  5. from tkinter import ttk
  6.  
  7. ventana = tk.Tk()
  8. ventana.title("FORMULARIO")
  9. ventana.config(width=400, height=600)
  10.  
  11. def guardar():
  12.     nombre = nom.get()
  13.     correo = email.get()
  14.     nacionalidad = nac.get()
  15.     telefono = tel.get()
  16.     datos = [nombre, correo, nacionalidad, telefono]
  17.     for dato in datos:
  18.         print(dato)
  19.  
  20. etiqueta = ttk.Label(text="INGRESE SUS DATOS")
  21. etiqueta.place(x=150, y=10)
  22.  
  23.  
  24.  
  25. ########### campo NOMBRE #################
  26. etiqueta = ttk.Label(text="Nombre y apellido")
  27. etiqueta.place(x=20, y=50)
  28.  
  29. nom = ttk.Entry()
  30. nom.place(x=150,y=50, width=150, height=30)
  31.  
  32. ########### campo EMAIL #################
  33. etiqueta = ttk.Label(text="email")
  34. etiqueta.place(x=20, y=100)
  35.  
  36. email = ttk.Entry()
  37. email.place(x=150,y=100, width=150, height=30)
  38.  
  39. ########### campo NACIONALIDAD #################
  40. etiqueta = ttk.Label(text="Nacionalidad")
  41. etiqueta.place(x=20, y=150)
  42.  
  43. nac = ttk.Entry()
  44. nac.place(x=150,y=150, width=150, height=30)
  45.  
  46. ########### campo TELEFONO #################
  47. etiqueta = ttk.Label(text="Nro de teléfono")
  48. etiqueta.place(x=20, y=200)
  49.  
  50. tel = ttk.Entry()
  51. tel.place(x=150,y=200, width=150, height=30)
  52.  
  53.  ##############    BOTONES   ################
  54. boton = ttk.Button(text="ENVIAR", command=guardar)
  55. boton.place(x=170, y=250, width=120, height=35)
  56.  
  57.  
  58. ventana.mainloop()
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement