using IronPython.Hosting;
using Microsoft.Scripting;
using Microsoft.Scripting.Hosting;
public static void Main()
public static void testFunction2()
Employee employee = new Employee() { Salary = 50000, Good = true };
ZSenorLicensePlate zLicensePlate = new ZSenorLicensePlate() { LicensePlate = "53E-ZYB" };
var string1 = @"""inside quotes""";
prefix = str(11666000000)
device_id = str(base32_crockford.decode(license))
l.LicensePlate = prefix + device_id
string testString = "print foo; bar=foo+11";
var engine = Python.CreateEngine();
var scope = engine.CreateScope();
scope.SetVariable("employee", employee);
engine.Execute(testString, scope);
Console.WriteLine(scope.GetVariable<Employee>("employee").Salary);
engine = Python.CreateEngine();
scope = engine.CreateScope();
scope.SetVariable("license", zLicensePlate);
engine.Execute(decodeString, scope);
Console.WriteLine(scope.GetVariable<ZSenorLicensePlate>("license").LicensePlate);
public static void testFunction()
Employee employee = new Employee() { Salary = 50000, Good = true };
ScriptEngine engine = Python.CreateEngine();
ScriptScope scope = engine.CreateScope();
scope.SetVariable("employee", employee);
ScriptSource source = engine.CreateScriptSourceFromString(
Console.WriteLine(scope.GetVariable<Employee>("employee").Salary);
public double Salary { get; set; }
public bool Good { get; set; }
public class ZSenorLicensePlate
public string LicensePlate { get; set; }