#!/usr/bin/python # -*- coding: utf-8 -*- """ Ejemplo de Clase de Altas, Bajas y Cambios :author: ACL :version: 0.1 """ from Producto import Producto class Televisor(Producto): """Definicion de la clase Televisor""" def __init__(self): """Constructor de la clase Televisor""" Producto.__init__(self) self.__pulg = None self.__resol = None def inicializa(self, id, nomb, precio, cant, pulg, resol): """Inicializa la clase Televisor""" Producto.inicializa(self, id, nomb, precio, cant) self.__pulg = pulg self.__resol = resol def captura(self): """Captura la clase Televisor""" Producto.captura(self) self.__pulg = int(input("Pulgadas: ")) self.__resol = input("Resolucion: ") def __repr__(self): """Visualiza la clase Televisor""" a = Producto.__repr__(self) a += "Pulgadas: {0}\n".format(self.__pulg) a += "Resolucion: {0}\n".format(self.__resol) return a """ Prueba de las clases """ if __name__ == "__main__": a = Televisor() a.captura() print(a)