Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #471 from ed359/master
Browse files Browse the repository at this point in the history
notebook.interact.py: xrange -> range for python3
  • Loading branch information
dimpase authored Sep 10, 2019
2 parents d5622b9 + 1d35a0b commit 7626a4e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sagenb/notebook/interact.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
import types
import collections
from base64 import standard_b64decode
from six.moves import range

# Sage libraries
from sagenb.misc.misc import sage_eval, Color, is_Matrix
Expand Down Expand Up @@ -1182,7 +1183,7 @@ def __init__(self, var, rows, columns, default_value=None, label=None,
if type(default_value) != list:
default_value = [[default_value for _ in range(columns)] for _ in range(rows)]
elif not all(type(elt) == list for elt in default_value):
default_value = [[default_value[i * columns + j] for j in xrange(columns)] for i in xrange(rows)]
default_value = [[default_value[i * columns + j] for j in range(columns)] for i in range(rows)]

self.__default_value_grid = default_value

Expand Down Expand Up @@ -2550,7 +2551,7 @@ def interact(f, layout=None, width='800px'):
A random polygon::
sage: pts = [(random(), random()) for _ in xrange(20)]
sage: pts = [(random(), random()) for _ in range(20)]
sage: @interact
....: def _(n = (4..len(pts)), c=Color('purple') ):
....: G = points(pts[:n],pointsize=60) + polygon(pts[:n], rgbcolor=c)
Expand Down Expand Up @@ -2607,7 +2608,7 @@ def interact(f, layout=None, width='800px'):
....: def _(n=(500,(100,5000,1)), p=(1,(0.1,10))):
....: n = int(n)
....: if n not in data:
....: data[n] = [(random(), random()) for _ in xrange(n)]
....: data[n] = [(random(), random()) for _ in range(n)]
....: show(points([(x^p,y^p) for x,y in data[n]], rgbcolor='black'), xmin=0, ymin=0, axes=False)
<html>...
Expand Down

0 comments on commit 7626a4e

Please sign in to comment.