Custom IronPython import resolution

前端 未结 4 1233
温柔的废话
温柔的废话 2020-12-09 06:02

I am loading an IronPython script from a database and executing it. This works fine for simple scripts, but imports are a problem. How can I intercept these import calls a

4条回答
  •  情深已故
    2020-12-09 06:48

    You need to implement import hooks. Here's an SO question with pointers: PEP 302 Example: New Import Hooks

提交回复
热议问题