Say I write a libx.so, it contains 3 functions,
void bar();
void foo();
void spam();
Then I use ctypes to access it,
>>>libx = ctypes.CDLL("./libx.so")
>>>dir(libx)
...
But how can I know how many functions libx.so exports and what are they?
You can use
nm libx.soon the shell to view the symbols exported by the library.However, reading its docs/header file is usually a much better idea – the symbol list will not give you any information about the arguments and return values of the functions.