ironpython

Error when creating an IronPython project in VisualStudio; “Exception has been thrown by the target of an invocation.”

旧城冷巷雨未停 提交于 2019-12-10 11:21:22
问题 I have a solution which will have a GUI built in on C# and I want to create a IronPython project in the solution which will be called from the C# code but I can't even create it. I'm using the python tools from CodePlex and IronPython 2.7 Edit: This is I found in the ActivityLog.xml System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Failed to load language 'IronPython 2.7.2.1': Method not

Script to Export Spotfire Graphic to PowerPoint

二次信任 提交于 2019-12-10 11:17:19
问题 I am trying to export an active page to an existing PowerPoint presentation. I know how to do this from the title bar, but I would like to incorporate this into the IronPython code I am writing so I can do several slides at once. Thanks, Joseph 回答1: This will open up powerpoint and export one visualisation per page: from System.IO import * from Spotfire.Dxp.Application.Visuals import VisualContent from System.Drawing import Bitmap, Graphics, Rectangle, Point import clr clr.AddReference(

It's possible to use requests in ironpython 2.7.5?

只谈情不闲聊 提交于 2019-12-10 10:57:13
问题 I've successful installed pip on ironpython. But when i try to install requests with "ipy.exe -X:Frames -m pip install requests" in a administrator console I get the following: ------------------------------------------------------------ C:\Program Files (x86)\IronPython 2.7\lib\site-packages\pip\__main__.py run on 02/02/16 16:13:53 Downloading/unpacking html5lib Getting page https://pypi.python.org/simple/html5lib/ Cleaning up... Removing temporary dir c:\users\panta\appdata\local\temp\pip

How can I get generics to work in Python.NET with CPython

霸气de小男生 提交于 2019-12-10 10:33:13
问题 How can I get generics to work in Python.NET with CPython. I get an error when using the subscript syntax from Python.NET Using Generics TypeError: unsubscriptable object With Python 2.7.11 + pythonnet==2.1.0.dev1 >python.exe Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import clr >>> from System import EventHandler >>> from System import EventArgs >>> EventHandler

Writing iron python method with ref or out parameter

痞子三分冷 提交于 2019-12-10 03:19:27
问题 i need to translate following C# method to the same IronPhyton method private void GetTP(string name, out string ter, out int prov) { ter = 2; prov = 1; } 回答1: In python (and consequently in IronPython) you cannot change a parameter that is not mutable (like strings) So you can't directly traslate the given code to python, but you must do something like: def GetTP(name): return tuple([2, 1]) and when you call it you must do: retTuple = GetTP(name) ter = retTuple[0] prov = retTuple[1] that is

Generate and parse Python code from C# application

偶尔善良 提交于 2019-12-09 18:01:28
问题 I need to generate Python code to be more specific IronPyton. I also need to be able to parse the code and to load it into AST. I just started looking at some tools. I played with "Oslo" and made a decision that it's not the right tool for me. I just looked very briefly at Coco/R and it looks promising. Does anyone use Coco/R? If you did what's your experience with the tool Can you recommend some other tool? 回答1: The IronPython implementation itself includes a parser and an AST representation

Would you recommend Iron Ruby, Iron Python, or PowerShell for making a C# application a script host?

夙愿已清 提交于 2019-12-09 15:01:36
问题 Would you recommend Iron Ruby, Iron Python, or PowerShell for making a C# application a script host? After some quick tinkering, right now I'm leaning towards powershell for two main reasons (note these a purely my opinions and if they are wrong, I'd love to know!!!): 1) It's simple to create a runspace with classes in your application; therefor it's easy to make your application scriptable. 2) I've heard some rumors that IronRuby and IronPython are losing support from Microsoft, so they may

Speed of code execution: IronPython vs C#?

房东的猫 提交于 2019-12-09 11:34:38
问题 Am trying to provide a response from a Managers perspective to the question: What overall performance penalty will we incur if we write the application in IronPython instead of C#? This question is directed at those who might have already undertaken some testing, benchmarking or have completed a migration from C# to IronPython, in order to quantify the penalty. 回答1: I created a C# console application (I'm not very good at C#), which basically encrypts an input file using a xor cipher. Code

Is it possible to host the .Net DLR in an “idiot-proof” sandbox?

给你一囗甜甜゛ 提交于 2019-12-09 05:42:16
问题 I would like to host the Dynamic Language Runtime (DLR) in such a way that users who run arbitrary scripts in it cannot bring the process down? The DLR hosting spec describes how to host the DLR in a separate ApplicationDomain. This allows to tear down and unload a script runtime and to restrict certain operations through CAS (e.g. I can restrict file system access or disallow use of reflection). But are there also ways to for example: - restrict the maximum amount of memory used by a script?

F# vs IronPython: When is one preferred to the other?

≯℡__Kan透↙ 提交于 2019-12-09 04:15:48
问题 While the languages F# and IronPython are technically dissimilar, there is large overlap between their potential uses in my opinion. When is one more applicable than the other? So far it look to me like F# is computationally more efficient while IronPython inherits a better library from Python. I am happy to be corrected. There is a somewhat relevant question is F# to IronPython/IronRuby as C# is to VB.NET? but most of the answers there are about the language paradigms rather than their