I used Zelle's "graphics.py" file. I use Thonny. I want to use function "getMouse() & getMouseNow()", but these messages come up. What should I do ? Help Me !
Code :
from graphics import *
def draw():
win = GraphWin("My Circle", 500, 500)
circle = Circle(Point(150,150), 50)
circle.draw(win)
p = win.getMouse()
x = p.x
y = p.y
circle.moveTo(x,y)
draw()
Output :
Creates a window of above dimensions and a circle in it. After clicking into the window ...
Traceback (most recent call last):
File "C:\Users\Shivam\Documents\Python\Mouse.py", line 13, in <module>
draw()
File "C:\Users\Shivam\Documents\Python\Mouse.py", line 10, in draw
m = Circle.moveTo(x,y)
AttributeError: type object 'Circle' has no attribute 'moveTo'