I need the function to display a set of eyes, so if i call the function
Eyes(3,4) a graphics window opens with exact dimesions for 4 coloumns and 2 rows of eyes...

``````from graphics import *
circle.setFill(colour)
circle.setWidth(2)
circle.draw(win)

def drawEye():
w = 250
h = 250
win = GraphWin(" Eye", w, h)
# center should be at 1/2 width and height
centre = Point(w//2, h//2)
drawCircle(win, centre, 40, "white")
drawCircle(win, centre, 20, "blue")
drawCircle(win, centre, 10, "black")
# click mouse to go on
win.getMouse()
win.close()

drawEye()

def Eyes(rows, columns):
for i in range( rows ):
print colums * draweye
Eyes()``````

Edited by gangster88: n/a

4
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by battlecrab

Can you please be more clear, from what I understand you want 8 eyes total to be printed out on the screen, but with the radius size of 40 you have, all there is room for is a single eye before overlap.

Can you please be more clear, from what I understand you want 8 eyes total to be printed out on the screen, but with the radius size of 40 you have, all there is room for is a single eye before overlap.

...

Edited by jaison2: n/a

Can you please be more clear, from what I understand you want 8 eyes total to be printed out on the screen, but with the radius size of 40 you have, all there is room for is a single eye before overlap.

well thts wht i need help with, the window should automatically change according to the number of eyes requested?

``````from graphics import *

def drawCircle(win, centre, radius, colour, color):
circle.setFill(colour)
circle.setOutline(color)
circle.draw(win)

# center should be at half width and height

def Eyes(rows, columns):
width = rows*diameter+1
height = columns*diameter+1
win = GraphWin("", width, height )
for x in range( rows ):
for y in range( columns ):
xPosition = radius + 2 + diameter * x
yPosition = radius + 2 + diameter * y
center = Point( xPosition, yPosition )