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
1
vote
1 answer

Does ironpython have libraries that replace the pywin32 extensions?

I have some old python code that uses the pywin32 extensions. Starting out with .net, I would like to port it to ironpython. The old python code uses things like pythoncom.com_error, pywintypes.Time and interfaces a COM module that implements the…
Torleif
  • 2,334
  • 3
  • 27
  • 28
1
vote
1 answer

How do I get Python controls into the toolbox in VisualStudio

I want to create a WinForms IronPython app. I have installed IronPython, but the toolbox is empty. How to I add Python controls to it?
ManInMoon
  • 6,795
  • 15
  • 70
  • 133
1
vote
1 answer

dynamic values in kwargs

I have a layer which helps me populating records from the form to tables and viceversa, it does some input checking, etc. Now several methods of this layer which are called several times in different parts of the webform take the same parameters,…
Pablo
  • 4,821
  • 12
  • 52
  • 82
1
vote
2 answers

IronPython submodule import

I have a generic issue with IronPython module import processing. Given a Python package, submodules can refer to each other with relative references. Assume the package is called Poultry and submodules within it are Chicken.py and Duck.py. Chicken…
1
vote
0 answers

IronPython documentation by sphinx

Is it possible to document IronPython code with sphinx or is there another tool to document IronPython code Thanks Ilan
user3315504
  • 1,055
  • 2
  • 12
  • 17
1
vote
1 answer

Does IronPython support multiprocessing?

Using IronPython 2.7 (IronPython 2.7 2.7.5.0 on .NET 4.0.30319.42000), I have a script which includes from multiprocessing import Pool. Trying to run it, I get the following error: Traceback (most recent call last): File…
user200783
  • 13,722
  • 12
  • 69
  • 135
1
vote
1 answer

which argtypes for NetShareAdd

The win32 function NetShareDel takes three arguments, LPCWSTR LPCWSTR and DWORD. So I use the following list for argtypes: import ctypes as C C.windll.Netapi32.NetShareDel.argtypes = [LPCWSTR, LPCWSTR, c_int] C.windll.Netapi32.NetShareDel.restype =…
Serve Laurijssen
  • 9,266
  • 5
  • 45
  • 98
1
vote
1 answer

Why XmlNode.SelectNodes returns empty list when XPath validator returns correct result?

The code is in IronPython and here it is: for systemNode in csResultXML.SelectNodes("Response/SubSystems/SubSystem"): itemNodes = systemNode.SelectNodes('/SubSystem/Items/Item') The value of systemNode in the single loop cycle is:
Срба
  • 463
  • 3
  • 17
1
vote
2 answers

Is there a way to use IronPython objects and functions (compiled into an assembly) from C# code?

IronPython.net documentation says the MSIL in the assembly isn't CLS-compliant, but is there a workaround?
Jean-Pierre Chauvel
  • 946
  • 2
  • 9
  • 21
1
vote
1 answer

Is it possible to use psycopg2 with IronPython in a Windows Form app?

I built a Windows Form to gather information about projects. This information is then uploaded to a database. Actually, I'm using a Python script to do that (the required information is therefore hardcoded in the script by the user). I would like…
kaycee
  • 901
  • 1
  • 9
  • 35
1
vote
1 answer

How can I enable sys._getframe in IronPython 2.6.1?

I'm trying to use a module that requires sys._getframe(), which, as I understand it, is not enabled by default. I've seen a lot of material that suggests that there is a way to enable _getframe(), but I've yet to find anything that tells me how to…
JustOnePixel
  • 689
  • 1
  • 7
  • 16
1
vote
1 answer

Open file in ironpython by clicking on a button

I would like to open a PDF document via a button. I don't seem to find what I need. When the button is clicked, it will open the document based on the path provided (i.e. "c:\test\abc.pdf"). Is there a main command that would open any document type…
FNW
  • 11
  • 2
1
vote
1 answer

Does IronPython .net based DLL need to be deployed with Python Standard Library if it uses the Standard Library?

If I reference the Python Standard Library using IronPython do I have to deploy any Python related libraries or runtimes along with my .net dll? Or, can I just deploy the dll?
Ralph Caraveo
  • 10,025
  • 7
  • 40
  • 52
1
vote
0 answers

IronPython fails to import on Linux Mint, but not on Windows

I'm trying to import some .py files into another .py file. It's pretty simple, but I'm getting an error about it being unable to import anything. Here's my error: IronPython.Runtime.Exceptions.ImportException: No module named…
1
vote
1 answer

Python Triple Quoted Strings in Visual Studio 2010

I'm used to using Idle for Python development, but decided to give Visual Studio 2010 + IronPython a try last week. It seems to work fine, but I noticed that triple-quoted (multi-line) strings don't highlight correctly in the editor. See…
crgwbr
  • 265
  • 2
  • 16