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

How to convert raw_input() into a directory?

I just picked up IronPython and I've been trying to get this IronPython script going but I'm stuck at trying to get a Path input from raw_input to be a directory path. The first block of code is the broken one that I'm working on. import System from…
Azeworai
  • 772
  • 3
  • 9
  • 25
1
vote
1 answer

PySerial and IronPython - get strange error

I have a device connected to COM31. And the code that I need to create a serial connection looks very simple port = 31 trex_serial = serial.Serial(port - 1, baudrate=19200, stopbits=serial.STOPBITS_ONE, timeout=1) The foollowing code works when I…
Sergey
  • 978
  • 2
  • 11
  • 33
1
vote
1 answer

Getting path string from Excel in IronPython

I am trying to set working directory through IronPython. Its basically for ANSYS Workbench. I am getting the directory path from excel and i am storing it in a variable in IronPython. dirpath = worksheet.range["E25"].value and I am giving this…
Kartiki
  • 95
  • 2
  • 14
1
vote
1 answer

Spotfire Export Automatically

I'm not at all sure that what I need is possible with the tools that I have, but I thought I'd ask. I have the following Python script (technically IronPython, but I don't fully understand the difference), that I pulled from a blog and modified for…
user4588747
1
vote
4 answers

Using SQL Alchemy and pyodbc with IronPython 2.6.1

I'm using IronPython and the clr module to retrieve SQL Server information via SMO. I'd like to retrieve/store this data in a SQL Server database using SQL Alchemy, but am having some trouble loading the pyodbc module. Here's the setup: IronPython…
beargle
  • 13
  • 1
  • 3
1
vote
1 answer

Cant add events for controls in WPF IronPython VS2010

I installed VS2010 and IronPython tools. When I start a VB.NET WPFProject everything works fine. But when I start a WPF IronPython project, it creates a button by default which fills all the window, and when you try to add an event to that control…
Meli
  • 151
  • 3
  • 13
1
vote
0 answers

Failed to attach debug in python tool visual studio

I have a problem with "attach to process" in python tool in vs. If I attach to process before the next line:"import clr" , everything is ok and I can debug. If I attach after this line I failed to debug and get "... No symbols have been loaded..." I…
yudi
  • 13
  • 3
1
vote
0 answers

Creating a Python engine for debug within a parent Python engine

I'm working on an IronPython script that is to be executed by another 3rd party application (Ansys HFSS) that provides a scripting interface for automation, etc. Since I am also creating a graphical interface to the script I am using SharpDevelop…
steven_p
  • 111
  • 3
1
vote
1 answer

How to workaround IronPython Compile() Issue?

I'm trying to run the following in my C#/IronPython: import re Message = re.sub(r"^EVN\|A\d+", "EVN|A08", Message, flags=MULTILINE) This works fine on real python at the command prompt. However, once I put it into IronPython I get an…
John S.
  • 1,937
  • 2
  • 18
  • 28
1
vote
1 answer

Adding a DataGridView in IronPython Studio Winforms gets a "'DataGridView' object has no attribute 'BeginInit'"

By just adding a datagridview in IronPython Studio it triggers a "DataGridView' object has no attribute 'BeginInit'". Is there a fix for this? The errors are gone if the lines self._DataGridView1.BeginInit() and self._DataGridView1.EndInit() are…
Meli
  • 151
  • 3
  • 13
1
vote
1 answer

Dynamically Displaying Images in a Text Area

I'm trying to make a script that does something similar to what is presented in this post: http://spotfire.tibco.com/tips/2014/02/25/dynamically-displaying-images-in-a-text-area/ The only difference is that I'm trying to use images that I have saved…
cholmes
  • 11
  • 1
  • 2
1
vote
1 answer

How to use AWS from IronPython

How do I got about installing the boto library on IronPython so that I can access Amazon web services? Is this possible?
xorsyst
  • 7,897
  • 5
  • 39
  • 58
1
vote
0 answers

How does IronPython pass an object to a C# method that expects an interface?

I'm trying to call public SocketInitiator(Application application, MessageStoreFactory storeFactory, SessionSettings settings, LogFactory logFactory) Now the second argument is an interface: namespace QuickFix { public interface…
gbronner
  • 1,907
  • 24
  • 39
1
vote
1 answer

IronPython strange behaviour

I have file A.py: ... from System.IO import Directory ... execfile('B.py') and file B.py: ... result = ['a','b'].Contains('a') Such combination works fine. But if I comment this particular import line at A.py then B.py complains: AttributeError:…
Alex
  • 4,457
  • 2
  • 20
  • 59
1
vote
1 answer

DoEvents() in IronPython WPF application

I'm looking for an equivalent of Application.DoEvents for an IronPython WPF application. I've found a few examples in C#, but I've had no luck translating them to IronPython, eg: private void DoEvents() { …
900RK
  • 11
  • 1
1 2 3
99
100