ironpython

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

扶醉桌前 提交于 2020-01-05 09:14:03
问题 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 deleted, but that's not what it should be done to fix that 回答1: There's no fix for this and there's likely not to be one because IronPython Studio isn't supported anymore. DataGridView.BeginInit is implemented explicitly and IronPython Studio is based

DLR: Do i really need code generation here?

女生的网名这么多〃 提交于 2020-01-05 08:57:31
问题 spent some time again with the scripting interface of my app. i guess i now have an advanced dlr problem here. I have a python script I have an .NET object [o1] I call a method on the python script from .NET via Iron Python. The python code creates an object [o2] The python code calls an method on object [o1] passing [o2] as an argument (Via subclassing DynamicMetaObject) In the .NET code of the o1-method i want to dynamically call methods on o2 For example i could do that via ((dynamic)o2)

IronPython: How to install IronPython Studio

∥☆過路亽.° 提交于 2020-01-05 05:56:56
问题 After installing prerequistes (Visual Studio 2008 Shell Isolated/Integrated Mode Redistributable package) here, I still get errors: cannot find one or more components when installing IronPython Studio . What others do I require? Thx. 回答1: See how-to-use-ironpython-with-visual-studio-2008 and similar questions. It looks like IronPython Studio is supported only with outdated IronPython versions. 来源: https://stackoverflow.com/questions/1920596/ironpython-how-to-install-ironpython-studio

Why can't I change variables from cached modules in IronPython?

家住魔仙堡 提交于 2020-01-05 03:45:02
问题 Disclaimer : I am new to python and IronPython so sorry if this is obvious. We have a C# application that uses IronPython to execute scripts. There are a few common modules/scripts and then a lot of little scripts that define parameters, do setup, then call functions in the core modules. After some recent additions made the common modules larger performance took a hit on the imports. I attempted to fix this by making sure we only created one engine and created scopes for each script to run in

Why can't I change variables from cached modules in IronPython?

点点圈 提交于 2020-01-05 03:44:05
问题 Disclaimer : I am new to python and IronPython so sorry if this is obvious. We have a C# application that uses IronPython to execute scripts. There are a few common modules/scripts and then a lot of little scripts that define parameters, do setup, then call functions in the core modules. After some recent additions made the common modules larger performance took a hit on the imports. I attempted to fix this by making sure we only created one engine and created scopes for each script to run in

IronPython: How to call a function that expects an array of value-types?

点点圈 提交于 2020-01-05 02:13:04
问题 I have come across a problem with IronPython that I can't solve. I need to call a function that takes a parameter of type array to value-type. The function-signature (in C++/CLI notation) is this: static int PLGServiceInterface::PLGService::MapLowSpeedRealtimeNames(cli::array<System::String ^> ^ SignalNames, int timeout_ms, cli::array<PLGServiceInterface::LVCluster_1> ^% Channels, System::String ^% ReportText) When I call the function from IronPython import clr clr.AddReferenceToFileAndPath(

Using XLRD in Ironpython

自闭症网瘾萝莉.ら 提交于 2020-01-04 10:00:08
问题 I am trying to use the XLRD library in IronPython 2.7 At the most basic operation of opening an .xls file (2003 format) I get the following error, and I am not sure how to fix it: workbook = xlrd.open_workbook(xlsfile) File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages\xlrd\__init__.py", line 426, in open_workbook TypeError: sequence item 0: expected bytes or byte array, str found any ideas? i would like to use xlrd if possible but seems like there may be some compatibility

Can I use Named and Optional Arguments in ironpython

て烟熏妆下的殇ゞ 提交于 2020-01-04 03:24:07
问题 I hope to load .net dll in ironpython. But one of static functions in .net dll, has some Named and Optional Arguments. like, Draw(weight:w,height:h, Area=1) Only can I use full arguments? 回答1: Named and optional parameters are fully supported. .NET has had these for a long time for VB.NET support and so IronPython has supported that same way to do them since the beginning. The new C# syntax maps to the same underlying metadata as the old VB support. For calling you use f(x = 42) which is

Initialize .Net List in IronPython

吃可爱长大的小学妹 提交于 2020-01-04 01:54:04
问题 I am trying to initialize a .net of custom class objects as follows: from System.Collections.Generic import List class EmployeeTree: def getEmployeeFirstName(self): return self.EmployeeFirstName def setEmployeeFirstName(self, firstName): self.EmployeeFirstName = firstName.strip() def getEmployeeLastName(self): return self.EmployeeLastName def setEmployeeLastName(self, lastName): self.EmployeeLastName = lastName.strip() def getEmployeeNumber(self): return self.EmployeeNumber def

Access host class from IronPython script

这一生的挚爱 提交于 2020-01-03 11:32:20
问题 How do I access a C# class from IronPython script? C#: public class MyClass { } public enum MyEnum { One, Two } var engine = Python.CreateEngine(options); var scope = engine.CreateScope(); scope.SetVariable("t", new MyClass()); var src = engine.CreateScriptSourceFromFile(...); src.Execute(scope); IronPython script: class_name = type(t).__name__ # MyClass class_module = type(t).__module__ # __builtin__ # So this supposed to work ... mc = MyClass() # ??? me = MyEnum.One # ??? # ... but it doesn