new to python(3.4.1) gui and can't fix this error...help?
import graphics from graphics import*
def house(): win=GraphWin(800,500) win.setCoords(0.0,0.0,3.0,4.0)#reset coordinates Text(Point(1.5,3.5),"click spot to designate 2 corners of house").draw(win) p1=win.getMouse() side1=(Point(p1.getX(),(p1.getY()))) side1.draw(win) p2=win.getMouse().draw(win) side2=(Point(p2.getX(),(p2.getY()))) side2.draw Rectangle=Rectangle(side1,side2).draw(win) house = ((side2.getX()-(side1.getX))).draw(win) return house house()
=ERROR<--------------------------------------------------------------------------------<
Traceback (most recent call last): File "E:/ICS 140/ass 8.py", line 28, in house() File "E:/ICS 140/ass 8.py", line 21, in house side2=(Point(p2.getX(),(p2.getY()))) AttributeError: 'NoneType' object has no attribute 'getX'
Aucun commentaire:
Enregistrer un commentaire