Python找出编译模块的内容? [英] Python find out contents of compiled module?

查看:79
本文介绍了Python找出编译模块的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以有了这个 Python .pyd 模块 (C++),所以我不能只是在文本编辑器中打开它来找出它包含的内容.那我该怎么办?我只想知道里面的函数名.

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.

推荐答案

Python 有全反射.

Python have full reflection.

您可以执行以下操作(对于 modulename.pyd)

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

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

EDIT:按照 Mike Graham 的建议添加帮助命令

EDIT : Add help command as propose by Mike Graham

这篇关于Python找出编译模块的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆