diff python/pydc/examples/atoi.py @ 28:edbbd467f50a

python binding: - update to dyncall 1.1 - Python 3 support (supports both, Python 2 and 3) - using the Capsule API over PyCObject, when available - support for python unicode strings (for both, Python 2 and 3) - doc cleanup ruby binding: - doc cleanup
author Tassilo Philipp
date Tue, 07 Apr 2020 21:16:37 +0200
parents bf5625bb6f05
children a2125195b052
line wrap: on
line diff
--- a/python/pydc/examples/atoi.py	Sun Jan 12 12:10:38 2020 +0100
+++ b/python/pydc/examples/atoi.py	Tue Apr 07 21:16:37 2020 +0200
@@ -7,7 +7,8 @@
 elif sys.platform == "darwin":
   libc = load("/usr/lib/libc.dylib")
 elif "bsd" in sys.platform:
-  libc = load("/usr/lib/libc.so")
+  #libc = load("/usr/lib/libc.so")
+  libc = load("/lib/libc.so.7")
 elif platform.architecture()[0] == "64bit":
   libc = load("/lib64/libc.so.6")
 else:
@@ -18,9 +19,9 @@
 
 
 
-def atoi(s): return call(fp_atoi,"p)i",s)
-def atod(s): return call(fp_atof,"p)d",s)
+def atoi(s): return call(fp_atoi,"Z)i",s)
+def atod(s): return call(fp_atof,"Z)d",s)
 
-print atoi( "3".join(["12","45"]) )
-print atod( "3".join(["12","45"]) )
+print(atoi("3".join(["12","45"])))
+print(atod("3".join(["12","45"])))