mirror of
https://notabug.org/scuti/lib3ddevil1
synced 2024-11-22 05:42:59 +05:30
Merge branch 'python/importing' of scuti/lib3ddevil1 into python/finalize
This commit is contained in:
commit
0c86779304
@ -1,11 +1,18 @@
|
|||||||
import ctypes
|
import ctypes, os, sys
|
||||||
|
|
||||||
sharedlib = './lib3ddevil1.so'
|
def loadlibc():
|
||||||
try:
|
sharedlib = './lib3ddevil1.so'
|
||||||
libc = ctypes.cdll.LoadLibrary(sharedlib)
|
libc = None
|
||||||
except OSError as e:
|
os.environ['PATH'] = os.path.abspath(
|
||||||
print("Error loading dynamically linked library.\nOSError: " + str(e))
|
os.path.join(
|
||||||
raise SystemExit("Couldn't load %s" % sharedlib)
|
os.path.dirname(__file__), "../")) \
|
||||||
|
+ ';' \
|
||||||
|
+ os.environ['PATH']
|
||||||
|
try:
|
||||||
|
libc = ctypes.cdll.LoadLibrary(sharedlib)
|
||||||
|
except OSError as e:
|
||||||
|
print("Error loading dynamically linked library.\nOSError: " + str(e))
|
||||||
|
raise SystemExit("Couldn't load %s" % sharedlib)
|
||||||
|
return libc
|
||||||
|
|
||||||
# Don't need these anymore
|
libc = loadlibc()
|
||||||
del sharedlib
|
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
import ctypes
|
import ctypes
|
||||||
from __init__ import libc
|
import os, sys
|
||||||
|
sys.path.append(
|
||||||
|
os.path.abspath(
|
||||||
|
os.path.join(
|
||||||
|
os.path.dirname(__file__), "../../")))
|
||||||
|
from lib3ddevil1.bindings import libc
|
||||||
|
del os, sys
|
||||||
|
|
||||||
#--------------------------------------+
|
#--------------------------------------+
|
||||||
# Basic Struct
|
# Basic Struct
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
import ctypes
|
import ctypes
|
||||||
from __init__ import libc
|
import os, sys
|
||||||
|
# This is the folder containing the whole library.
|
||||||
|
sys.path.append(
|
||||||
|
os.path.abspath(
|
||||||
|
os.path.join(
|
||||||
|
os.path.dirname(__file__), "../../")))
|
||||||
|
from lib3ddevil1.bindings import libc
|
||||||
|
del os, sys
|
||||||
|
|
||||||
#--------------------------------------+
|
#--------------------------------------+
|
||||||
# Basic Struct
|
# Basic Struct
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
import ctypes
|
import ctypes
|
||||||
from __init__ import libc
|
import os, sys
|
||||||
|
sys.path.append(
|
||||||
|
os.path.abspath(
|
||||||
|
os.path.join(
|
||||||
|
os.path.dirname(__file__), "../../")))
|
||||||
|
from lib3ddevil1.bindings import libc
|
||||||
|
del os, sys
|
||||||
|
|
||||||
#--------------------------------------+
|
#--------------------------------------+
|
||||||
# Basic Struct
|
# Basic Struct
|
||||||
|
Loading…
Reference in New Issue
Block a user