开发者

Need to clear import/module path for python interpreter

I need a unix terminal command that will boot a python interpreter without giving it access to import anything. I am aware that you can import os, and then change that path, but this would be counter productive, so I need to do it either on Python startup, or without importing anything in the python interprete开发者_运维知识库r.


Python does not have robust support for running untrusted code, but for a reasonable approximation, you can try this blog post. A more robust alternative would be to use Lua, JavaScript or TCL, all of which are carefully designed to run untrusted code in a crafted sandbox environment.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜