「卸载」 Python 模块和“解除绑定”;相关API
我有一个嵌入 Python 的程序(通过 Boost.Python),并提供“扩展”框架。我希望通过允许扩展为其 API 加载一组 Python 绑定来统一这两部分,但是我很困惑如何在卸载插件时“取消注册”这些 API。
这对于 Python 和 Boost.Python 来说是可能的吗?我知道 Lua 和 LuaBind 是不可能的,因为文档表明不可能“解除绑定”API。
很抱歉这个问题写得不好,现在是凌晨 2:30,我已经研究了一段时间了。 ;)
I have a program which embeds Python (via Boost.Python), and provides an 'extension' framework. I wish to unify these two parts by allowing extensions to load a set of Python bindings for their API, however I'm confused as to how I would I 'unregister' these APIs when the plugin is unloaded.
Is this even possible with Python and Boost.Python? I know it's not possible with Lua and LuaBind, as the documentation indicates it's impossible to 'unbind' an API.
Sorry for how poorly this question is written, it's 2:30 AM here and I've been at it a while. ;)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一个关于卸载/重新加载 python 模块的相关讨论。查看第三个答案(此处),其开头为:
There is a related discussion about unloading/reloading python modules. Check out the 3rd answer (here), the one that starts off with: