Moved out repeated code to __init__ & .so loaded once only

This commit is contained in:
_
2018-05-15 15:04:53 -07:00
parent d8e1c45156
commit 2c44adf7a2
5 changed files with 27 additions and 32 deletions

View File

@@ -0,0 +1,13 @@
import sys, ctypes
sharedlib = './lib3ddevil1.so'
libc = ctypes.cdll.LoadLibrary(sharedlib)
if not libc:
print("Couldn't load %s" % sharedlib)
sys.exit()
# Observe how many times the .so is loaded.
print("\nlib3ddevil1 loaded.")
# Don't need these anymore
del sys, sharedlib