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.
This commit is contained in:
PChemGuy
2022-08-20 13:58:51 +03:00
parent 112605f540
commit 8d771a389c

View File

@@ -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)