ironpython

SSIS: Execute Ironpython or Ironruby scripts through SSIS

久未见 提交于 2019-11-29 11:25:10
Problem! I have a little python script, which goes throught a web page (http-crawling). This web-page is hosted inside the intranet and uses NTLM authentication to gather access to it. So, I found this task (retrieve http-content) easily programmable using python, instead of trying to re-write the whole python script to C# and then use it througth "Script Task" on SSIS, in order to complete the task. Hint! I've looked up closely to SSIS tools and I found that there is a Control Flow named "Execute Process Task", which lets you to execute Win32 executables. But the problem resides in how to

Where is Microsoft.Scripting.Core.dll?

我与影子孤独终老i 提交于 2019-11-29 11:20:24
I installed IronPython 2.6.1 on Windows Vista x64 on a machine with Visual Studio 2010 installed. I expected to find these DLLs: Microsoft.Scripting.Core.dll Microsoft.Scripting.ExtensionAttribute.dll ... in the IronPython directory, but they are not there. Is this a difference between IronPython 2.6.0 and 2.6.1 or do I have a problem with my installation? Edit It has been suggested that I edit this question to explain why it is not a duplicate of How to use Microsoft.Scripting.Hosting? The two questions are both about problems referencing Iron Python libraries from C# projects. However this

How to create a data table on the fly in Spotfire via python

给你一囗甜甜゛ 提交于 2019-11-29 11:18:20
I need to iterate each row, add items to a dictionary, do some sorting and then spit out the results into a data table I need to create on the fly via script. http://spotfirecommunity.tibco.com/community/blogs/tips/archive/2011/03/06/displaying-cross-table-data-as-a-new-data-table.aspx I can't access this article any more, does anyone have the code to do something similar to this at all? Thanks smackenzie Worked it out with some help. You have to create a .Net DataSet and DataTable, add rows in memory, process the table and create a tab separated string from the data, then use a Stream to

Boo vs. IronPython

[亡魂溺海] 提交于 2019-11-29 10:53:51
问题 After having looked at each of these two projects, it seems that both are VERY similar. Both run on top of the CLI, both have python style syntax, both use .NET instead of the standard python libraries. So, what are the differences between them and advantages of each? 回答1: The main difference as I see it is that Boo is statically typed, meaning the type of a variable is inferred on its first assignment and is fixed from there - while IronPython has the "real" dynamic behaviour of normal

PythonNet FileNotFoundException: Unable to find assembly

亡梦爱人 提交于 2019-11-29 09:43:33
问题 I am trying to execute a Python script that uses Python For .Net (https://github.com/pythonnet/pythonnet) to load a C# library called "Kratos_3.dll" which is in the same folder as the script but the file cannot be found. I have installed clr using "pip install pythonnet". This is my script: import clr import sys sys.path.insert(0,"C:\\dev\\proj_1\\") clr.AddReference("Kratos_3") I keep getting the error FileNotFoundException: Unable to find assembly 'Kratos_3. at Python.Runtime.CLRModule

IronPython integration in C#: a specific problem/question

徘徊边缘 提交于 2019-11-29 07:57:16
I'm working on providing an extensibility mechanism for my C# mapmaking application through IronPython. Everything works fine, but I have a specific requirement which I'm having trouble implementing: I want the user to be able to specify two things: A file name of the Python script to be loaded A one-liner string containing Python script which would typically be a call of a function from that Python file (example getTextLabel(element) ) These two settings must be separate, but I don't know if it is possible to do this using PythonScript and related classes. I'm a newbie in Python, perhaps

Assigning an IronPython method to a C# delegate

北战南征 提交于 2019-11-29 07:42:13
I have a C# class that looks a little like: public class MyClass { private Func<IDataCource, object> processMethod = (ds) => { //default method for the class } public Func<IDataCource, object> ProcessMethod { get{ return processMethod; } set{ processMethod = value; } } /* Other details elided */ } And I have an IronPython script that gets run in the application that looks like from MyApp import myObj #instance of MyClass def OtherMethod(ds): if ds.Data.Length > 0 : quot = sum(ds.Data.Real)/sum(ds.Data.Imag) return quot return 0.0 myObj.ProcessMethod = OtherMethod But when ProcessMethod gets

Accessing Pandas library using IronPython

和自甴很熟 提交于 2019-11-29 07:30:56
I aim to connect Python to .NET for a process. I am using IronPython for it. The part in Python involves some calculations for which I use the Pandas library. Is there a way to connect IronPython and Pandas? I see using IronPython, I can access all the basic Python functionalities. How to extend this generally to access third party functionalities/packages (like Pandas here)? Short answer: No. Longer answer: As far as I am aware tere is no way to integrate C-libraries with IronPython in the default python way. Since pandas / numpy use a heavy dose of c code, that is a showstopper. We use

How do I create a .NET assembly in IronPython and call it from C#?

99封情书 提交于 2019-11-29 06:21:25
问题 I want to create an assembly using IronPython can call it from C#. Here are two things I am not asking. I'm not asking how to call C# from IronPython. The easiest documentation to find describes how to call C# from inside IronPython. (For example, the tutorial that ships with IronPython.) I want to do the opposite, call IronPython from C#. I'm not asking how to embed the IronPython interpreter. I've found several useful references (e.g. here and here) on how to call the IronPython interpreter

IronPython dependencies for scripts stored as strings

微笑、不失礼 提交于 2019-11-29 05:14:37
I have a C# application that stores python script files (*.py) as strings. I load them using: scriptEngine.CreateScriptSourceFromString(code); But now I have multiple script files with dependencies between them (imports). In order to handle dependencies, I could save all the strings back to files in a folder and load the script that i want to execute using: scriptEngine.CreateScriptSourceFromFile(filePath); but this would make all the script files visible. Is there a way to achieve this in a in-memory way, so that the script files are not first saved to disk but loaded from the strings