-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aafd986
commit 6f4d1f2
Showing
2 changed files
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,6 @@ build/ | |
|
||
*.egg-info | ||
poetry.lock | ||
*.pyd | ||
*.pyd | ||
*.dll | ||
*.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
from ctypes import cdll, c_char_p | ||
from pathlib import Path | ||
|
||
# load the library using ctypes | ||
library_location = Path(__file__).parent.absolute() / "lib" / "hello_library" | ||
lib_shared_hello = cdll.LoadLibrary(library_location.as_posix()) | ||
|
||
# expose the hello function as hello_world in python | ||
# Note: returns a bytes object, not a python string | ||
hello_world = lib_shared_hello.hello | ||
hello_world.restype = c_char_p |