ironpython

What is the easiest way to ping/notify a .NET Windows Service?

What is the easiest way to ping/notify a .NET Windows Service? Do I have to use WCF for this? Or is there an easier way? I would like to be able to wake up the service using a Python (or an Iron Python) script from anywhere. Also is there a way I can be notified (by email) if that the service has stopped? ...

Why does the interpreted order seem different from what I expect?

I have a problem that I have not faced before: It seems that the order of interpretation in my program is somehow different from what I expect. I have written a small Twitter client. It takes a few seconds for my program to actually post a tweet after I click the "GO" button (which can also be activated by hitting ENTER on the keyboard)...

Generate .NET Assemblies from Iron Python

I have a Iron Python script that I want to run and then have the ipy interpreter output an assembly that I can run on other machines. How do I do that? Is there a siwtch I can pass to ipy.exe? ...

Calling C# object method from IronPython

I'm trying to embed a scripting engine in my game. Since I'm writing it in C#, I figured IronPython would be a great fit, but the examples I've been able to find all focus on calling IronPython methods in C# instead of C# methods in IronPython scripts. To complicate things, I'm using Visual Studio 2010 RC1 on Windows 7 64 bit. IronRuby...

Passing objects across Appdomains

I am having issues while passing objects across Appdomains.During further investigation I found that the issue is due to the IronPython object not been Serialized. This IronPython object is derived from a .NET base class. The .NET base class is derived from MarshalByRefObj. Let me explain my environment. I have IronPython embedded in my...

Access Controls in Silverlight DataGrid Column Header from Code

We have custom headers in the Silverlight DataGrid using the ContentTemplate. We've got a button in the header and need to programmatically access the button to hook up the event. We're using IronPython, so we can't statically bind the event in the xaml (plus we use the grid for many different views - so we dynamically generate the xaml)...

A debugger for IronPython

Is there a good debugger for IronPython? ...

Using ManagementClass.Getinstances() from IronPython

I have an IronPython script that looks for current running processes using WMI. The code looks like this: import clr clr.AddReference('System.Management') from System.Management import ManagementClass from System import Array mc = ManagementClass('Win32_Processes') procs = mc.GetInstances() That last line where I call the GetInstances...

Writing an Iron Python debugger

As a learning exercise I'm writing myself a simple extension / plugin / macro framework using IronPython - I've gotten the basics working but I'd like to add some basic debugging support to make my script editor easier to work with. I've been hunting around on the internet a bit and I've found a couple of good resources on writing manag...

TranslateTransform for drag and drop in Silverlight

We're trying to implement drag and drop in Silverlight (3). We want users to be able to drag elements from a treeview onto another part of a UI. The parent element is a Grid, and we've been trying to use a TranslateTransform along with the MouseLeftButtonDown, MouseMove (etc) events, as recommended by various online examples. For example...

What can be done in Cpython that can not be done in IronPython?

What can be done in Cpython that can not be done in IronPython? ...

Ironpython - Named parameters to constructor

When I create an instance of my C# class in IronPython with named parameters to the constructor, it is setting properties corresponding to the names of the parameters. I wish to disable this behavior so I can have better control on the order the properties are evaluated. Is this possible? ...

Distributing IronPython applications

I'm thinking of developing a small application using IronPython, however I want to distribute my app to non-techies and so ideally I want to be able to give them a standard shortcut to my application along with the instructions that they need to install IronPython first. If possible I even want my shortcut to detect if IronPython is not...

Any way to add my C# project as a reference in IronPython / IronRuby?

I know how to reference an existing .dll to IronPython, but is there any way to add my project as a reference like I can between Visual Studio projects? Or is it best practice to create a separate class library? ...

IronPython overriding __setattr__ and __getattr__

I'm trying to implement a class in C# with a method that intercepts the Python __setattr__ and __getattr__ magic methods. I found this bug report: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=8143 But that is from 2008, and nowhere can I find ICustomAttributes or PythonNameAttribute. I don't see anything useful in Int...

No module named difflib

I want to execute python code from C# with following code. static void Main(string[] args) { ScriptEngine engine = Python.CreateEngine(); ScriptSource source = engine.CreateScriptSourceFromFile(@"F:\Script\extracter.py"); source.Execute(); } I have the problem at line source.Execute(), I got error "N...

Using Bitmap.LockBits and Marshal.Copy in IronPython not changing image as expected

Hi all, I have written the following IronPython code: import clr clr.AddReference("System.Drawing") from System import * from System.Drawing import * from System.Drawing.Imaging import * def NoWorko(bitmap): bmData = bitmap.LockBits(Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadWrite, PixelFormat.Format2...

Syntax highlighting: rich text box control for .NET

I'm looking for a free control/component/library something like a rich text box for editing codes of python (or other languages.) I like to have some features: Highlight codes Auto Indent Line numbering Defining new styles or rules of highlighting (for OpenType keywords) Is there such a control? or I have to write my own? ...

How to expose overloaded methods to an embedded IronPython interpreter?

I have embedded an IronPython engine in a C# application. I want to expose some custom commands (methods) to the interpreter. How do I do this? Currently, I have something like this: public delegate void MyMethodDel(string printText); Main(string[] args) { ScriptEngine engine = Python.CreateEngine(); ScriptScope scope = engine...

Using python code in ASP.NET Web forms app

I would like to use some code written in python (it uses built in modules) in a regular ASP.NET/C# web application. I am a newbie in python and have heard of IronPython and how ASP.NET now allows us to create IronPython apps. Any thoughts on which way I should proceed? The python code is the on here ...