Running IronPython Scripts from a C# 4.0 Program

 

Running IronPython Scripts from a C# 4.0 Program

Before you read this you may want to check out my other post.

IronPython is a scripting language hosted on the .NET platform. This posts shows how you can use the Dynamic Language Runtime (DLR) and the new C# 4.0 dynamic keyword to call an IronPython script from a C# program.

image

Test.py

import sys

def Simple():
    print "Hello from Python"
    print "Call Dir(): "
    print dir()
    print "Print the Path: " 
    print sys.path

 

using System;
using IronPython.Hosting;
using Microsoft.Scripting.Hosting;

public class dynamic_demo
{
    static void Main()
    {
        var ipy = Python.CreateRuntime();
        dynamic test = ipy.UseFile("Test.py");
        test.Simple();
    }
}

image

Via Charlie Calvert’s Community Blog : Running IronPython Scripts from a C# 4.0 Program

A 10 part series of Prism & Silverlight screencasts

A 10 part series of screencasts illustrating some of the ideas found in Prism by Mike Taulty

and then bring some of these concepts together in a longer, more realistic example of a simple Email application built using the Prism framework

The source code for Video 10 here for download

Via Prism & Silverlight: Part 1 – Taking Sketched Code Towards Unity | mtaulty | Channel 9