python 3 compatibility for examples/*.py files

add from __future__ import
print statement -> print() function
xrange -> range
map() -> list(map())
range() -> list(range())
StandardError -> Exception
This commit is contained in:
danielque
2023-08-10 13:25:36 +02:00
parent 597e606bde
commit 539fd060c2
35 changed files with 106 additions and 88 deletions

View File

@ -2,6 +2,8 @@
# requires files/dump.kinase
# creates tmp*.png
from __future__ import absolute_import
d = dump("files/dump.kinase")
g = gl(d)
@ -17,7 +19,7 @@ g.all()
from vizinfo import colors
g.acol([1,4,6,8,9],["gray","red","blue","green","yellow"])
g.arad(range(9),0.3)
g.arad(list(range(9)),0.3)
#g.label(0.2,0.4,'h',15,"red","test label #1")
#g.label(-0.2,-0.4,'h',15,"yellow","test label #2")
@ -25,4 +27,4 @@ g.show(0)
g.pan(60,130,1,60,30,0.5)
g.all(0,10,0)
print "all done ... type CTRL-D to exit Pizza.py"
print("all done ... type CTRL-D to exit Pizza.py")