pymain.py:

Install Python:

sudo apt-get install python
Run:
python ./pymain.py
# Example adapted from https://en.wikipedia.org/wiki/Dynamic-link_library#Python

import ctypes
 
my_dll = ctypes.cdll.LoadLibrary("./libhello.so")
 
# The following "restype" method specification is needed to make
# Python understand what type is returned by the function.
my_dll.add.restype = ctypes.c_int
 
p = my_dll.add(ctypes.c_int(5), ctypes.c_int(10))
 
print "The result is:", p

my_dll.printme(ctypes.c_char_p("Hello from Python!"))
Output:
The result is: 15
Hello from library: Hello from Python!