name mangling
This commit is contained in:
parent
4399b67bab
commit
ead91ee658
31
clase_10/programa.py
Normal file
31
clase_10/programa.py
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
from tkinter import *
|
||||||
|
|
||||||
|
def guardar():
|
||||||
|
print("Se presiono el boton")
|
||||||
|
print(entrada.get())
|
||||||
|
|
||||||
|
ventana= Tk()
|
||||||
|
ventana.geometry("800x500")
|
||||||
|
ventana.title("Mi primer Programa")
|
||||||
|
ventana.resizable(0,0)
|
||||||
|
|
||||||
|
etiqueta= Label(
|
||||||
|
ventana,
|
||||||
|
text="Registro alumno"
|
||||||
|
)
|
||||||
|
etiqueta.pack()
|
||||||
|
|
||||||
|
entrada= Entry(
|
||||||
|
ventana
|
||||||
|
)
|
||||||
|
entrada.pack()
|
||||||
|
|
||||||
|
boton = Button(
|
||||||
|
ventana,
|
||||||
|
text="Guardar",
|
||||||
|
background="RED",
|
||||||
|
command=guardar
|
||||||
|
|
||||||
|
)
|
||||||
|
boton.pack()
|
||||||
|
ventana.mainloop()
|
||||||
BIN
clase_10/tabla_propiedades_widgets_tkinter.pdf
Normal file
BIN
clase_10/tabla_propiedades_widgets_tkinter.pdf
Normal file
Binary file not shown.
|
|
@ -2,7 +2,7 @@ class Persona:
|
||||||
|
|
||||||
def __init__(self, nombre, edad):
|
def __init__(self, nombre, edad):
|
||||||
self.nombre = nombre
|
self.nombre = nombre
|
||||||
self.__edad = edad #oculto el verdadero nombre del atributo
|
self.__edad = edad #name Mangling
|
||||||
|
|
||||||
def getEdad(self):
|
def getEdad(self):
|
||||||
return self.__edad
|
return self.__edad
|
||||||
|
|
|
||||||
BIN
orientaciones.png
Normal file
BIN
orientaciones.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Loading…
Reference in New Issue
Block a user