Bonjour je travaille sur penrose avec python et il m'a été demandé de modifier différents paramètres et je ne vois pas comment modifier ou ajouter de nouvelles choses à mon programme , le voici =

import math
import cmath
import cairo
import Image, ImageTk
import Tkinter as Tk


#------ Configuration --------
IMAGE_SIZE = (1000, 1000)
NUM_SUBDIVISIONS = 4
#-----------------------------

### on définit le nombre d'or
goldenRatio = (1 + math.sqrt(5)) / 2

## on définit une fonction "subdiviser" pour les triangles bleu (1) et les triangles rouges(0), les nouveaux triangles seront envoyés dans la liste
def subdivide(triangles):
result = []
for color, A, B, C in triangles:
if color == 0:
# Subdivide red triangle
P = A + (B - A) / goldenRatio
result += [(0, C, P, B), (1, P, C, A)]
else:
# Subdivide blue triangle
Q = B + (A - B) / goldenRatio
R = B + (C - B) / goldenRatio
result += [(1, R, C, A), (1, Q, R, B), (0, R, Q, A)]
return result

# Create wheel of blue triangles around the origin
cos36=0.25*(1.+math.sqrt(5)) ## on remplace l'écriture cos36 par sa valeur mathématique
lAB=0.5/cos36 ## on définit la longueur du segment AB
triangles = []
for i in xrange(5):
C = cmath.rect(1, (2*i) *2.* math.pi / 10)
A = cmath.rect(lAB, (2*i + 1) * 2.* math.pi / 10)
triangles.append(( 1,A, 0j, C))

for i in xrange(5):
C = cmath.rect(1, (2*i) *2.* math.pi / 10)
A = cmath.rect(lAB, (2*i - 1) * 2.* math.pi / 10)
triangles.append(( 1,A, 0j, C))


# Prepare cairo surface and Perform subdivisions

for i in xrange(NUM_SUBDIVISIONS):

triangles = subdivide(triangles)

surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, IMAGE_SIZE[0], IMAGE_SIZE[1])
cr = cairo.Context(surface)
cr.translate(IMAGE_SIZE[0] / 2.0, IMAGE_SIZE[1] / 2.0)
wheelRadius = 0.5 * math.sqrt((IMAGE_SIZE[0] / 2.0) ** 2 + (IMAGE_SIZE[1] / 2.0) ** 2)
cr.scale(wheelRadius, wheelRadius)

# Draw red triangles
for color, A, B, C in triangles:
if color == 0:
cr.move_to(A.real, A.imag)
cr.line_to(B.real, B.imag)
cr.line_to(C.real, C.imag)
cr.close_path()
cr.set_source_rgb(1.0, 0.35, 0.35)
cr.fill()

# Draw blue triangles
for color, A, B, C in triangles:
if color == 1:
cr.move_to(A.real, A.imag)
cr.line_to(B.real, B.imag)
cr.line_to(C.real, C.imag)
cr.close_path()
cr.set_source_rgb(0.4, 0.4, 1.0)
cr.fill()

# Determine line width from size of first triangle
color, A, B, C = triangles[0]
cr.set_line_width(abs(B - A) / 10.0)
cr.set_line_join(cairo.LINE_JOIN_ROUND)

# Draw outlines
for color, A, B, C in triangles:
cr.move_to(C.real, C.imag)
cr.line_to(A.real, A.imag)
cr.line_to(B.real, B.imag)
cr.set_source_rgb(0.2, 0.2, 0.2)
cr.stroke()

# Save to PNG
surface.write_to_png('penrose'+str(i)+'.png')

# Transformer en jpg

im= Image.open('penrose'+str(i)+'.png')
im.save("penrose"+str(i)+".jpg")

# Afficher les image une après fermeture de la précédente

root = Tk.Tk()

image = Image.open('penrose'+str(i)+'.jpg')
photo = ImageTk.PhotoImage(image)

label = Tk.Label(image=photo)
label.image = photo
label.pack()

root.mainloop()