name mangling

This commit is contained in:
cmoreno 2026-10-07 12:43:29 -03:00
parent 4399b67bab
commit ead91ee658
4 changed files with 32 additions and 1 deletions

31
clase_10/programa.py Normal file
View 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()

Binary file not shown.

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB