Questions tagged [ironpython]

IronPython is an open-source implementation of the Python programming language which is tightly integrated with the .NET Framework. IronPython can use the .NET Framework and Python libraries, and other .NET languages can use Python code just as easily. Use this tag for implementation-specific questions, general Python questions should just be tagged with "python".

IronPython is an open-source implementation of the Python programming language which is tightly integrated with the .NET Framework. IronPython can use the .NET Framework and Python libraries, and other .NET languages can use Python code just as easily.

IronPython can be obtained at http://ironpython.net/.

Comparison of IronPython vs. C# for 'Hello World'

c#:

using System;
class Hello
{
    static void Main() 
    {
        Console.WriteLine("Hello, World");
    }
}

IronPython:

print "Hello, World"

IronPython is a Dynamic Language that runs on the .NET DLR (Dynamic Language Runtime) in contrast with VB.NET and C# which are static languages.

Iron Python can also import DLL files compiled in other languages and use functions defined therein. For example:

import clr
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import *

Chat/Communication

Join our Gitter-Chat under: https://gitter.im/IronLanguages/main

2618 questions
13
votes
1 answer

Sandbox IronPython?

Is it possible to run an IronPython interpreter inside my .Net application, but inside a sandbox? I want to deny the IP script access to the filesystem while still allowing the app itself access. Would this involve running the scripting engine in…
user47589
13
votes
2 answers

spotfire get name of trellis panel

Suppose I have a visualization that's trellissed by panel by some categorical variable, with one panel per page. I would like to loop over the panels and export each image to a file, with the filename matching the categorical variable. The image…
Victor Chubukov
  • 1,345
  • 1
  • 10
  • 18
13
votes
8 answers

IronPython For Unit Testing over C#

We know that Python provides a lot of productivity over any compiled languages. We have programming in C# & need to write the unit test cases in C# itself. If we see the amount of code we write for unit test is approximately ten times more than the…
Krish
  • 1,053
  • 2
  • 17
  • 25
13
votes
3 answers

BeautifulSoup and ASP.NET/C#

Has anyone integrated BeautifulSoup with ASP.NET/C# (possibly using IronPython or otherwise)? Is there a BeautifulSoup alternative or a port that works nicely with ASP.NET/C# The intent of planning to use the library is to extract readable text from…
user300981
  • 1,423
  • 5
  • 13
  • 16
13
votes
5 answers

Scientific data visualization and the .NET framework

I have spent a long time searching for a product that would bring functionality similar to matplotlib to the .NET framework. From what I can tell, nothing really measures up. Is this an accurate assessment? Here is what I have…
Scott
  • 590
  • 4
  • 13
13
votes
1 answer

Disabled first-chance-exception but debugger stopps within try...catch when using IronPython

The following code should be executed without stopping the debugger: var engine = Python.CreateEngine(AppDomain.CurrentDomain); var source = engine.CreateScriptSourceFromString("Foo.Do()"); var compiledCode = source.Compile(new PythonCompilerOptions…
Sebastian Schumann
  • 3,204
  • 19
  • 37
13
votes
3 answers

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…
Cruachan
  • 15,733
  • 5
  • 59
  • 112
13
votes
2 answers

Using assembly attributes in F#

I'm trying to translate the following C# example, which constructs an IronPython module, to F#. using System; using IronPython.Runtime; [assembly: PythonModule("my_module", typeof(MyModule))] public static class MyModule { public static void…
Tristan
  • 6,776
  • 5
  • 40
  • 63
13
votes
3 answers

Is there any Python syntax highlighter for Visual Studio 2010?

When I used Visual Studio 2008 I could install IronPython + IronPython Integrated IDE + Visual Studio Shell Integrated Mode and then my Visual Studio would parse .py files and highlight its syntax. I tried the same with Visual Studio 2010 beta 2…
Jader Dias
  • 88,211
  • 155
  • 421
  • 625
13
votes
5 answers

Python vs Iron Python

I have to make a GUI for some testing teams. I have been asked to do it in Python, but when I Google, all I see is about Iron Python. I also was asked not to use Visual Studio because it is too expensive for the company. So if you have any idea to…
Benjamin Karlog
  • 330
  • 1
  • 6
  • 22
12
votes
3 answers

How do you use the standard library in IronPython?

I'll prefix this question with: No, Setting IRONPYTHONPATH is not the answer. Anyway... I was planning on using IronPython as a replacement for Powershell for a project, but I've been stumped before I've even started. The very first thing I tried to…
Doug
  • 32,844
  • 38
  • 166
  • 222
12
votes
1 answer

How to set the Anaconda virtual environment when working with IronPython?

I want to run a python script in C# using IronPython. It works fine except IronPython is using my base Python installation instead of the Anaconda environment. I've tried running the script with as an ordinary process (i.e without IronPython) and…
Ian Gibblet
  • 552
  • 3
  • 18
12
votes
6 answers

How to use IronPython with Visual Studio 2008

I've tried using the IronPython integration extension provided by Microsoft. But it does not work with Visual Studio 2008. Is there a proper VS 2008 IDE extension for IronPython?
Jasim
12
votes
3 answers

Would you recommend Iron Ruby, Iron Python, or PowerShell for making a C# application a script host?

Would you recommend Iron Ruby, Iron Python, or PowerShell for making a C# application a script host? After some quick tinkering, right now I'm leaning towards powershell for two main reasons (note these a purely my opinions and if they are wrong,…
Evan
  • 4,450
  • 10
  • 40
  • 58
12
votes
2 answers

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…
Kevin Won
  • 7,156
  • 5
  • 36
  • 54