Contents

  1. graphics_test.py
  2. int_input.py

graphics_test.py 1/2

[
top][prev][next]
# Graphics Test Script
# by Sara Sprenkle

from graphics import *

win = GraphWin("My Circle", 200, 200)
point = Point(100,100)
c = Circle(point, 10)
c.draw(win)

#c.setOutline(color_rgb(200, 0, 200)) #give the circle a pretty fucshia outline

# demonstrate what happens, outside of IDLE, if the line below is commented out.
win.getMouse()
win.close()


int_input.py 2/2

[
top][prev][next]
# Requiring an integer as input.
# by Sara Sprenkle

str_age = input("Enter your age: ")
age = int(str_age)

# this will throw an exception if the str_age is not an int.
# We don't know how to handle exceptions yet.

Generated by GNU Enscript 1.6.6.