ironpython

How to pass a lambda expression to a C# constructor from an IronPython script?

I'm integrating an IronPython scritping engine into my C# raytracer which, so far, has been a breeze even though I'm completely new to Python. There is one particular thing, though, that I need help with. I have a C# class which defines a constructor like this: public CameraAnimation(Action<Camera, float> animation) In C#, I would ins...

How to create IDLE -like functionality to WinForms application

Hi, I'd like to add "IDLE-like functionality" to C# WinForms application, but I don't quite have an idea how to do that and couldn't find anything useful with Google. So basically I want interactive command line interface, where user could enter some Python code and execute it (not just expressions, should be possible to define new fun...

Learning Python on Windows for TDD

I'm interested in learning python to have access to a more agile language for writing tests in my .NET projects. Is IronPython mature enough for these purposes yet? I'm content with writing tests in C#, but find dynamic languages like ruby and python very attractive. Would it be better to forgo IronPython while learning, and stick to t...

How to run OS shell commands in IronPython/Mono?

I would like to give IronPython and Mono a try. Specifically doing sysadmin tasks. Which often means running OS commands. In CPython I use the subprocess module for such tasks. But in IronPython (v2.0.1, Mono 2.4, Linux) there is no subprocess module. It seems there is not even an 'os' module. So I can't use os.system(). What would be th...

How to run a hosted ironpython 1.1 from an Excel add-in?

I am writing an Excel add-in that hosts IronPython 1.1 and I want to provide the Excel.Application COM object to the PythonEngine instance. My C# can access members of the COM object just fine. However, when my IronPython script accesses members of the COM object, I get a "System.ArgumentException: Object of type 'System.Int32' cannot b...

How are you using IronPython?

I'm keen to drink some modern dynamic language koolaid, so I've believed all the stuff on Michael Foord's blog and podcasts, I've bought his book (and read some of it), and I added an embedded IPy runtime to a large existing app a year or so ago (though that was for someone else and I didn't really use it myself). Now I need to do some ...

Ambigious reference for ExtensionAttribute when using Iron Python in Asp.Net

I get the following error when starting an Asp.Net site that uses an assembly that in turn makes use of the dlr and Iron Python for scripting. BC30560: 'ExtensionAttribute' is ambiguous in the namespace 'System.Runtime.CompilerServices'. The issue seems to be known and there's a workaround in the issue tracker. However it says tha...

How do I check for type equality (is operator or x.GetType() == typeof(xType)) in IronPython?

Duplicate: What’s the canonical way to check for type in python? How do I check for type equality in IronPython? I need the equivalent of the following C# code in IronPython: if (x.GetType() == typeof(xType)) or if (x is xType) ...

Advice for Windows system scripting+programming

I just got a project where I have to do the following on a Windows OS: detect how many drives (C: D: E: ..etc) are connected to current system what the system labels are for each volume how much storage (both used and free) for each of the drives what format each drive is (NTFS/FAT32) how many files are in a given directory in any o...

using Python objects in C#

Is there an easy way to call Python objects from C#, that is without any COM mess? ...

Importing a python module to .net - "No module named signal"

I'm trying to import a Python module in a C# code like this: var setup = Python.CreateRuntimeSetup(null); var runtime = new ScriptRuntime(setup); var engine = Python.GetEngine(runtime); var module = engine.ImportModule("mymodule"); but I get an error saying "No module named signal", does this mean that ...

Production ready Python implementations besides CPython?

Except for CPython, which other Python implementations are currently usable for production systems? The questions What are the pros and cons of the various Python implementations? I have been trying to wrap my head around the PyPy project. So, fast-foward 5-10 years in the future what will PyPy have to offer over CPython, Jython, and...

IronPython and instantiating COM objects

I'm using IronPython 2.0 in a SharpDevelop 3.1 console window. I'm trying to reference and use the Redemption CDO replacement library. The standard usage for the library is to instantiate an RDOSession object, then use the methods on that object to navigate through the RDO object model. I've registered the Redemption COM dll and refer...

Why would one choose Iron Python instead of Boo?

Possible Duplicates: BOO Vs IronPython Boo vs. IronPython Say you want to embed a scripting language into a .NET application. Boo is modelled on Python syntax, but also includes type inference, and just in general seems to be a better, more modern language to embed as a scripting language. Why, then, is there so much fuss ab...

IronPython 2.0 executes code slowly.

It seems that IronPython 2.0.1 executes a script file about 3x slower than IronPython 1.x. I'm not convinced that it isn't something I'm doing so I'm wondering if others have had a similar experience. I have a 200k python script that takes 5 seconds to execute from a file on IP 1.x and nearly 18 seconds in IP 2.0.1! ...

How do I get to compare values of different datatypes (programmatic SSIS)

Hi, I am writing a data comparison code in python to compare the data transformed in the SSIS packages. So, I have all the modules written that accesses the each and every task in SSIS packages. It compares fairly well except for those data that have different datatype, same values but different decimal places. I started out converting...

How to compare data of two tables transformed in SSIS package

Hi, A table has been ETLed to another table. My task is to verify the data between two tables programmatically. One of the difficulties I m facing rite now is: how to use the expression that I can get from, let s say, derived column task and verify with the source and destination. or in other words, how can I use the expression to wor...

IronPython, Click Once, .NET 2.0 Error - thoughts?

...

Looping over a Python / IronPython Object Methods

What is the proper way to loop over a Python object's methods and call them? Given the object: class SomeTest(): def something1(self): print "something 1" def something2(self): print "something 2" ...

Ironpython console disappears instantly

I installed ironpython 2.0 in the windows xp professional box and it requires .Net framework 2.0 service pack 2 or later. The windows box has it. But still the console disappears. There is issue in either of them. Need help? ...