From 8d771a389cb4b8234b37d6f0709b9d6f135faf18 Mon Sep 17 00:00:00 2001 From: PChemGuy <39730837+pchemguy@users.noreply.github.com> Date: Sat, 20 Aug 2022 13:58:51 +0300 Subject: [PATCH] py3: use six.moves.range instead of xrange The xrange module was removed in Python 3 and we should use 'six.moves.range' instead of 'xrange' to make code compatible with py 2 and 3 as well. --- samples/floatcanvas/DrawBot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/floatcanvas/DrawBot.py b/samples/floatcanvas/DrawBot.py index 581aefb2..52ea41e0 100644 --- a/samples/floatcanvas/DrawBot.py +++ b/samples/floatcanvas/DrawBot.py @@ -14,6 +14,7 @@ I think it's easier with FloatCavnas, and you get zoomign and scrolling to boot! """ import wx +from six import moves from math import * try: # see if there is a local FloatCanvas to use @@ -53,7 +54,7 @@ class DrawFrame(wx.Frame): Canvas = self.Canvas phi = (sqrt(5) + 1)/2 - 1 oradius = 10.0 - for i in xrange(720): + for i in moves.xrange(720): radius = 1.5 * oradius * sin(i * pi/720) Color = (255*(i / 720.), 255*( i / 720.), 255 * 0.25) x = oradius + 0.25*i*cos(phi*i*2*pi)