summaryrefslogtreecommitdiff
path: root/Examples/python/funcptr2
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2020-08-15 16:46:01 +0100
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2020-08-15 16:46:01 +0100
commit89bee6a7fa2236da8f10bf200abdc4892d4085b8 (patch)
treeb4a6efa27ad38a2e7146a91b6832b80631c0c677 /Examples/python/funcptr2
parent2af35cb4ff80f352aa2f8f2b02bfd31000db4188 (diff)
downloadswig-89bee6a7fa2236da8f10bf200abdc4892d4085b8.tar.gz
Modify examples to be both Python 2 and 3 compatible
For removing dependency on 2to3
Diffstat (limited to 'Examples/python/funcptr2')
-rw-r--r--Examples/python/funcptr2/runme.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/Examples/python/funcptr2/runme.py b/Examples/python/funcptr2/runme.py
index a4405d9d9..afa2e2db6 100644
--- a/Examples/python/funcptr2/runme.py
+++ b/Examples/python/funcptr2/runme.py
@@ -7,18 +7,18 @@ b = 42
# Now call our C function with a bunch of callbacks
-print "Trying some C callback functions"
-print " a =", a
-print " b =", b
-print " ADD(a,b) =", example.do_op(a, b, example.ADD)
-print " SUB(a,b) =", example.do_op(a, b, example.SUB)
-print " MUL(a,b) =", example.do_op(a, b, example.MUL)
+print("Trying some C callback functions")
+print(" a = %s" % a)
+print(" b = %s" % b)
+print(" ADD(a,b) = %s" % example.do_op(a, b, example.ADD))
+print(" SUB(a,b) = %s" % example.do_op(a, b, example.SUB))
+print(" MUL(a,b) = %s" % example.do_op(a, b, example.MUL))
-print "Here is what the C callback function objects look like in Python"
-print " ADD =", example.ADD
-print " SUB =", example.SUB
-print " MUL =", example.MUL
+print("Here is what the C callback function objects look like in Python")
+print(" ADD = %s" % example.ADD)
+print(" SUB = %s" % example.SUB)
+print(" MUL = %s" % example.MUL)
-print "Call the functions directly..."
-print " add(a,b) =", example.add(a, b)
-print " sub(a,b) =", example.sub(a, b)
+print("Call the functions directly...")
+print(" add(a,b) = %s" % example.add(a, b))
+print(" sub(a,b) = %s" % example.sub(a, b))