Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ===========================
- pClass.py
- import useClass
- center = point.Point(0,0)
- point_a = point.Point(1,1)
- print(point_a + " is point a")
- print(center + " is the center")
- ========================================
- useClass.py
- class Point:
- ''' Represent a point in a Euclidian plane '''
- def __init__(self, x_coor, y_coor):
- self.x = x_coor
- self.y = y_coor
- def coordinates(self:
- '''Return a tuple of the x,y coords of a ponit'''
- return (self.x, self.y)
- def move_to(self, x_coor, y_coor):
- '''Assign new coordinates to a ponit '''
- self.x = x_coor
- self.y = y_coor
- Traceback (most recent call last):
- File "useClass.py", line 1, in <module>
- import useClass
- File "/home/mikey/school/useClass.py", line 3, in <module>
- center = useClass.Point(0,0)
- AttributeError: module 'useClass' has no attribute 'Point'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement