# firstGraphics.py # Neal Nelson 2008.11.17 # Copied from Zelle pp126-129 # Make sure the graphics.py module is in your current folder from graphics import * def main(): # Create a default size graphics window of size 200x200 pixels win= GraphWin() # Draw a line from (0,0) to (199,199) the "origin" and the maximum x-y point # Notice that (0,0) is in the upper left!! (boo). line = Line(Point(0,0), Point(199,199)) line.draw(win) # Draw a red circle with center at (100,100) and radius 30 pixels center = Point(100,100) circ = Circle(center,30) circ.setFill('red') circ.draw(win) # Hold window open #raw_input("Press to quit.") #win.close() # A better click-to-close technique text = Text(Point(100,180), 'Click to close') text.draw(win) win.getMouse() win.close() main()