views:

236

answers:

3

Im looking to play with IronPython and figured that writing unit tests is a simple enough way to get started. This would essentially mean that my core applications code will still be written in C# with just my tests been python.

With this in mind my ideal situation was to develop both the C# and IronPython code from within the same solution in Visual studios. Looking around I see that there is a visual studios editor "IronPythonStudios" that should be right for me, though so far I have hit a few issues:

  1. Importing core python libaries such as "Import os" fail. I believe this is because the path to these common libaries is not set within the IDE and I have no idea how to set it.
  2. I am unable to recognize .pyproj files from visual studios, I believe that my version of IronPythonStudios is running in Isolated mode and not integrated. Any idea how I change this?
  3. It appears that IronPythonStudos is compiling the .py files instead of just interpreting them. This essentailly means that unit testing is as slow as with C#/Vb.net as the test, build then exectue cycle still exists. Any idea how I stop VS/IPS from compiling the files and just get it to just dynamically compile the scripts?

Cheers, Chris.

A: 

In case anyone was wondering, to answer the first part of my question I found that I needed to add a reference to Pythons sys path i.e.

import sys
sys.path.append(r'c:\PathToPythonCommonLibs')

EDIT:

Its also worth noting that I downloaded the isolated and not intergrated IronPython studio distribution which was my first problem.

Owen
A: 

I also have been trying to get IronPython and Visual Studio integrated. You can do it by downloading the Visual Studio SDK and following the steps listed here. The only issue with it is that the integration is built against IPy v 1.x and not 2.*. Don't know how much of help this is to you.

Rohit
A: 

You could use ipy 2.6 and use the pydev plugin and code in eclipse. I'm sorry that I'm asking you to switch your IDE (I know how painful that can sometimes be), but I have used quite a few IDEs including Visual Studio and Eclipse I have discussed this here and I find eclipse to be the best IDE that I've used so far. Also, there is a plugin for C# programming in eclipse, so I would STRRONGLY recommend you switch.

The interesting thing about using the pydev plugin for eclipse is that you will not face the import issues that you described. Also, the compile/interpret problem is also solved.

inspectorG4dget