chiark / gitweb /
Update the Python example for py3k compatibility
authorJulien Schueller <schueller@phimeca.com>
Sun, 27 Aug 2017 11:34:49 +0000 (13:34 +0200)
committerJulien Schueller <schueller@phimeca.com>
Sun, 27 Aug 2017 11:34:49 +0000 (13:34 +0200)
doc/docs/NLopt_Tutorial.md

index 9d07827cd5a6355149f7af9aed11c5bb4905ed94..faf9d1bb933624f94630f9830ba6cdd3d0453431 100644 (file)
@@ -447,9 +447,9 @@ opt.add_inequality_constraint(lambda x,grad: myconstraint(x,grad,-1,1), 1e-8)
 opt.set_xtol_rel(1e-4)
 x = opt.optimize([1.234, 5.678])
 minf = opt.last_optimum_value()
-print "optimum at ", x[0],x[1]
-print "minimum value = ", minf
-print "result code = ", opt.last_optimize_result()
+print("optimum at ", x[0], x[1])
+print("minimum value = ", minf)
+print("result code = ", opt.last_optimize_result())
 ```