Commits

Maciej Fijalkowski committed 7f37037

exampple args

Comments (0)

Files changed (1)

pypyembed/embed.py

 
 from ctypes import py_object, addressof, CDLL, c_long, c_char_p, c_int,\
      POINTER, cast, c_char
-import inspect, numpy, os
+import inspect, numpy, os, sys
 
 dirpath = os.path.abspath(os.path.dirname(__file__))
-pypy = CDLL(os.path.join(dirpath, 'libpypy-c.so'))
+if len(sys.argv) > 1:
+    so_path = sys.argv[1]
+else:
+    so_path = os.path.join(dirpath, 'libpypy-c.so')
+
+pypy = CDLL(so_path)
 pypy_main_startup = pypy.pypy_main_startup
 pypy_main_startup.argtypes = (c_int, c_char_p * 3)
 pypy_main_startup.restype = c_int