Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python find out contents of compiled module?

So have this Python .pyd module (C++), so I can't just open it in a text editor to find out what it contains. So how can I? I just want to know the function names inside it.

like image 937
razrr Avatar asked Dec 17 '22 09:12

razrr


1 Answers

Python have full reflection.

You can do the following (for a modulename.pyd)

 python
 >>> import modulename as mtmp
 >>> dir(mtmp)
 >>> help(mtmp)

EDIT : Add help command as propose by Mike Graham

like image 154
ykatchou Avatar answered Jan 01 '23 09:01

ykatchou