Pages

Python and .NET

I was asked to explore using Python with .NET. Here are three possibilities.

Configuration A – Plain IronPython
This is the most straightforward and plain vanilla installation.
Download IronPython-1.1.1-Bin.zip (975KB) from http://www.codeplex.com/IronPython.
Unzip the files into a folder, say C:\IronPython-1.1.1 and set the PATH. Voila!
Type ipy helloworld.py or ipyw helloworld.py

Configuration B – IronPython Studio
IronPython Studio is based on the Visual Studio 2008 Shell runtime (royalty free) and can be installed without requiring any version of Visual Studio. It provides the following templates for projects using IronPython.

Need to first install Visual Studio 2008 Shell (Isolated) (390MB) from http://www.microsoft.com/downloads/details.aspx?familyid=aca38719-f449-4937-9bac-45a9f8a73822&displaylang=en. Make sure you execute the vs_shell_isolated.enu.exe file in C:\VS 2008 Shell Redist\Isolated Mode. If you missed this step, the Iron Python Studio will not work.
Download IronPythonStudio.msi (1127KB) from http://www.codeplex.com/IronPythonStudio. Double click on the above msi file and the installation will start. IronPython is also included in the msi.

Configuration C – Visual Studio 2008 with IronPython
For those who already have VS2008 installed and are working in VS2008 for VB and C# projects, this would be the best configuration. Download Visual Studio 2008 SDK (98MB) from http://www.microsoft.com/downloads/details.aspx?familyid=30402623-93ca-479a-867c-04dc45164f5b&displaylang=en and install it on top of Visual Studio 2008. Run VS2008 under “Visual Studio 2008 SDK --> Tools --> Start Visual Studio 2008 Under Experimental Hive”. On top of VB, C#, C++ and all the project types in IronPython Studio, it also allows ASP.NET web applications and services to be developed using IronPython!



It is difficult to develop GUI Applications without IDE. Since I am a DOTNET guy, I go with Configuration C. Configuration B would be good for those of us who are not using VB and C#. Configuration A in my opinion is not productive, but nonetheless a very convenient way to pick up the basics of Python in .NET.

After some hours of experimentation, there are some serious bugs in IronPython. My colleague reported this problem, create a Button and define a button_click event for the button. However, when a new Label is created, the button_click function is overwritten. Any change made directly to the codes in the code view will most likely mess up the designer view. The Designer View can also be easily "corrupted" even with incorrect indentation.