ironpython

how to sort list of FileInfo in IronPython

Given a list of FileInfo objects, how do I sort them by date? Specifically I want to sort them by CreationTime in descending order. ...

Catching Ironpython Exception in C#

I'm embedding IronPython 2.0 in c#. In IronPython I defined my own exception with: def foobarException(Exception): pass and raise it somewhere with: raise foobarException( "This is the Exception Message" ) now in c# I have: try { callIronPython(); } catch (Exception e) { // How can I determine here the name (foobarException...

Can you use LINQ types and extension methods in IronPython?

Is it possible to use the LINQ types and extension methods in IronPython? If so how? And also is there often more pythonic to do the same thing? ...

IronPython + emacs?

I've decided to get into IronPython, as I work pretty much exclusively in .NET, but need something a little less stuffy than C# for mocking up quick stuff. Python has been fine for small things, throwaway tests, that sort of stuff, but it's to the point that I need to be able to get to some of our .NET code. Despite my complete revulsi...

Referencing web project from ironpython

i've got an mvc project written in C#. i'm trying to reference it from ironpython. i've got no issue importing the objects and referencing the dll, but some of the objects rely on connection strings from the web.config, is there any way for me to reference the dll and then specify the web.config it should be using? ...

Debugging IronPython scripts in hosted (embedded) environment

Hello, I'm writing a C# application which has IronPython (2.0.1) embedded in it. The idea is to expose portions of the application to the IronPython scripts, which the users write. I want to provide the ability to the users to be able to debug the scripts written by them, using the Visual Studio Debugger. Note that the scripts are run...

Iron Python Twisted

Is there an Iron Python .net port of the twisted libraries, or can Iron Python use the standard one? ...

Python 2.5.2 continued...

Hello, This is a continuation of my question Python2.5.2 The code i developed is working fine with clr.Addreference(). Now thee problem is I have to load ny script which uses dll developed in .NET to another application.They had used QT for its implementation.There is a Script console in that application.When ii entered 'import ...

Any alternatives to IronPython, Python for .NET for accessing CLR from python?

Are there any alternatives to Python for .NET or IronPython for accessing .NET CLR? Both of these seem to have downsides in that Python for .NET is not under active development (as far as I can tell) and you lose some features available in CPython if you use IronPython. So are there any alternatives? ...

Ironclad import error

I am getting the following error when trying to import a C-Extension I need with irconclad. Is this related to my configuration or limitation in ironclad? C:\devtools\ipython>ipy IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3053 Type "help", "copyright", "credits" or "license" for more information. >>> import ironclad >>> ironclad.__versi...

How do you implement an interface in IronPython?

The FAQ which comes with the IronPython 2.0.1, lists the following: You can define interfaces in C#, build those into a DLL, and then implement those interfaces in Python code as well as pass the python objects that implement the interfaces to C# code. I have googled and googled and googled, but not found how to do this. Ca...

Querying IronPython scripts for interfaces in a hosted environment

I'm developing an application written in C# which hosts IronPython. What I'm planning is that the users will write python scripts, which contain classes implementing a pre-defined interface. Something like: Define interface in C# code: public interface IPlugin { void DoSomething(); } Implement the interface in python code. class ...

starting .net development in ironpython

I'm in a situation where i need to start learning some .net to work with some application at work. Currently my knowledge is mainly in python and php so i'm interested in taking the iron python route to learning and implementing .net . Is this a good idea by any stretch and/or is there any good resources to get started learning? ...

IronPython and C# - Script Access to C# Objects

Hi all, Consider the code below: ScriptRuntimeSetup setup = Python.CreateRuntimeSetup(null); ScriptRuntime runtime = new ScriptRuntime(setup); ScriptEngine engine = Python.GetEngine(runtime); ScriptScope scope = engine.CreateScope(); scope.SetVariable("message", "Hello, world!"); string script = @"print message"; ScriptSource source =...

Instantiating custom .NET types in IronPython

Assume the following code: public class Foo { public string Bar { get; set; } } How can I instantiate an instance of Foo in the following code? ScriptRuntimeSetup setup = Python.CreateRuntimeSetup(null); ScriptRuntime runtime = new ScriptRuntime(setup); ScriptEngine engine = Python.GetEngine(runtime); ScriptScope scope = engine.C...

IronPython for unit testing with IronPython Studios

Im looking to play with IronPython and figured that writing unit tests is a simple enough way to get started. This would essentially mean that my core applications code will still be written in C# with just my tests been python. With this in mind my ideal situation was to develop both the C# and IronPython code from within the same sol...

IDE for ironpython on windows

I am currently learning ironpython and loving but i'm looking to move on from using notepad++ and cmd.exe and try using something with a bit more juice. I recently learned that iron python studio does not support iron python 2 so that makes my choice a bit more difficult. Is their any IDE's for windows that would be good iron python 2 ...

How to connect to a WCF Service with IronPython

Has anyone done this? I've tried generating a c# proxy class and connecting through it, but I cannot figure out how to get IronPython to use the generated app.config file that defines the endpoint. It tries to connect, but I just get an error about no default endpoint. I would ideally like to make the connection using only IronPython ...

IronPython - Convert int to byte array

What is the write way to get the length of a string in Python, and then convert that int to a byte array? What is the right way to print that to the console for testing? ...

IronPython - JSON choices

What is the best way to deal with JSON in IronPython 2.0.1. The native Python "standard library" json looks to be not implemented yet. If I wanted to use the Newtonsoft Json.NET library how do I do this? I could add the assembly to the GAC, but what are my other choices? ...