Is there any way to disable the use of import once I've finished using it? I'm using IronPython as a scripting engine and I don't want users to be able to import anything. This could be done in LuaInterface by the use of setfenv:
luanet.load_assembly("System.Windows.Forms")
luanet.load_assembly("System.Drawing")
Form=luanet.import_type("System.Windows.Forms.Form")
-- Only allow the use of the form class
local env = { Form = _G.Form }
setfenv(1, env)
Or by setting the import functions to nil before parsing the script file:
luanet.load_assembly = nil
luanet.import_type = nil
Is this possible in IronPython?