Skip to content

Commit

Permalink
better docs
Browse files Browse the repository at this point in the history
  • Loading branch information
FirefoxMetzger committed Jul 24, 2022
1 parent aafd986 commit 6f4d1f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ build/

*.egg-info
poetry.lock
*.pyd
*.pyd
*.dll
*.so
3 changes: 3 additions & 0 deletions shared_library/extension/hello_world.py
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

0 comments on commit 6f4d1f2

Please sign in to comment.