ironpython

QT4, GTK+, wxWidgets or IronPython for a native Windows app using Python

浪尽此生 提交于 2019-12-07 05:18:28
问题 I need to build a native windows app using Python (and py2exe, I guess). Feature requirements are: Taskbar icon Alert notifications (next to Taskbar Icon) Chromeless window (ideally a pretty, rounded, coloured one). Webkit to render some of the Chromeless window So far I've identified the following possible toolkits: pyGTK pyQT4 wxWidgets ironpython I haven't used any of these before and so I look to you for advice on the suitability or pitfalls of choosing one of the above. Many thanks for

Python requires a GIL. But Jython & IronPython don't. Why?

主宰稳场 提交于 2019-12-07 05:02:36
问题 Why is it that you can run Jython and IronPython without the need for a GIL but Python (CPython) requires a GIL? 回答1: Parts of the Interpreter aren't threadsafe, though mostly because making them all threadsafe by massive lock usage would slow single-threaded extremely (source). This seems to be related to the CPython garbage collector using reference counting (the JVM and CLR don't, and therefore don't need to lock/release a reference count every time). But even if someone thought of an

Does IronPython implement python standard library?

吃可爱长大的小学妹 提交于 2019-12-07 02:26:50
问题 I tried IronPython some time ago and it seemed that it implements only python language, and uses .NET for libraries. Is this still the case? Can one use python modules from IronPython? 回答1: The IronPython installer includes the Python standard library. Otherwise, you can use the standard library from a compatible Python install (IPy 2.0 -> CPy 2.5, IPy 2.6 -> CPy 2.6). Either copy the Python Lib directory to the IronPython folder, or set IRONPYTHONPATH. Do note that only the pure Pyton

How to unload a .NET assembly reference in IronPython

孤街醉人 提交于 2019-12-07 02:25:50
问题 After loading a reference to an assembly with something like: import clr clr.AddRferenceToFileAndPath(r'C:\foo.dll') How can I unload the assembly again? Why would anyone ever want to do this? Because I'm recompiling foo.dll and want to reload it, but the compiler is giving me a fuss, since IronPython is allready accessing foo.dll . 回答1: .NET itself doesn't support unloading just a single assembly. Instead, you need to unload a whole AppDomain . I don't know exactly how IronPython works with

is F# to IronPython/IronRuby as C# is to VB.NET?

老子叫甜甜 提交于 2019-12-07 01:30:50
问题 I just listened to podcast of Chris Smith talking about F# in which he talks about how F# is a language which allows you to approach problems in a different way than in C#/VB.NET, i.e. instead of "pushing bits around" you "chain together data transformations", and that how F# will "become like XML", something that you use in addition to your language of choice (C# or VB.NET) in order to solve certain problems in a more efficient way. This got me to thinking about the relationship of the .NET

Errors accessing .NET class method overloads in IronPython

元气小坏坏 提交于 2019-12-06 17:05:51
问题 I have a class I've written in C#. The class has two methods, the signatures being: bool Navigate(string url) bool Navigate(Uri url) From what I gather, the IronPython runtime is supposed to try and select the best overload based on the passed-in argument. In my case, I'm passing in a string which I know to be non-null, yet I get the following exception: Multiple targets could match: Navigate(Uri), Navigate(str) Seeing as my argument is blatantly a string, why does IronPython insist that

How to access WPF class library from Silverlight using iron python. Is it possible?

感情迁移 提交于 2019-12-06 16:39:15
I'm having a class library. I'm able to access that assembly from iron python console as normal. My goal is to create a Silverlight class library which uses a python script to access that WPF class library what I'm having. Is it possible? Is there any other way to achieve this or any work around. I can provide a sample of what I'm doing now, If more details are needed. Thanks You will not be able to use the class library unless its code is compatible with Silverlight libraries and is re-compiled targeting the Silverlight ones. 来源: https://stackoverflow.com/questions/2251296/how-to-access-wpf

Using Iron Python with Solidworks API

こ雲淡風輕ζ 提交于 2019-12-06 16:07:29
I've been working on scripting some repetitive behaviors in Solidworks using python. I spent a while trying to go through the win32com library and managed to get a lot to work, but ran into a roadblock. So I'm now trying to control the API via Iron Python. Just trying to get rolling and have run into an issue. I've tried to run the code below: import clr clr.AddReferenceToFileAndPath('..\\Redist\\SolidWorks.Interop.sldworks.dll') clr.AddReference('SolidWorks.Interop.swconst') from SolidWorks.Interop import sldworks from SolidWorks.Interop import swconst print sldworks swApp = sldworks

IronPython import performance with compiled code

百般思念 提交于 2019-12-06 15:02:21
I am doing some experiments with IronPython 2.6.1 and the clr.CompileModules function to compile my large scripts into assemblies. Testing has shown good cold start performance performance improvements but in some cases importing the compiled module is actually slower than executing a large string that represents my code in some cases. My question is, if i use something like scope.Engine.Execute(string.Format("from {0} import {0}", theModule), scope); or the ImportModule function, even though I get a new ScriptSCope back does the DLR cache the imports made in other ScriptScopes? So if module 1

C# application works much slower using compiled IronPython standard library

元气小坏坏 提交于 2019-12-06 13:52:49
When I load modules from standard library as source .py files in this application, elapsed time after end equals approximately 4 seconds: Stopwatch watch = Stopwatch.StartNew(); ScriptEngine engine = Python.CreateEngine(); ScriptScope scope = engine.CreateScope(); ICollection<string> paths = engine.GetSearchPaths(); paths.Add(@"C:\Users\Montgomery1944\Documents\Libs\IronPython-2.7.1\Lib"); engine.SetSearchPaths(paths); ScriptSource source = engine.CreateScriptSourceFromString( @"from distutils import dir_util import ftplib import os import tempfile import zipfile"); source.Execute(scope);