[IronPython] with_statement in IronPython 2.6 Alpha

Jonathan March JDM at MarchRay.net
Thu May 21 16:12:49 CEST 2009


Why are we discussing the environment variable PYTHONPATH rather than
IRONPYTHONPATH? Does IronPython even look at the former?

On Thu, May 21, 2009 at 9:04 AM, Lepisto, Stephen P <
stephen.p.lepisto at intel.com> wrote:

>  Elise,
>
>
>
> PYTHONPATH is an environment variable and can be set on Windows by going to
> Control Panel à System.  Select the Advanced tab then click on the
> Environment Variables button.  In the lower pane, click the New button and
> enter PYTHONPATH for the Variable name and enter the path or paths you want
> in the Variable value.  Use semi-colons to separate multiple paths.  Click
> OK, click OK, and click OK to exit.
>
>
>
> Note: Visual Studio needs to be closed then reopened for it to recognize
> the new environment variable (this is true for Visual Studio 2005 and
> earlier, I actually haven’t tested Visual Studio 2008 to see if it properly
> responds to a change in environment variables).
>
>
>
> As for adding a reference to an assembly from IronPython, I found good
> success with using AddReference() with sys.path.append() instead of
> AddReferenceToFile().  For example,
>
>
>
> sys.path.append(r"C:\Users\i-ellang\Documents\Infer.NET2.2\bin\Debug")
>
> clr.AddReference("Infer.Compiler")
>
> clr.AddReference("Infer.Runtime")
>
>
>
>
>
> *From:* users-bounces at lists.ironpython.com [mailto:
> users-bounces at lists.ironpython.com] *On Behalf Of *Elise Langham (Elanit)
> *Sent:* Thursday, May 21, 2009 4:23 AM
> *To:* users at lists.ironpython.com
> *Subject:* Re: [IronPython] with_statement in IronPython 2.6 Alpha
>
>
>
> Hi Dave,
>
>                  Thanks for the reply- I’m running in the Visual Studio
> under debug. I don’t know how to set pythonpath on a windows machine
>
> Most of the info is for C shell and linux. I find that the with statement
> works fine when just using the command line ipy.exe but it can’t pick up
>
> The references to imported modules. The references work fine when running
> in Visual Studio though ????
>
>
>
> import System
>
> from System import Console
>
> from System import Array
>
> from System import IO
>
> import clr
>
> import sys
>
> sys.path.append(r"C:\Users\i-ellang\Documents\Infer.NET2.2\bin\Debug")
>
> clr.AddReferenceToFile("Infer.Compiler.dll")
>
> clr.AddReferenceToFile("Infer.Runtime.dll")
>
>
>
> think this only works when the .dlls are in the IronPython ipy.exe
> directory though.
>
>  'C:\\Users\\i-ellang\\IronPython 2.6’
>
>
>
> Hope you can help,
>
>
>
> Elise
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090521/dc1144f3/attachment.html>


More information about the Ironpython-users mailing list