ironpython

Future and stability of IronPython

I am currently looking for a possible way to integrate my C++/C# application with some of my Python scripts. At this point, IronPython seems like the way to go. However, before proceeding, I would like to ask the following: How stable is IronPython right now? Is it ready for production use? Are there any known major quirks/bugs? What ...

compatibility between CPython and IronPython cPickle

Hi all, I was wondering whether objects serialized using CPython's cPickle are readable by using IronPython's cPickle; the objects in question do not require any modules outside of the built-ins that both Cpython and IronPython include. Thank you! ...

Overloading magic methods with IronPython

Hi all, I'm attempting to define the power operator ** in a C# class (we'll call it class Foo). I've overridden __pow__(), which gets me the desired behavior for operations of type Foo ** int. Unfortunately, I need to also define int ** Foo, and neither using dynamic values nor overloading __pow__() gives me the desired behavior; I al...

"No module named [name] in [name]"

Hello StackOverflow, I'm trying to pickle a class (written in Python) using IronPython's cPickle, which imports a module written in .NET and has the assembly attribute PythonModule; let's call it mod. When serializing this class, I get an IronPython ImportException that states "no module named 'mod in mod." This error still occurs eve...

Calling C# object from IronPython

I have the following C# code to compile it into MyMath.dll assembly. namespace MyMath { public class Arith { public Arith() {} public int Add(int x, int y) { return x + y; } } } And I have the following IronPython code to use this object. import clr clr.AddReferenceToFile("MyMath.dll") imp...

GAC (gacutil) not working with IronPython.dll on Mono

I tried to use gacutil (mono) for IronPython, but I got the following error. sudo gacutil -i IronPython.dll Password: Failure adding assembly IronPython.dll to the cache: Strong name cannot be verified for delay-signed assembly What does this mean? Any solution to this problem? ...

Calling IronPython object from C# with mono

I have the following IronPython code. class Hello: def __init__(self): pass def add(self, x, y): return (x+y) I need to call this from C#, and I came up with the following code. using System; using IronPython.Hosting; using IronPython.Runtime; using IronPython; using Microsoft.Scripting.Hosting; using Microsof...

IronPython cannot import module os

Hello, So I have a basic ZIPPED IronPython (2.6 or 2.6.1) that I just unzip, start ipy.exe, type "import os" and hit enter. The following output happens: Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named os It doesn't work even if I import clr first. What's it to be done ? I've goo...

IronPython overload resolution on generic types

I have a C# class with overloaded static methods like these: // Added to the Simple class in Tutorial\Extend\csextend.cs public static int Foo(IEnumerable<int> values) { return 1; } public static int Foo(IEnumerable<string> values) { return 2; } I get an error when I try to call these from IronPython 2.6. I am passing a pytho...

Can I use IronPython to develop GUIs for Google App Engine?

I'm developing a simple Python program with a (dynamic) form interface, but it needs to run on Google App Engine. I understand that IronPython lets one use Visual Studio's drag-and-drop interface builder and classes while programming with Python, but will this be compatible with Google App Engine? ...

Getting the string from IronPython source code with C#

The book of IronPython In Action has the following code to read python script into a string. (Chapter 15.2) static string GetSourceCode(string pythonFileName) { Assembly assembly = Assembly.GetExecutingAssembly(); Stream stream = assembly.GetManifestResourceStream(pythonFileName); StreamReader textStreamReader = new StreamRe...

Why is IronPython 2.7 throwing an exception when I create WPF bindings from XAML?

I've just installed IronPython 2.7 with VS support, and am trying to create a simple prototype WPF application. Something is broken, probably in my installation, and I can't figure out how to diagnose it. I can't get the simplest of bindings to work; they fail with an exception that seems really, really wrong. I create a WPF applicat...

Running IronPython object from C# with dynamic keyword

I have the following IronPython code. class Hello: def __init__(self): pass def add(self, x, y): return (x+y) I could make the following C# code to use the IronPython code. static void Main() { string source = GetSourceCode("ipyth.py"); Engine engine = new Engine(source); ObjectOperations ops = en...

Iron Python vs Razor

Hello folks, I have a little bit of experience with the new Razor syntax, but none with Iron Python. I was wondering do both meet the same needs? Is one favored by Microsoft over the other (or will be)? Appreciate your thoughts, as I'm toying with the idea of learning Iron Python, but if Razor can meet the same need, I probably won't....

IronPython: Will this leak memory?

I’ve got a massive memory leak in my program. This is the first time I’ve used IronPython in a tight loop, so I’m wondering if this could be the cause. For Each column In m_Columns Dim rawValue As String rawValue = line.Substring(column.FileColumnIndex.Value - 1, column.FileColumnEndIndex.Value - column.FileColumnIndex.Value ...

C++\IronPython integration example code?

I'm looking for a simple example code for C++\IronPython integration, i.e. embedding python code inside a C++, or better yet, Visual C++ program. The example code should include: how to share objects between the languages, how to call functions\methods back and forth etc... Also, an explicit setup procedure would help too. (How to incl...

Assigning an IronPython method to a C# delegate

I have a C# class that looks a little like: public class MyClass { private Func<IDataCource, object> processMethod = (ds) => { //default method for the class ...

Failing to import external scripts using in IronPython DLR in the browser

I am trying to use IronPython in the browser and attempting to import external python scripts: <script src="http://gestalt.ironpython.net/dlr-latest.js" type="text/javascript"> </script> ... <script type="application/python" src="test.py" defer="true"></script> <script type="application/python"> import test test.Hello() </script> The ...

Why can't IronPython find my VS2010 VB.Net class library DLL

I created a Class Library project in Visual Studio 2010 and created added the following VB.Net class: Public Class Dumb Private name As String Public Sub New(ByVal newName As String) name = newName End Sub Public Sub sayHi() System.Console.WriteLine("Hi " & name) End Sub End Class I built the solu...

Can you add a handler for WPF event exceptions?

I have a single-threaded IronPython WPF application and if an event handler (FrameworkElement.SizeChanged for example) throws, the exception is just eaten and execution continues without any kind of notification. Because of this I spent a lot of time today solving an "impossible" bug. Does the same thing happen when using WPF from C#? ...