#################################### # File: Xiang/line0.py # draws one line # Coordinates start in left corner (0,0) from graphics import * def main(): win = GraphWin( "My first graphics program", 300, 300 ) #win.setCoords( 0, 0, 300, 500 ) p1 = Point(20,50) # define points p2 = Point(20,150) linea = Line( p1, p2 ) # same as linea = Line(Point(10,50),Point(10,150)) linea.draw( win ) message = Text( Point(150,275), "Click anywhere to stop!" ) message.draw( win ) win.getMouse() win.close() main()