From fcb34fdf8414d3833fd9a912b30ba5e8ae3001ad Mon Sep 17 00:00:00 2001 From: fyzaks Date: Thu, 26 Nov 2020 09:15:58 -0600 Subject: [PATCH] Update spiro.py In python 3.9.0 the function gcd is in the math module. --- spirograph/spiro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spirograph/spiro.py b/spirograph/spiro.py index 8894a79..f030d87 100644 --- a/spirograph/spiro.py +++ b/spirograph/spiro.py @@ -14,7 +14,7 @@ import random from PIL import Image from datetime import datetime -from fractions import gcd +#from fractions import gcd # A class that draws a spirograph class Spiro: @@ -46,7 +46,7 @@ def setparams(self, xc, yc, col, R, r, l): self.l = l self.col = col # reduce r/R to smallest form by dividing with GCD - gcdVal = gcd(self.r, self.R) + gcdVal = math.gcd(self.r, self.R) self.nRot = self.r//gcdVal # get ratio of radii self.k = r/float(R)