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

Adding paths to IronPython

I have a C# application that uses IronPython to run Python scripts. I have added the references for IronPython successfully and can run simple Python scripts. The problem I have is running Python scripts that import modules. I know I have to…
1
vote
1 answer

Pip in Visual Studio not installing packages

Whenever I try to install a package ('theano', in this case) it gives me this: ----- Installing 'theano' ----- Unhandled exception: Traceback (most recent call last): File "C:\Program Files (x86)\IronPython 2.7\Lib\runpy.py", line 170, in…
Shyy Guy
  • 232
  • 3
  • 18
1
vote
2 answers

IronPython - How do I import Gzip?

I am trying to use IronPython under VS 2010. I need Gzip, but there is no (that I can find) documentation to tell me how to "reference" or add a module. Can anyone tell how to add Gzip please.
ManInMoon
  • 6,795
  • 15
  • 70
  • 133
1
vote
1 answer

How to get handle of a known data table

I am hoping to figure out the answer of a seemingly simple question. Below I was trying to get the handle of a known table, by the name of "TableMe". Being able to print its name back on the screen would prove that I have got the handle correctly.…
J.Williams
  • 11
  • 1
1
vote
2 answers

TIBCO Spotfire - Insert Calculated Row

I'm trying to insert rows to the table in Spotfire that are a sum of existing rows Existing Table: ID SUB_ID Line Quarter Value 1 123 A 1 1 1 123 A 2 2 1 123 B 1 3 1 123 B 2 …
user3783314
  • 21
  • 1
  • 6
1
vote
0 answers

IronPython 2.7 accented characters (SyntaxErrorException)

I have a C# application in which I use to run a Python script using accented characters (ÀÉÈÏ etc.). To do that I use Iron Python. My script works fine with Python 3.5.1 (in the IDLE) but since Iron Python execute it as a Python 2.7 script my…
Marks
  • 165
  • 4
  • 19
1
vote
1 answer

Current State of Mouse using IronPython and .Net

I am running Python inside Grasshopper which is a plug-in for Rhino3d. I can easily get the mouse position, but fail to just check whether a mouse button is currently pressed. How exactly the piece of software in which this script is running is…
user1602492
1
vote
2 answers

IOError when loading NLTK perceptron tagger

The code is simple as follows import nltk nltk.data.path.append(r"E:\nltk_data") nltk.pos_tag(["hello"]) And the error is File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\nltk\tag\__init__.py", line 110, in pos_tag tagger =…
ozgur
  • 2,549
  • 4
  • 25
  • 40
1
vote
1 answer

How to Import 3rd party Python Library on IronPython Library in ASP.net

I have a function that executes a python script. The python script calls the jira library to connect to it's server. Then it will return data and will create an excel file for it. The python script is running ok when I executed manually, but the…
Dave
  • 205
  • 2
  • 7
  • 22
1
vote
0 answers

Is there a way to assign Python options inside the script?

For IronPython to import some modules it requires -X:Frames option to be passed. (ipy -X:Frames) However, when using Visual Studio we can only assign this option if we use interactive window. To execute a Python file there is no way that I know to…
ozgur
  • 2,549
  • 4
  • 25
  • 40
1
vote
0 answers

Type Error: can join an iterable of bytes

I am new to Python programming. Using IronPython 2.7.1, intend to import data from excel using python. Using xlrd pacakage to import. I have only these two lines in my file from xlrd import open_workbook book = open_workbook('test.xls') This…
Srikanth
  • 11
  • 1
1
vote
1 answer

how do I import mysql data with ironpython

i am seeking assistance on a way I can import sql data into a database via ironpython script. currently my script is as follows, first this script runs: import clr; import System; clr.AddReference("TCAdmin.SDK"); from TCAdmin.SDK.Misc import…
1
vote
1 answer

ironpython: "EOL" while scanning single-quoted string and invalid syntax

When i test my script i receive an EOL error, but i am not seeing any reason why i would be getting this error. there is no " character, no paths where i need to double up on the \ all i can think is because it is multiple lines or whitespace? how…
1
vote
1 answer

OpenFileDialog in IronPython

I have following example of code. I'm trying OpenFileDialog in Iron Python, but program just freezes instead of opening dialog window. #!/usr/bin/ipy import clr clr.AddReference("System.Windows.Forms") clr.AddReference("System.Drawing") from…
Alexander
  • 51
  • 2
  • 6
1
vote
1 answer

Inverse hyperbolic sinus returns nan in Ironpython2.7

I am trying to use asinh function from math module in Ironpython 2.7. Anytime I have a float < -1, I get nan as a result. I know that in cmath they are some branch cuts due to the potential use of complex numbers, but here I work with reals and the…
Jacques Gaudin
  • 15,779
  • 10
  • 54
  • 75