Questions tagged [ironpython]

1

votes
0

answer
43

Views

Dynamic color changing data table

I have a very basic GUI that I created using Ironpython. Inside the GUI there is a button and a table. The goal is to click the button and after few calculations the table will be filled with the results of the calculation. However, I had like to be able to change the color of each row depanding on...
Ben
1

votes
0

answer
152

Views

Defining window buttons in ironpython wpf

I have made a simple GUI where I added manually the close, minimize and maximize buttons. However, I cant figure out how to add the command that once I click them, they do what expected. The code looks as following: import wpf from System.Windows import Application, Window from teleb_Data import boo...
Ben
1

votes
1

answer
83

Views

Ironpython missing stack frames if executed in scope

If I execute this code: var engine = Python.CreateEngine(); ScriptScope sc = engine.CreateScope (); var ss = engine.CreateScriptSourceFromString ('\ndef f():\n raise Exception('hello generator')\n yield 42\n\ndef g():\n f().next()\n\ng()\n', 'a.py'); try { ss.Execute(); } catch(Exception e)...
Enerccio
1

votes
1

answer
241

Views

Can IronPython 2.7 call async .NET functions?

Have embedded IronPython 2.7 in my app, and use clr.AddReference() to a managed .NET dll. That DLL has async functions such as: async public Task Foo(string x) { string y=await bar(x); return y; } When called from IronPython I can see the Task object on the return but not the result of the call. I...
Barry Briggs
1

votes
0

answer
293

Views

how to change formatting of calculated values(text area) in spotfire using iron python

I am trying to toggle Calculated values in text area format from number to currency and vice-versa from a drop down using iron python and i didn't find anything. please let me know if there is a way to implement this. Thanks
SFU54
1

votes
0

answer
260

Views

Can function with IronPython dependencies be called from ASP.NET Core?

I'm working on a simple ASP.NET Core MVC project I would like to call a function from a controller. This function - RunPyScript() - can be found in a .NET framework class library. public static string RunPyScript(string sentence) { var options = new Dictionary(); options['Frames'] = true; options['...
dobokocka
1

votes
0

answer
102

Views

Importing dateutil package in ironpython script

I try to import dateutil package with my IronPython script but I get an error unexpected token '='. The error comes from this file: ...\Python36\Lib\string.py. My script is executed by ScriptEngine class from Microsoft.Scripting.Hosting and it goes like this: import sys sys.path.append(r'C:\Program...
Lukasz
1

votes
0

answer
263

Views

Import Numpy Package for IronPython

So I'm building an app using C# that requires calling a python script which needs to import numpy. My python version is 3.6 and I am running IronPython 2.7 (64-bit). This is the error I'm getting. 'Original error was: cannot import multiarray from numpy.core'. Is there any way I can reference Numpy?...
JohnTheWizard
1

votes
0

answer
35

Views

IronPython access .NET instances

I developed a .NET application. It includes WinForms and public classes. I would like to add python scripting support for my application, so user can interactively access already created .NET class instances. I see IronPython maybe a good choice. I have played with it and found it can easily call my...
shenh
1

votes
0

answer
75

Views

How to install gensim for IronPython?

I am trying to use gensim through IronPython, but installing this package seems to be impossible. I tried it with IronPython 2.7.7. with the following commands: ipy -X:Frames -m install ensurepip ipy -X:Frames -m pip install setuptools ipy -X:Frames -m pip install gensim Does anyone know if it is po...
1

votes
0

answer
355

Views

Spotfire custom format column / tooltip via IronPython or TERR

I have a visualization that plots from a data table that is being replaced by a TERR function every time a marking is changed. The problem is that my custom formatting for the table columns is lost every time the table is replaced. Basically I want a few of my tooltips based on my columns to have...
shwan
1

votes
0

answer
23

Views

Does IronPython support C# dynamic type?

I have a C# code that I would like to convert to IronPython. One part of the code uses dynamic type to construct an object similar to the following construct: dynamic user32 = new DynamicDllImport('user.dll', callingConvention: CallingConvention.Winapi); user32.MessageBox(0, 'Hello World', 'Platform...
Matt S.
1

votes
0

answer
111

Views

trying to return value from python file to c# using IronPython

i am using a c# windows forum and running a python file using iron python, the file is running but i would like to be able to use the output on c# private void button1_Click(object sender, EventArgs e) { ScriptEngine engine = Python.CreateEngine(); engine.ExecuteFile(@'hi_test.py'); } python pr...
the pro-gramer
1

votes
0

answer
570

Views

Exporting the Cross Table visualization to Excel in Spotfire

I am trying to export the Cross Table visualization to an Excel through an Iron Python Script. The below code works perfectly for a data table export. Could you please guide me in exporting it from a Cross Table. from Spotfire.Dxp.Data.Export import DataWriterTypeIdentifiers from System.IO import F...
san
1

votes
0

answer
25

Views

Passing an argument to a function of class from C# using ironpython.

NET programming and I don't know how to pass an argument from .NET to a class function in python script supported by ironpython Here is my .cs script. using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; using IronPython.Hosting; namespace PrintToConsole { int...
Abraham Jose
1

votes
0

answer
88

Views

Reading from a Spotfire Database DataSource without loading it to a table

I am working on an IronPython script that pulls some new data from an oracle database, using DatabaseDataSource. I can get the script to pull the data just fine if I just overwrite or append to a table as the output. However, I would like to handle the output of one query in my script, and then use...
wcase6
1

votes
0

answer
1.9k

Views

How to execute Python Script file from c#.net

I'm completely new for both python and ironpython,help me to execute python scripts from c# without using ProcessStartInfo My python Code. import sys from PIL import Image img = Image.open('c:\python27\Image.png') img.show() My C# Code is, var engine = Python.CreateEngine(); var searchPaths = engi...
udya
1

votes
0

answer
438

Views

Cannot import name _remove_dead_weakref

IronPython outputs the exception: 'Python exception : Cannot import name _remove_dead_weakref'. Here is my python code: import sys sys.path.append(r'D:\Program Files\Python2.7\Lib') import tarfile #errror occurs only if importing tarfile print('success') sys.exit() It runs sucessfully on cmd too...
Sandiago.C
1

votes
1

answer
258

Views

How to explicitly tell user to wait until script finishes in Spotfire

I need some advise accomplishing the action on the title o this thread; let me elaborate, I have a Spotfire analysis where the data to be used is controlled by a cascading set of drop-down menus, each one linked to a document property. The way it works is that the user selects a value in the 1st dro...
Mario Reyes
1

votes
0

answer
66

Views

Get screenshot of android Device

I try to get screenshot of android device using appium since there is no solution with appium to get video/see app on real time. I have function of C# to get image (screenshot) public Image GetImages() { Image screen_shot = null; try { if (driverAndroid == null) { return screen_shot; } var screensho...
Med Amin
1

votes
0

answer
153

Views

IronPython in Visual STudio

I have installed the latest IronPython build in Windows, and also installed the Python tools in Visual Studio 2017 Community Version. However, when I tried to use the IronPython 2.7 as the Python environments, and tried to install the packages through pip. It comes into errors: ----- Installing 'pip...
user6539552
1

votes
1

answer
56

Views

Intersection of parameter sets in Revit-Api

I'm trying to explore Quick, Slow and LINQ filter in Revit API using Python. So I decided to create universal filter to any category by filtering parameters values or Family/Category/Symbol. Now I have a set of elements of different categories (Walls, Floors, Family Symbols, ect) came from the Filte...
A.Balm
1

votes
0

answer
54

Views

ironpython read XML with xmlns

I am a beginner and trying my best with iron python and .Net libraries for XML. I received an XML file looking like: 3 Peter 4 Sue I constantly fail to read the xml. My code for reading is: def readXml(): doc = XmlTextReader(filename) while doc.Read(): if doc.NodeType == XmlNodeType.Element and doc....
user3460882
1

votes
1

answer
137

Views

Triggering email out of Spotfire based on conditions

Does anyone have experience with triggering an email from Spotfire based on a condition? Say, a sales figure falls below a certain threshold and an email gets sent to the appropriate distribution list. I want to know how involved this would be to do. I know that it can be done using an iron python s...
Scott Russell
1

votes
0

answer
25

Views

Creating Dictionary from Excel file in IronPython

The only main difference between IronPython and Python, is basically I can't use pandas in IronPython. I have an excel spreadsheet where I want the first column to be the keys, and the second column to be the values for each of the keys. Is there as simple way to do this?
Marwan A. Sallam
1

votes
0

answer
58

Views

Add a vertical line based on click

I have a Spotfire visualization plot (scatter plot) when a user clicks on any point on the plot, how can I put a vertical line there and export corresponding x-axis value? Guessing I should script in R or Ironpython?
c.Parsi
1

votes
0

answer
37

Views

Spotfire excel export with merged cells

I am using iron python script to export Spotfire crosstable to excel ouput. Before exporting i am adding headings and then table content. while adding a haading is there a way to merge cells and export i am using the below string Heading10= ',,,' + 'All Funds' + ',,,' + 'Benchmark' + ',,,,...
venkatesh selvaraj
1

votes
0

answer
26

Views

Adding tables in spot fire without doing it manually

I am using Smartsheet as a data source for Spotfire tool. In Smartsheet, we are having lots of tables. By using that table some analysis made in Spotfire... Smartsheet will update new tables daily instead of adding each table into Spotfire manually. Is there any way to automate it?
vel murugan
1

votes
0

answer
28

Views

Spotfire automation options for non-administrator developers?

I have developed a Spotfire dashboard and would like to automate the following: Update tables from a csv-file shortly after a certain csv-file gets created outside of Spotfire. Save the dashboard after the update is over. The problem is that at my company the dashboard still has internal status 'in...
r_a
1

votes
0

answer
65

Views

Pythonnet Error: XamlParseException : 'Failed to create a 'Click' from the text

I was working on IronPython before (with WPF for developing some GUIs), and recently I started to try pythonnet. But I found that the xaml file that worked on IronPython does not work on CPython + pythonnet. In IronPython, I can define a Button.Click in the xaml file, but it seems not possible in C...
Y.Wang
1

votes
0

answer
50

Views

Filter Out Rows In Two Filtering Schemes Using IronPython

I have a dashboard that uses two subsets to filter different date ranges. Each subset uses one filtering scheme. I would like to add the 'filter out' functionality to both filtering schemes at once. Is it possible? Spotfire has the option to right-click -> Marked Rows -> Filter out, but it only affe...
Oliver Drummond
1

votes
1

answer
122

Views

(Ironpython/Winforms) Retrieve value from textbox made in for loop

I am using ironpython and winform to create textboxs in a for loop. I am having issues getting the values of the textbox that were created. An example is that I am unable to get the value of self.name1.Text when a button is clicked that is suppose to retrieve that value. import clr clr.AddReference...
Ayano Sugiura
1

votes
0

answer
35

Views

IronPython: SetVariable array2D in c#

I'm making a software to use a Python script (IronPython) in c#. The code is: using IronPython.Hosting; using IronPython.Runtime; using Microsoft.Scripting; using Microsoft.Scripting.Hosting; ... ... private void RunScript() { ScriptEngine engine; ScriptRuntime runtime; ScriptSource source = null; S...
Max
1

votes
0

answer
46

Views

Exception (“Cannot access a disposed object”) thrown when trying to install packages in IronPython via pip

I'm getting the error below when trying to install packages in IronPython via pip. I've tried running cmd as an Administrator and also adding '--user' in the command, but it always leads to the same error. I get the same error if if I try to install different packages - so it shouldn't be because of...
Dragos Manta
1

votes
0

answer
210

Views

Ironpython 2.7.9 ImportException: 'No Module Named errno' when importing another module in .NET application

I am attempting to run a simple python script within my .net application using IronPython. I have installed the nuget package into the project (I have NOT installed the ironpython cli on my machine) and have authored this code to handle setting paths, reading output, and setting input. this.engine =...
MichaelCook
1

votes
1

answer
33

Views

Insert total rows in a table, without using Pandas but using only loops

I have a table like this - Cell Sales Lag 0 -8 1 1 -8 3 1 2 -8 2 3 3 -7 9 4 -7 3 9 I want to insert a Total row that takes the last value of 'Sales' column for each cell group and insert it in the 'Sales' column, and takes the first value of the 'Sales...
Ezio
1

votes
0

answer
184

Views

IronPython : Microsoft.Scripting.SyntaxErrorException: 'unexpected token '=''

I have a Python scrirpt and that I am trying to execute from C# code using IronPython and I am getting the below error message: Microsoft.Scripting.SyntaxErrorException: 'unexpected token '='' Here is my Python code: import logging logging.basicConfig(filename='c:\\rahul\\example.log',level=logging....
Rahul Bhatia
1

votes
0

answer
70

Views

Navigate page in Spotfire by clicking on a Javascript element in JS Viz?

I have created a JS Viz in Spotfire using Datatables.js I want to navigate to another page, by clicking on a number in the table (each column corresponds to a specific page/tab in spotfire) I know that navigation can be done by triggering a script , but thats usually bound to an action item having a...
Shricharan Arumugam
1

votes
0

answer
67

Views

Trying to do linear algebra with IronPython

With CPython i would use numpy.linalg for linear algebra (svd) calculation, but numpy doesn't work with IronPython (i got import error with multiarray module). IronPython is mandatory, because i use a software with an embedded IronPython. I can't find on the internet a functionnal library for IronPy...
Jocelyn
1

votes
0

answer
47

Views

Instantiating a python 3.6 class in C#

I'm trying to find a way to create an instance of a Python class in C# I came across IronPython and this question: Instantiating a python class in C# However, looking closely it seems it's only designed for Python 2.7, and I couldn't find anything for 3.6 . Is there something that allows me to use 3...
Shtut

View additional questions