1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-24 04:22:22 +00:00

ch2-07: 例子完善

This commit is contained in:
chai2010 2018-01-07 02:38:46 +08:00
parent f097efc195
commit 6c1741df63
2 changed files with 12 additions and 0 deletions

View File

@ -3,6 +3,9 @@ default:
gcc -Wall _test_so.c ./say-hello.so
./a.out
run-py3:
python3 hello.py
clean:
-rm *.so
-rm *.out

View File

@ -0,0 +1,9 @@
from ctypes import *
libso = CDLL("./say-hello.so")
SayHello = libso.SayHello
SayHello.argtypes = [c_char_p]
SayHello.restype = None
SayHello(c_char_p(b"hello"))