How to switch IpyStudio to Cpython25

Dec 29, 2007 at 2:27 PM
In DOS cmd line I can put "ipy -X:Python25" which let me use Cpython25 new features. How can I do this in IpyStudio?
Thanks.
Dec 29, 2007 at 3:26 PM
New features in the library? Add a couple of lines:

import sys
sys.path.append("C:\\Python25\\Lib")
Dec 29, 2007 at 4:04 PM
Thanks for your attention. What I want is to code the next:

print a if a else "Nothing"

It is a new feature of Python25 that is active in Ipy 1.1.1 when invoking with the -X:Python25 command option.
Regards.
Jan 21, 2008 at 10:07 PM
Dear Christopher,

Thank you so much for the suggestion. Your information solved my problem.

One thing that I noticed is that I have to include this append statement in every file that needs the extra libraries (in this case, I foresee using the PyEvent class of the IronPython framework in most of my projects). Is there a way to set the sys.path for an entire project or a solution?

Thank you,

Old Hamlet
Feb 19, 2008 at 1:28 PM
Edited Feb 19, 2008 at 4:59 PM

oldhamlet wrote:

One thing that I noticed is that I have to include this append statement in every file that needs the extra libraries (in this case, I foresee using the PyEvent class of the IronPython framework in most of my projects). Is there a way to set the sys.path for an entire project or a solution?

Add the following lines to the site.py folder in C:\IronPython-1.1.1\Lib

import sys
sys.path.append("C:\\Python25\\Lib")

That will globally apply the statement to anything you run with IronPython. I added that to site.py and I've never had to enter it in any source file or interpreter.

EDIT: actually, I take that all back...it isn't working within IronPython Studio, just my ipy console window. Sorry about that.
Apr 6, 2008 at 11:08 PM
Edited Apr 6, 2008 at 11:10 PM

import sys
sys.path.append("C:\\Python25\\Lib")


However, this does not work for dynamic libraries. I am trying to get ctypes to import and I can't because IronPython Studio can't figure out how to import the dynamic library _ctypes. So this is not the end-all-be-all fix for using Python 2.5 in IPS. Full compatibility is still not available.