Convert from "print ..." to "print(...)"
[hooke.git] / hooke / util / quickhull.py
index 1b54165f54a7075e59f5fbda5b5d10ab79767039..39e4274bdc44d625805d16e079902460cec77fcf 100644 (file)
@@ -98,17 +98,17 @@ def points_inside_hull(hull, points):
     return inside
 
 def print_postscript(sample, hull):
     return inside
 
 def print_postscript(sample, hull):
-    print "%!"
-    print "100 500 translate 2 2 scale 0 0 moveto"
-    print "/tick {moveto 0 2 rlineto 0 -4 rlineto 0 2 rlineto"
-    print "              2 0 rlineto -4 0 rlineto 2 0 rlineto} def"
+    print('%!')
+    print('100 500 translate 2 2 scale 0 0 moveto')
+    print('/tick {moveto 0 2 rlineto 0 -4 rlineto 0 2 rlineto')
+    print('              2 0 rlineto -4 0 rlineto 2 0 rlineto} def')
     for (x,y) in sample:
     for (x,y) in sample:
-       print x, y, "tick"
-    print "stroke"
-    print hull[0,0], hull[0,1], "moveto"
+       print('{} {} tick'.format(x, y))
+    print('stroke')
+    print(hull[0,0], hull[0,1], 'moveto')
     for (x,y) in hull[1:]:
     for (x,y) in hull[1:]:
-       print x, y, "lineto"
-    print "closepath stroke showpage"
+       print('{} {} lineto'.format(x, y))
+    print('closepath stroke showpage')
 
 if __name__ == "__main__":
     #sample = 10*array([(x,y) for x in arange(10) for y in arange(10)])
 
 if __name__ == "__main__":
     #sample = 10*array([(x,y) for x in arange(10) for y in arange(10)])