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

IronPython Variable keeps getting extra characters during datatable column value assignment in Spotfire

when I run this code it keeps putting in ( and surrounding ' marks. for column in dataTable.Columns: a=a,column.RowValues.GetFormattedValue(row) a keeps printing out as this (('10/13/2015'),'Oranges') How can I make it just set…
Keng
  • 52,011
  • 32
  • 81
  • 111
1
vote
1 answer

How do I refer to a spcific datatable in IronPython in Spotfire?

I need to refer to a specific datatable in Spotfire in IronPython. currently I'm seeing references to this but the datatable I need 'may' not be the one that is active. Document.ActiveDataTableReference
Keng
  • 52,011
  • 32
  • 81
  • 111
1
vote
0 answers

python tools on visualstudio doesn't debug exceptions

I'm running VS pro 2015 with Python Tools. When I run Python code which has to throw an exception I got only a flashing and unreadable exception in the program window. For example I expect that this code: a = 1 + "hello" move the focus from the…
Cristiano
  • 131
  • 7
1
vote
2 answers

WPF getter called multiple times

I have simple wpf window:
causa prima
  • 1,502
  • 1
  • 14
  • 24
1
vote
1 answer

sympy import error in IronPython 2.7

I'm trying to use the sympy library in my python script, but I'm getting an error when I try to import it. How do I fix this?
Rahul
  • 1,056
  • 2
  • 9
  • 26
1
vote
1 answer

How to display file path in a Spotfire DXP

i am using an excel file as a data table. how can I diplay the path of that file in text area(visualization), may be some ironpython scripting?
sql84
  • 113
  • 1
  • 4
  • 13
1
vote
1 answer

Call .dll function from C# Ironpython

Using Ironpython, I created a .dll from a .py file. It has classes and respective functions that I want to call to be used in c#. I created the .dll so that I can hide the source from the user. Here is what I have tried: ScriptEngine engine =…
user5041986
1
vote
1 answer

Gui form created via ironPython freeze while processing

import clr clr.AddReference("System.Drawing") clr.AddReference("System.Windows.Forms") from System.Drawing import Point from System.Windows.Forms import Application, Button, Form, Label class HelloWorldForm(Form): def __init__(self): …
komizo
  • 1,052
  • 14
  • 21
1
vote
1 answer

Spotfire Ironpy how to edit specific visualization

In all the Spotfire IronPy tutorials the visualizations are defined this way: vc = detailsVis.As[VisualContent]() My question is how do I define an object for a specific visualization? Can I do it by title? Can I do it by objectid? Basically, I…
SwolleyBible
  • 243
  • 7
  • 20
1
vote
1 answer

Pass user defined type to C# from IronPython

The C#/.NET library (.dll) I interface with has many user defined enumerated types that I wish to pass as parameters, for example, public enum fieldType_e { FIELDTYPE_NONE = 0, // 0 - Field FIELDTYPE_1, // 1 -…
onch
  • 43
  • 6
1
vote
1 answer

How to use decorator?

In SharpDevelop, I want to create a dll which contains a static methon, void Main(string[] args). Some one said I should use decorator to restrict the function in IronPython. I found "@staticmethod", but others, "void", "string[] args", how to…
Begtostudy
  • 1,374
  • 4
  • 13
  • 28
1
vote
1 answer

How does one retrieve a c# byte array (Byte[]) from IronPython?

I have a c# function that I can call from IronPython. The function returns a byte array that I'd like to convert to a string for display and compare. Python is telling me to pass the input parameter - (out Byte[] DataOut), below - as type…
onch
  • 43
  • 6
1
vote
2 answers

Output Spotfire 'print' to text file

I have been struggling with something I hope to be a simple question. I would like to output values (String / Real / Stringlist) from Spotfire to a text file on my computer. My final solution would need document properties to be listed and saved,…
Freddy
  • 419
  • 8
  • 16
1
vote
1 answer

SetVariable to Enum with Iron Python

Is it possible to do something like this? public enum Letter { A, B, C } // Suppose I have a scope already set up for Iron Python scope.SetVariable("Letter", Letter) This, of course, is wrong, but it's in hopes of achieving something like this in…
Luca
  • 171
  • 1
  • 13
1
vote
3 answers

jinja2 encoding error in python

So I am trying to use jinja2 for a simple html template but I keep getting this error when I call render(): Warning: IronPythonEvaluator.EvaluateIronPythonScript operation failed. Traceback (most recent call last): File "C:\Program Files…
konrad
  • 3,544
  • 4
  • 36
  • 75