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
23
votes
2 answers

How to install NumPy for IronPython in 2017?

I have found the old answer to this question, but the instructions provided in the mentioned post are no longer working... Essentially the URL where NumPy for IronPython was stored is broken. How to install NumPy for IronPython in 2015/2016
Krystian Sakowski
  • 1,613
  • 14
  • 20
23
votes
5 answers

Compiling an IronPython WPF project to exe

What is the best way to pack up an IronPython application for deployment? After scouring the web the best thing I've come up with (and what I'm currently doing) is using clr.CompileModules() to glue together my entire project's .py files into one…
Aphex
  • 7,390
  • 5
  • 33
  • 54
23
votes
8 answers

What's the simplest way to access mssql with python or ironpython?

I've got mssql 2005 running on my personal computer with a database I'd like to run some python scripts on. I'm looking for a way to do some really simple access on the data. I'd like to run some select statements, process the data and maybe have…
Eugene M
  • 47,557
  • 14
  • 38
  • 44
23
votes
3 answers

Integration of python in C# Application

I have the following problem: I got an old application which is written in python. This application allows the user to specify small python steps which will be executed, python steps are basically small python scripts, I call them steps because the…
Xeun
  • 1,089
  • 1
  • 11
  • 20
21
votes
6 answers

How to use IronPython with App.Config?

I have a class library that is usually called from a .net console or web application. It integrates with various components, and relies on an app.config or web.config. If I want to utilise the class library from script (i.e. IronPython), how can I…
Andrew Rimmer
  • 3,882
  • 6
  • 30
  • 35
21
votes
13 answers

Shuffle string c#

I want to know shuffle string Example string string word; //I want to shuffle it word = "hello" I would be able to get: rand == "ohlel" rand == "lleho" etc.
ksmakkapawee
  • 275
  • 1
  • 4
  • 10
21
votes
3 answers

Importing external module in IronPython

I'm currently working on an application written in C#, which I'm embedding IronPython in. I generally have no problems about it, but there's one thing that I don't know how to deal with. I want to import an external module into the script. How can…
uolot
  • 1,480
  • 1
  • 13
  • 18
21
votes
10 answers

Iron python, beautiful soup, win32 app

Does beautiful soup work with iron python? If so with which version of iron python? How easy is it to distribute a windows desktop app on .net 2.0 using iron python (mostly c# calling some python code for parsing html)?
Vasil
  • 36,468
  • 26
  • 90
  • 114
20
votes
2 answers

Pure python implementation of greenlet API

The greenlet package is used by gevent and eventlet for asynchronous IO. It is written as a C-extension and therefore doesn't work with Jython or IronPython. If performance is of no concern, what is the easiest approach to implementing the…
Tristan
  • 6,776
  • 5
  • 40
  • 63
20
votes
3 answers

IronPython 3 support?

Yes, I know about IronPython 3 compatibility, but that is from two years ago. I was searching on the internet but couldn't find any information on this that is up-to-date. So does IronPython support Python 3? If not, how many of the future imports…
nyanpasu64
  • 2,805
  • 2
  • 23
  • 31
19
votes
1 answer

Referencing Python "import" assemblies when calling from IronPython in C#

I'm a complete noob when it comes to IronPython. I need to call a py script from an ASP.NET website, and have the following code: var ipy = IronPython.Hosting.Python.CreateRuntime(); dynamic test =…
pfeds
  • 2,183
  • 4
  • 32
  • 48
18
votes
2 answers

How do I convert from a .NET DateTime to an IronPython datetime?

I'm calling an IronPython script and passing it a .NET object that contains a DateTime structure. I'm trying to use IronPython's JSON support to serialize the object as JSON. Everything works great until I encounter the .NET DateTime. How do I…
ScArcher2
  • 85,501
  • 44
  • 121
  • 160
18
votes
3 answers

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 switch I can pass to ipy.exe?
Leo Bontemps
  • 437
  • 1
  • 4
  • 9
18
votes
1 answer

Errors accessing .NET class method overloads in IronPython

I have a class I've written in C#. The class has two methods, the signatures being: bool Navigate(string url) bool Navigate(Uri url) From what I gather, the IronPython runtime is supposed to try and select the best overload based on the passed-in…
Nathan Ridley
  • 33,766
  • 35
  • 123
  • 197
18
votes
5 answers

What is the equivalent of the C# "using" block in IronPython?

What's the equivalent of this in IronPython? Is it just a try-finally block? using (var something = new ClassThatImplementsIDisposable()) { // stuff happens here }
Josh Kodroff
  • 27,301
  • 27
  • 95
  • 148