ironpython

How does IronPython loads modules while being hosted?

丶灬走出姿态 提交于 2019-12-24 03:07:07
问题 I'm confused about the way IronPython loads modules while being hosted. I'm using IronPython 2.7.7 installed using the MSI package and I've referenced C:\Program Files (x86)\IronPython 2.7\IronPython.dll and C:\Program Files (x86)\IronPython 2.7\Microsoft.Scripting.dll . Sometimes IronPython fails to load a module throwing IronPython.Runtime.Exceptions.ImportException: 'No module named modulename' , but sometimes everything works fine. For example, var engine = Python.CreateEngine(); engine

How does IronPython loads modules while being hosted?

流过昼夜 提交于 2019-12-24 03:07:04
问题 I'm confused about the way IronPython loads modules while being hosted. I'm using IronPython 2.7.7 installed using the MSI package and I've referenced C:\Program Files (x86)\IronPython 2.7\IronPython.dll and C:\Program Files (x86)\IronPython 2.7\Microsoft.Scripting.dll . Sometimes IronPython fails to load a module throwing IronPython.Runtime.Exceptions.ImportException: 'No module named modulename' , but sometimes everything works fine. For example, var engine = Python.CreateEngine(); engine

Are IronPython or IronRuby well-suited for the MVVM pattern in WPF/Silverlight?

雨燕双飞 提交于 2019-12-24 01:54:49
问题 I've been very happily using the Model-View-ViewModel (MVVM) pattern in WPF and Silverlight apps in combination with C#. Declarative XAML markup and data binding are invaluable - I just can't live without them. But, this talk by Harry Pierson on dynamic languages got me excited about learning a dynamic language, and I'd like to try one out in a new project. I've been enjoying reading IronPython In Action, and it does contain a few WPF examples - but only with imperative-style code. What are

What's the best way to embed IronPython inside my C# App?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 01:25:32
问题 I have an application used by pretty tech-savey people and they want small island of programmability so I've used embedded Iron Python. However, since IronPython 2.0 Eval() doesn't work any more. Specifically I can't both load modules and inject local variables. There is a work around where I can still call Execute(), print out my answer and listen to StandardOut, but then it comes out as a string and I've lost the type. Not a disaster for a long, but a huge pain for more complex objects.

How to install a module as an egg under IronPython?

早过忘川 提交于 2019-12-24 01:19:33
问题 Maybe, it is a stupid question but I can't use python eggs with IronPython. I would like to test with IronPython 2.0.2 one module that I've developped. This modules is pure python. It works ok with python 2.6 and is installed as a python egg thanks to setuptools. I thought that the process for installing my module under IronPython was very similar but unfortunately it doesn't work. I can't install setuptools-0.6c9 with IronPython (Crash of IronPython). I've tried to copy manually my egg under

How can I use a VB6 COM 'reference' in IronPython?

我们两清 提交于 2019-12-24 00:28:48
问题 I'm currently developing what is more or less a script that needs to get some data from a VB 6 COM dll. This dll is currently used in a MS Word VBA project, and it exports classes, etc to the VBA code. It is added in the Tools -> References menu in the VBA editor, and I can see it's classes in the object browser of VBA. From my readings, it is possible to use a VB6 COM library in VB.NET (or at least, it is supposed to be able to.) As it should be possible in VB.NET, and since .NET runs on the

Writing xlsx files in Iron Python

☆樱花仙子☆ 提交于 2019-12-23 18:40:28
问题 I am trying to create an xlsx file in Iron Python (v2.7.5). I have installed the latest version of openpyxl (v2.2.1) and tested a minimalistic example, almost literally taken from openpyxl documentation: from openpyxl import Workbook wb = Workbook() wb.save('empty.xlsx') I is working as expected in CPython (creating an empty workbook), but in Iron Python it is just throwing exceptions. File "test_openpyxl.py", line 15, in <module> File "C:\Program Files (x86)\IronPython 2.7\lib\site-packages

IronPython - Run an Excel Macro

六月ゝ 毕业季﹏ 提交于 2019-12-23 16:34:24
问题 I'm running TIBCO Spotfire v4. It has IronPython built in. Looking to run a Spotfire report that will export a .xls file (that part is done). Looking for a script to open an Excel file and run a macro to be able to format the file. Here's some code I found and tried using. Not sure where the import items come from! import os, os.path, win32com.client def run_macro(fName, macName, path=os.getcwd()): """ pre: fName is the name a valid Excel file with macro macName post: fName!macName is run,

Import embedded libs of IronPython

我的梦境 提交于 2019-12-23 15:41:15
问题 I've added IronPython Standart Library via NuGet into my c#.net4 project and later got some references(IronPython, IronPython.Modules, IronPython.SQLite, IronPython.Wpf, Microsoft.Dynamic, Microsoft.Scripting etc) and the 'Lib' folder contains python modules. Now I'm trying to import the 'urllib' module in the my file.py but receiving the ImportException (No module named urllib). How can I use urllib? Should I copy Lib folder to project output directory or do something else? UPD : If I copy

Ironpython: Function works in CPython, mysterious null pointer exception in IronPython

瘦欲@ 提交于 2019-12-23 15:39:58
问题 I'm trying to do something that seems very simple, and falls within the range of standard python. The following function takes a collection of sets, and returns all of the items that are contained in two or more sets. To do this, while the collection of sets is not empty, it simply pops one set out of the collection, intersects it with the remaining sets, and updates a set of items that fall in one of these intersections. def cross_intersections(sets): in_two = set() sets_copy = copy(sets)