ironpython

Ironpython - Named parameters to constructor

谁说胖子不能爱 提交于 2019-12-11 08:14:49
问题 When I create an instance of my C# class in IronPython with named parameters to the constructor, it is setting properties corresponding to the names of the parameters. I wish to disable this behavior so I can have better control on the order the properties are evaluated. Is this possible? 回答1: There's no way to turn this off without modifying IronPython. 来源: https://stackoverflow.com/questions/2517367/ironpython-named-parameters-to-constructor

ImportError: No module named wpf (in Revit environment only) - User interface

℡╲_俬逩灬. 提交于 2019-12-11 06:45:32
问题 I'm able to make a simple working UI on VS launched with ipy interpreter but when I try to launch it in Revit environment (revit python shell or macro), I got the following error : ImportError: No module named wpf wpf is a built-in module, so I don't think I forgot any reference or pythonpath. I checked both sys.version (idea from a post on stackoverflow): import sys print sys.version and got the same result on revitpythonshell and Ironpython console : 2.7.4 (IronPython 2.7.4 (2.7.0.40) on

Remove/ delete or hide column in spotfire

给你一囗甜甜゛ 提交于 2019-12-11 05:07:52
问题 How to remove/delete or hide column using iron script in spotfire ? For adding a column i have done as follows: ` curDT = Document.ActiveDataTableReference cols = curDT.Columns # targetCol = Document.Properties["myColumnSelection"] #Create a new column that counts the comma delimiter myExpression = '1+len(RXReplace([Cx],"([A-Za-z0-9]+)","","g"))' myNewColName = cols.CreateUniqueName("NumElements") cols.AddCalculatedColumn(myNewColName, myExpression) ` 回答1: if it can still be helpful: from

Unexpected token append

前提是你 提交于 2019-12-11 04:25:30
问题 I wrote a simple language translator application using IronPython and I call the python code via a C# console application. I tested the python code separately and it works fine. However, when I call the python code via the C# application it always gives the Microsoft.Scripting.SyntaxErrorException: 'unexpected token 'append'' error message. ScriptEngine engine = Python.CreateEngine(); ScriptSource source = engine.CreateScriptSourceFromFile(@"D:\Projects\Translator.py"); ICollection<string>

C#, IronPython, and Sympy: unicode_escape_decode() takes no arguments

谁都会走 提交于 2019-12-11 02:58:36
问题 I am trying to create a static method for simplifying mathematical expressions in sympy using IronPython from C#. I have already been able to test and confirm the execution of simple python statements from IronPython. The problem is when I attempt to run the code below, I get the following error: unicode_escape_decode() takes no arguments (1 given) I have looked online for an explanation and managed to find another user with the same problem but it doesn't seem to be resolved: Unicode_escape

Ironpython Array[byte] to byte string

ⅰ亾dé卋堺 提交于 2019-12-11 02:56:26
问题 Within IronPython 2.7, I am running a few calls to a .Net dll : from System.Guid import NewGuid, ToByteArray from System import Array, Byte import clr clr.AddReferenceToFile( ThePathToDLLFile ) from MyDLL import * ... g = NewGuid() buffer = ToByteArray(g) ret = myDllMethodToFillBuffer( buffer ) Some methods like 'myDllMethod' return a buffer of type Array[byte]: >>> type(buffer) <type 'Array[Byte]'> I am strugling to find the right way to convert the Array[byte] to Python 'string byte', IE '

Fast and scalable RPC between C# and CPython

爷,独闯天下 提交于 2019-12-11 02:55:59
问题 I need some feedback on C# - cPython integration for scientific application. The scenario is the following: C# for data acquisition and visualization - CPython for data manipulation using several and changing third part library to implement domain specific tasks. General use case: C# code get realtime data from device C# code pass data to cPython code and ask for elaboration Cpython code does the magic Cpython code pass result back to c# code C# visualizes data in a WPF application Both c#

Is it possible to associate an IronPython asp.net webform to a dll file?

社会主义新天地 提交于 2019-12-11 02:02:01
问题 In ASP.NET with the normal ASP model you could have the codefile of the aspx file in a dll by inheriting the class inside the dll. In IronPython you have another model and the only option in the aspx page is "codefile" and there is no "inherits". My question is, is there any way to associate an aspx file to a source file which is not directly viewable such as a dll or a pyc file? 回答1: It cannot be currently done with just IronPython. The .dll file created by pyc.py cannot be used. When you

Importing a dll in python on Ubuntu

前提是你 提交于 2019-12-10 23:19:11
问题 I am using python 2.6.5 on an Ubuntu intalled server. I need to integrate an API for our applicaion, in that case, i needed to use a DLL given to me by the API provider. Their example of code about api integration is written in Visual Basic... I made a search on google and found some examples of using ctypes , and i try using cdll and pydll , which caused the following error... OSError: /home//some.dll: invalid ELF header One possibility is using IronPython, but i do not have much information

IronPython/C# Float data comparison

谁都会走 提交于 2019-12-10 23:08:45
问题 We have WPF based application using Prism Framework. We have embedded IronPython and using Python Unit Test framework to automate our application GUI testing. It works very well. We have difficulties in comparing two float numbers. Example C# class MyClass { public object Value { get; set;} public MyClass() { Value = (float) 12.345; } } In IronPython When I compare the MyClass Instance's Value property with python float value(12.345), it says it doesn't equal This Python statement raises