-Original Message-
> From: users-boun...@lists.ironpython.com [mailto:users-
> boun...@lists.ironpython.com] On Behalf Of jhow...@drawloop.com
> Sent: Tuesday, November 17, 2009 2:31 PM
> To: users@lists.ironpython.com
> Subject: Re: [IronPython] Embedded IronPython 2.6 Module
> > the Scope.
>
> > I agree this has gotten worse in 2.6 - I opened a bug a while ago to make
> > working with
> > modules easier
> > -http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=25190.
>
> > > -----Original Message-
> > > From: users-bou
.codeplex.com/WorkItem/View.aspx?WorkItemId=25190.
>
>
>
> > -Original Message-
> > From: users-boun...@lists.ironpython.com [mailto:users-
> > boun...@lists.ironpython.com] On Behalf Of jhow...@drawloop.com
> > Sent: Tuesday, November 17, 2009 2:02 PM
>
users-boun...@lists.ironpython.com [mailto:users-
> boun...@lists.ironpython.com] On Behalf Of jhow...@drawloop.com
> Sent: Tuesday, November 17, 2009 2:02 PM
> To: users@lists.ironpython.com
> Subject: Re: [IronPython] Embedded IronPython 2.6 Module Name
>
> I realize I'm
I realize I'm replying rather late, but I just got to trying this
again. This is something that really should be simple. Anytime a
module is run from the ScriptEngine directly, I would expect the
behavior to be running as "__main__" just as if I was running it from
the command line using "ipy" or
Thanks for the help, Curt. Perhaps it's a problem with the latest, RC?
There is no "CreateModule" function on the PythonContext object.
~Jonathan
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpytho
I'm not sure if there's a simpler way -- here's what I did a few months back
when I needed to publish something via __main__:
pythonContext = HostingHelpers.GetLanguageContext(self._engine)
module = pythonContext.CreateModule()
pythonContext.PublishModule('__main__', module)
scope = HostingHelpers
Looking further into this, it appears that __name__ is always set to
. This is the behavior while trying to just use:
Dictionary options = new Dictionary();
ScriptEngine se = Python.CreateEngine();
Console.WriteLine(se.Execute("__name__"));
~Jonathan
__