Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Example:
- def __init__(self, x, y):
- self.x = x
- self.y = y
- def plus(self, x):
- self.x+=x
- @property
- def x(self):
- return self.x
- @property
- def y(self):
- return self.y
- def minus(self, x):
- self.x -= x
- @property
- def distance(self):
- return ((self.x**2)+(self.y**2)) ** 0.5
- import pickle
- f = open('путь_к_файлу_obj.txt', 'r')
- zz = pickle.load(f)
- print zz.distance, zz.x
- f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement