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
34
votes
9 answers

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…
Shard
  • 3,175
  • 6
  • 30
  • 40
33
votes
7 answers

Python or IronPython

How does IronPython stack up to the default Windows implementation of Python from python.org? If I am learning Python, will I be learning a subtley different language with IronPython, and what libraries would I be doing without? Are there,…
johnc
  • 39,385
  • 37
  • 101
  • 139
30
votes
4 answers

Docker issue: /bin/sh: pip: not found

So my dockerfile is : FROM iron/python:2.7 WORKDIR /app ADD . /app RUN pip install --upgrade pip RUN pip install -r ./requirements.txt Recently though when I build my image with: docker build --no-cache -t : I run into the…
Raphael Baysa
  • 301
  • 1
  • 3
  • 3
30
votes
12 answers

Iron Python : what are good uses for Iron Python

I have an affinity for python, but I work in a .NET environment, so I was looking into Iron Python, and wondering what it would be used for. Could you write an app in it? or is it for adding a scripting language to your app? How do you guys use…
Master Morality
  • 5,837
  • 6
  • 31
  • 43
30
votes
4 answers

Python decorators that are part of a base class cannot be used to decorate member functions in inherited classes

Python decorators are fun to use, but I appear to have hit a wall due to the way arguments are passed to decorators. Here I have a decorator defined as part of a base class (the decorator will access class members hence it will require the self…
Aphex
  • 7,390
  • 5
  • 33
  • 54
29
votes
2 answers

How to use Python in .NET-Core application?

How to use Python in .NET-Core application? I need this for the purposes of Hackathon so the solution don't have to be 'elegant'. I've read that it's impassible to run Python scripts directly because there exists only library IronPython for standard…
Maciek Drabicki
  • 439
  • 1
  • 5
  • 12
28
votes
12 answers

How are you using IronPython?

I'm keen to drink some modern dynamic language koolaid, so I've believed all the stuff on Michael Foord's blog and podcasts, I've bought his book (and read some of it), and I added an embedded IPy runtime to a large existing app a year or so ago…
Will Dean
  • 39,055
  • 11
  • 90
  • 118
28
votes
3 answers

Why is calling a Python lambda expression from C# not thread-safe?

I define a side-effect-free (pure) lambda expression in IronPython and assign it to a C# delegate. When invoking the delegate simultaneously from multiple threads i get exceptions of type AccessViolationException, NullReferenceException and…
Rauhotz
  • 7,914
  • 6
  • 40
  • 44
28
votes
2 answers

Debugging IronPython scripts in hosted (embedded) environment

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…
Rohit
  • 7,449
  • 9
  • 45
  • 55
27
votes
3 answers

Multi-threading in IronPython

I have a "script class" in IronPython, and scripting in my app works by calling methods on its instance. I need to implement calling scripts from multiple threads. What is the correct way to do it? I have multiple concerns: Is ScriptScope…
Athari
  • 33,702
  • 16
  • 105
  • 146
26
votes
7 answers

Boo vs. IronPython

After having looked at each of these two projects, it seems that both are VERY similar. Both run on top of the CLI, both have python style syntax, both use .NET instead of the standard python libraries. So, what are the differences between them and…
Matthew Scharley
  • 127,823
  • 52
  • 194
  • 222
24
votes
2 answers

IronPython: EXE compiled using pyc.py cannot import module "os"

I have a simple IronPython script: # Foo.py import os def main(): print( "Hello" ) if "__main__" == __name__: main() It runs fine and prints Hello if I run it with IronPython as: ipy Foo.py Following the instructions given in IronPython…
Ashwin Nanjappa
  • 76,204
  • 83
  • 211
  • 292
24
votes
3 answers

IronPython on ASP.NET MVC

Has anyone tried ASP.NET MVC using IronPython? Having done a lot of Python development recently, it would be nice to continue with the language as I go into a potential ASP.NET MVC project. I'm especially interested in exploiting the dynamic…
Soviut
  • 88,194
  • 49
  • 192
  • 260
24
votes
1 answer

IronPython in Unity3D

I am trying to use IronPython as an external scripting language for Unity3D. The necessary DLLs for IronPython's execution load just fine inside of Assets\Plugins. However, when I try to run the script I get this error: PythonImportErrorException:…
LunchMarble
  • 5,079
  • 9
  • 64
  • 94
23
votes
4 answers

Python: AttributeError: 'module' object has no attribute 'AddReference'?

Am trying to use clr.AddReference and clr.AddReferenceToFile to import an assembly, but python(2.7) keeps making this error: Traceback (most recent call last): File "", line 1, in
Ran
  • 635
  • 2
  • 10
  • 22