ironpython

Is there a literal notation for decimal in IronPython?

suppose I have the following IronPython script: def Calculate(input): return input * 1.21 When called from C# with a decimal, this function returns a double: var python = Python.CreateRuntime(); dynamic engine = python.UseFile("mypythonscript.py") decimal input = 100m; // input is of type Decimal // next line throws RuntimeBinde...

IronPython 2.6.1 for .NET 4.0 RC targeting Silverlight?

Since the 2.6.1 .NET 4.0 RC release of IronPython (found @ http://ironpython.codeplex.com/releases/view/40146) does not include Silverlight binaries I am wondering if anyone has had any success getting it working themselves. I'd assume it would not be too hard to recompile the source against Silverlight but I can't seem to locate it on C...

Can I treat IronPython as a Pythonic replacement to C#?

Hey guys! I do understand that this topic has been covered in some way at StackOverflow but I'm still not able to figure out the exact answer: can I treat IronPython as a Pythonic replacement to C#? I use CPython every day, I love the Zen :) but my current task is a Windows-only application with a complex GUI and some other features wh...

marking IronPython class as serializable

is it possible to do this in IronPython and if it is, how? ...

Best way to unit-test WCF REST/SOAP service while dynamically generating stubs

I have a webservice written with WCF 4.0 that exposes REST and SOAP functions, and I want to set up my unit tests so that as I work on my web services I can quickly test by having the test framework start up the service, outside of IIS, and then do the tests. I want it to be dynamically generated as I am not certain what the interface w...

How to pass an IronPython instance method to a (C#) function parameter of type `Func<Foo>`

I am trying to assign an IronPython instance method to a C# Func<Foo> parameter. In C# I would have a method like: public class CSharpClass { public void DoSomething(Func<Foo> something) { var foo = something() } } And call it from IronPython like this: class IronPythonClass: def foobar(self): return ...

How to run a django on .Net?

Possible Duplicate: Django on IronPython Is there any demo of the django on .net ? how should i build it in the .net environment? I am chinese ,and it is hard to search in chinese about that.... ...

"IronPython + .NET" vs "Python + PyQt". Which one is better for Windows App development?

Hi, I'm new in using Python. I would like to develop Windows GUI Application using Python. After some research, I found that I have 2 options:- IronPython + .NET Framework Python + PyQt May I know which one is better for Windows Application development? Which option has more features (e.g. database support, etc)? Other than the .NE...

How to handle value types when embedding IronPython in C#?

There is a well known issue when it comes to using .NET value types in IronPython. This has recently caused me a headache when trying to use Python as an embedded scripting language in C#. The problem can be summed up as follows: Given a C# struct such as: struct Vector { public float x; public float y; } And a C# class such ...

what does leading '\x' mean in a python string '\xaa'

what is difference between 'aa' and '\xaa' and which chapter of python documentation will cover this topic? thanks in advance. ...

IronPython memory leak?

Run this: for i in range(1000000000): a = [] It looks like the list objects being created never get marked for garbage collection. From a memory profiler, it looks like the interpreter's stack frame is holding onto all the list objects, so GC can never do anything about it. Is this by design? EDIT: Here is a better example of t...

Creating WCF Services using Dynamic Languages and DLR

I was curious how anyone would go about creating WCF based services using a dynamic language like IronPython or IronRuby. These languages do not have the concept of interfaces. How would someone define service contracts? Would we need to rely on static languages for such kind of tasks? I am a big fan of Python in particular and would lik...

what's the UNC path for local computer from a remote machine ?

I am writing a small utility program in IronPython to install applications on remote machine using managementclass which uses WMI. Now, the script would install an application on Machine_B from Machine_A, it works fine as long as you have the msi file on the local drive of the Target machine (Machine_B, in this case). I want to be able ...

changing .emacs to use IronPython.exe and using code completion for IronPython modules ?

I configured my Emacs for code completion and other help using this link (from another question here on SO). I am a complete newbie to emacs. Can anyone tell me what should I change so it (rope, ropemacs, pymacs, yasnippet etc) picks up symbols of IronPython modules for code completion and snippets. Also I want to map: C-x RET - to i...

Intellisense on custom types in Iron Python

Hi everybody, I'm just starting to play around with IronPython and am having a hard time using it with custom types created in C#. I can get IronPython to load in assemblies from C# classes, but I'm struggling without the help of intellisense. If I have a class in C# as defined below, how can I make it so that IronPython will be able to...

Why doesn't IronRuby have the same tools that IronPython does?

Hi, I've been using Ruby as my main scripting language for years but switched to .NET several years ago. I'd like to continue using Ruby (primarily for testing) BUT the toolset for IronRuby is really nonexistent. Why? In Python, meanwhile, there are project templates and full intellisense support. Why isn't there something like that...

Accessing protected members of .NET type in Iron Python

I have a .NET type 'MyClass' with a protected method that takes in an out parameter. For example: protected bool MyMethod(out string value) I am able to call this method on a 'MyClass' object created in Iron Python script. But however, the out variable 'value' is 'None' even if it is assigned some value in the method. Now if I make i...

Is it possible to use P4Python API with IronPython?

Is it possible to use P4Python (the perforce python api) with IronPython? I'd like to use the python api because it seems much faster than using p4.net implementionat of a Perforce API but when I try to import p4 into IronPython I receive the following error. IronPython 2.6.1 (2.6.10920.0) on .NET 4.0.30128.1 Type "help", "copyrigh...

IronPython embedded IDE

I'd like to use embedded IronPython as a way of allowing users to script / extend my app. Running the scripts is easy enough, but I also need to provide some sort of IDE or editor as well - this is the bit I'm not sure how to do. As far as I can see I have only a few options: Write myself a complete script editor, complete with syntax...

C# 4.0: casting dynamic to static

This is an offshoot question that's related to another I asked here. I'm splitting it off because it's really a sub-question: I'm having difficulties casting an object of type dynamic to another (known) static type. I have an ironPython script that is doing this: import clr clr.AddReference("System") from System import * def GetBclUr...