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
18
votes
5 answers

Ironpython 2.6 .py -> .exe

I already attempted using py2exe (not compatible with ipy) and PYC (out of date). Can anyone point me in the direction of a good compiler?
user177215
  • 249
  • 2
  • 5
  • 11
17
votes
2 answers

passing Lists from IronPython to C#

I want to pass a list of strings from IronPython 2.6 for .NET 2.0 to a C# program (I'm using .NET 2.0 because I'm working with an api that runs off of DLLs built on 2.0). But I'm not sure how to cast it as it comes back from the…
BenjaminGolder
  • 1,573
  • 5
  • 19
  • 37
17
votes
3 answers

IronPython Webframework

There seem to be many excellent web frameworks for Python. Has anyone used any of these (Pylons, Web2Py, Django) with IronPython?
mchean
  • 417
  • 4
  • 11
17
votes
1 answer

IronPython for .NET core

I'm developing a windows 10 universal app in VS15 using the new .NETCore reference assemblies and want to reference the IronPython library. Unfortunately, IronPython targets .NETFramework and not .NETCore. Does anybody know of an alternative library…
Alfred Young
  • 397
  • 1
  • 3
  • 15
17
votes
2 answers

Empty list is equal to None or not?

Possible Duplicate: Why does “[] == False” evaluate to False when “if not []” succeeds? I am new to python as per ternary operator of python >>> 'true' if True else 'false' true true i am expecting for below code output as [] because [] not…
user1559873
  • 6,650
  • 8
  • 25
  • 28
17
votes
3 answers

How do I call a specific Method from a Python Script in C#?

I'm wondering if there is a possibility to call a specific Method from a Python script over a C# project. I have no code... but my idea is: Python Code: def SetHostInfos(Host,IP,Password): Work to do... def CalcAdd(Numb1,Numb2): Work to…
VanDeath
  • 519
  • 1
  • 7
  • 20
16
votes
1 answer

ScintillaNET vs AvalonEdit for providing scripting interface for a WPF Application

I am working on a project which includes implementing a scripting interface for my WPF (.Net4) windows Application. I am curious if anyone can suggest a preferred editor, AvalonEdit vs ScintillaNET. Any pitfalls and advantages of one over the other.…
Bhuvan
  • 1,523
  • 4
  • 23
  • 49
16
votes
4 answers

BOO Vs IronPython

What is the difference between IronPython and BOO? Is there a need for 2 Python-like languages?
Ted Smith
  • 9,415
  • 16
  • 50
  • 52
16
votes
2 answers

Has anyone used SciPy with IronPython?

I've been able to use the standard Python modules from IronPython, but I haven't gotten SciPy to work yet. Has anyone been able to use SciPy from IronPython? What did you have to do to make it work? Update: See Numerical computing in IronPython…
John D. Cook
  • 29,517
  • 10
  • 67
  • 94
16
votes
1 answer

How do I create a .NET assembly in IronPython and call it from C#?

I want to create an assembly using IronPython can call it from C#. Here are two things I am not asking. I'm not asking how to call C# from IronPython. The easiest documentation to find describes how to call C# from inside IronPython. (For example,…
John D. Cook
  • 29,517
  • 10
  • 67
  • 94
16
votes
6 answers

What are some strategies to write python code that works in CPython, Jython and IronPython

Having tries to target two of these environments at the same time I can safely say the if you have to use a database etc. you end up having to write unique code for that environment. Have you got a great way to handle this situation?
minty
  • 22,235
  • 40
  • 89
  • 106
16
votes
3 answers

Pros and cons of IronPython and IronPython Studio

We are ready in our company to move everything to Python instead of C#, we are a consulting company and we usually write small projects in C# we don't do huge projects and our work is more based on complex mathematical models not complex software…
Mark
  • 10,754
  • 20
  • 60
  • 81
16
votes
3 answers

Visual Studio - "The environment IronPython|2.7-32 appears to be incorrectly configured or missing"

Steps to the Reproduce: Open Visual Studio 2017 (Pro on Windows 10 64-bit) File > New Project > IronPython Application Run the default program: print('Hello world') When I run it, I get the following error: The environment "IronPython|2.7-32"…
Doug Null
  • 7,989
  • 15
  • 69
  • 148
16
votes
3 answers

How can I redirect the stdout of IronPython in C#?

I have the following: public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button3_Click(object sender, EventArgs e) { try { var strExpression = @" …
Begtostudy
  • 1,374
  • 4
  • 13
  • 28
16
votes
2 answers

How to fetch process,thread name,levelname in customized python logger

I am developing customized logger program,as per the requirement i need to fetch the process,thread and name of object Inside the called function(In below example its obj needs to fetch inside the get_configured_logger function) and class name to…
user1559873
  • 6,650
  • 8
  • 25
  • 28