pythonEngine.Execute(“print __name__”) is exactly
the same as doing pythonEngine.Execute(“print __name__”,
pythonEngine.DefaultModule). The issue is that the name of pythonEngine.DefaultModule
is not “__main__”. Also, it is not published in sys.modules since its
upto the host to determine which modules are published and which are not. So you would need to do the following for it to print “__main__”. bool shouldPublishMainModule; // You get to chose what this
value should be. It should probably be true for “__main__”. EngineModule mainModule = pythonEngine.CreateModule(“__main__”,
shouldPublishMainModule); pythonEngine.Execute(“print __name__”, mainModule) From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dino Viehland We haven’t had any other reports of issues like this so
we’ll need some more details. Are you creating a module named __main__ ? (the console
creates an engine named __main__, but if you’re using the engine directly
we never create a __main__ module for you). How is it not evaluating
properly? Are we thinking we’re in main or not in main? From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jesse Wiles Hi, |
_______________________________________________ users mailing list users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com