Created
January 28, 2018 01:06
-
-
Save Fhernd/b2068d8ebc55cd62d09c669ccea08247 to your computer and use it in GitHub Desktop.
Abrir un archivo con un objeto en Python.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pickle | |
class Computador: | |
def __init__(self, marca): | |
self.marca = marca | |
def encender(self): | |
pass | |
def apagar(self): | |
pass | |
def obtener_marca(self): | |
return self.marca | |
archivo = open('computador.pickle', 'rb') | |
laptop = pickle.load(archivo) | |
print(laptop.obtener_marca()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment