ironpython

Best way to detect IronPython

I need to write a module which will be used from both CPython and IronPython. What's the best way to detect IronPython, since I need a slightly different behaviour in that case? I noticed that sys.platform is "win32" on CPython, but "cli" on IronPython. Is there another preferred/standard way of detecting it? ...

Creating a structure from bytes with ctypes and IronPython

I have the following CPython code which I now try to run in IronPython: import ctypes class BarHeader(ctypes.Structure): _fields_ = [ ("id", ctypes.c_char * 4), ("version", ctypes.c_uint32)] bar_file = open("data.bar", "rb") header_raw = bar_file.read(ctypes.sizeof(BarHeader)) header = BarHeader.from_buffer_copy(he...

Python code editor control for .NET MVC

I am using .NET MVC in an application that needs to have a IronPython code editor on a webpage. I am looking for some code editor that can provide line numbers and some syntax highlighting for the text area where the code is entered. Does anyone have any pointers? ...

Eval IronPython Scripts during ASP.NET Web Request; Static Engine or Not

I would like to create an ASP.NET MVC web application which has extensible logic that does not require a re-build. I was thinking of creating a filter which had an instance of the IronPython engine. What I would like to know is: how much overhead is there in creating a new engine during each web request, and would it be a better idea to ...

What do I need to develop an Iron Python web app in Visual Studio 2010

Hi, I've got Visual Studio 2010. To develop a web app in Iron Python (i.e. to use a Ruby like language not C#) what downloads to I need? e.g. is the DLR already in VS2010, Iron Python itself Once setup would I actually be still developing an ASP.net MVC web app but just using Ruby for the language, or is the model something different...

IronPython :- Visual Studio 2010 or SharpDevelop?

I'm considering developing a medium-size project for a client in IronPython. It's a pretty straightforward replacement for an existing system I've been supporting for several years, so the specification is quite well defined and understood. This is my first significant IronPython and .Net project so I'm expecting a bit of a learning cu...

C# monkey patching - is it possible?

Is it possible to write a C# assembly which when loaded will inject a method into a class from another assembly? If yes, will the injected method be available from languages using DLR, like IronPython? namespace IronPython.Runtime { public class Bytes : IList<byte>, ICodeFormattable, IExpressionSerializable { internal by...

Writing iron python method with ref or out parameter

Hello, i need to translate following C# method to the same IronPhyton method private void GetTP(string name, out string ter, out int prov) { ter = 2; prov = 1; } ...

Autoproperty failing in IronPython works in Python?

I have this following python code, it works fine in python but fails with the following error in IronPython 2.6 any ideas as to why? ====================================================================== ERROR: testAutoProp (__main__.testProperty) ---------------------------------------------------------------------- Traceback (most...

Embedding IronPython in a WinForms app and interrupting execution

BACKGROUND I've successfully embedded IronPython in my WinForm apps using techniques like the one described here: http://blog.peterlesliemorris.com/archive/2010/05/19/embedding-ironpython-into-a-c-application.aspx In the context of the embedding, my user may any write loops, etc. I'm using the IronPython 2.6 (the IronPython for .NET 2....

selecting dropdownlist item in IronPython

I want to select a particular item in a dropdownlist by value, in asp.net using IronPython. I found I can do it like this listItem = ddl.Items.FindByValue(x) if listItem != None: listItem.Selected = True But I want to do it in one line ...

Pure python implementation of greenlet API

The greenlet package is used by gevent and eventlet for asynchronous IO. It is written as a C-extension and therefore doesn't work with Jython or IronPython. If performance is of no concern, what is the easiest approach to implementing the greenlet API in pure Python. A simple example: def test1(): print 12 gr2.switch() p...

IronPython: Creating & Adding An Array Of Points To A GraphicsPath

Greetings; I'm having a bit of trouble correctly instantiating an Array of System.Drawing.Point instances, and then adding the Array of Points to a GDI+ GraphicsPath instance using IronPython in a WinForms application. The following code compiles or builds correctly under SharpDevelop 3.2 with IronPython 2.6: import System.Drawing imp...

Python and IronPython on same machine?

I am a total newbie in the Python world. I want to start to experiment with Python and IronPython and compare the results. Is it possible to install Python and IronPython on the same machine with interfering each other or is it besser to this in the virtual machine. Thx in advance. ...

finding control in winforms panel

I need to find a child control in a winforms panel. I was wondering if there is a method similar to Panel.FindControl() of the asp.net webforms panel in the .net winforms version ...

Integration of C#, F#, IronPython and IronRuby

I was told that the assembly files made from C# and F# source is interoperable as they are compiled into .NET assembly. Q1 : Does that mean that C# can call F# functions just like they are C# functions? Q2 : How about the IronPython and IronRuby? I don't see any assembly dll from the IronPython/IronRuby. Q3 : Is there any easy way to ...

How to use IronRuby or IronPython together with c# in Web/Windows Form?

I am very interesting in the dynamic language runtime of .net, and saw IronRuby/IronPython is built on top of it. I cannot find some example which utilize the dynamic of Ruby/Python from within c#, which is what I realy interested. I saw videos from Microsoft which call JavaScript from within Silverlight using the dynamic of c# 4, just ...

Adding a DataGridView in IronPython Studio Winforms gets a "'DataGridView' object has no attribute 'BeginInit'"

By just adding a datagridview in IronPython Studio it triggers a "DataGridView' object has no attribute 'BeginInit'". Is there a fix for this? The errors are gone if the lines self._DataGridView1.BeginInit() and self._DataGridView1.EndInit() are deleted, but that's not what it should be done to fix that ...

Anyone using IronPython in a production application?

I've been toying with the idea of adding IronPython for extending a scientific application I support. Is this a good or horrible idea? Are there any good examples of IronPython being used in a production application. I've seen Resolver, which is kind of cute. Are there any other apps out there? What I don't get is this. Is it any...

module "random" not found when building .exe from IronPython 2.6 script

I am using SharpDevelop to build an executable from my IronPython script. The only hitch is that my script has the line import random which works fine when I run the script through ipy.exe, but when I attempt to build and run an exe from the script in SharpDevelop, I always get the message: IronPython.Runtime.Exceptions.ImportException...