Re: [IronPython] Seattle IronPython Meetup

2011-06-10 Thread Curt Hagenlocher
Welcome to Seattle! Or as I like to think of it, welcome to June-and-we-still-have-the-heat-on! :( On Fri, Jun 10, 2011 at 10:42 AM, Jeff Hardy jdha...@gmail.com wrote: Hi all, Is anyone in the Seattle area interested in an IronPython meetup, or even a sprint? Anybody fancy a hands-on crash

Re: [IronPython] socket, _socket, and socket.py

2011-05-17 Thread Curt Hagenlocher
Originally, we weren't allowed to redistribute the Python standard library with IronPython. So it made sense to implement the socket module directly. When IronPython started shipping the standard lib, it could have been changed, but never was. I think it makes sense to follow the CPython pattern.

Re: [IronPython] socket, _socket, and socket.py

2011-05-17 Thread Curt Hagenlocher
simply use socket.py. So someone would need to patch both IronPython and socket.py so this would work. For the record it looks like Jython also has a custom socket.py. *From:* users-boun...@lists.ironpython.com [mailto: users-boun...@lists.ironpython.com] *On Behalf Of *Curt Hagenlocher

Re: [IronPython] Cast to a method pointer using CTYPES

2011-02-10 Thread Curt Hagenlocher
Strange that a search would find nothing. Try searching for VirtualProtect instead -- that's what you'd need to mark a block of memory as executable, and you'd use it in conjunction with VirtualAlloc. On Thu, Feb 10, 2011 at 8:17 AM, Andrew Evans evans.d.and...@gmail.comwrote: Mind showing

Re: [IronPython] Sho

2011-01-30 Thread Curt Hagenlocher
in the license itself). -Sumit *From:* users-boun...@lists.ironpython.com [mailto: users-boun...@lists.ironpython.com] *On Behalf Of *Curt Hagenlocher *Sent:* Wednesday, January 26, 2011 11:23 AM *To:* Discussion of IronPython *Subject:* [IronPython] Sho I thought the people on this list might

[IronPython] Sho

2011-01-26 Thread Curt Hagenlocher
I thought the people on this list might be interested in the following IronPython-based tooling for technical computing: http://msdn.microsoft.com/en-us/devlabs/gg585581.aspx Disclaimer: I'm not sure what the license is. -Curt ___ Users mailing list

Re: [IronPython] SciPy

2010-12-20 Thread Curt Hagenlocher
There's also MetaNumerics (http://metanumerics.codeplex.com/) On Mon, Dec 20, 2010 at 10:32 AM, Mark Senko mse...@completegenomics.comwrote: Thank you. My real goal is to find a decent math/numerical package that I can use without having to reinvent the wheel. My searches came up with

Re: [IronPython] trying to build IronPythonTools locally

2010-10-25 Thread Curt Hagenlocher
This is the uninstall previous version task. Is it possible that you've previously installed the extension when running as Administrator and that your current user id doesn't have the rights to delete the files? This might be true if, for instance, you previously installed from the MSI. On Mon,

Re: [IronPython] The Future of IronPython

2010-10-22 Thread Curt Hagenlocher
Jimmy and Jim are two different people. Jimmy Schementi left Microsoft almost three months ago and is now working for Lab49. He will continue to be closely involved in IronRuby and IronPython. Jim Hugunin has just left for Google, and is not expected to be involved in IronPython in the future.

Re: [IronPython] Implementing an IronPython extension mechanism with abstract classes

2010-09-06 Thread Curt Hagenlocher
In order for the virtual methods to be forwarded to Python, the C# class that's generated by NewTypeMaker has to bake in code for all the methods. You could probably write some Python-based checking code that examines a Python class C and makes sure that all of the interfaces it derives from and

Re: [IronPython] Why is IronPython so much slower to import modules when built as an exe then as a script?

2010-09-02 Thread Curt Hagenlocher
What if you NGEN the executable produced by pyc? JIT can make startup expensive, and you're probably getting the adaptive interpreter when running against ipy.exe. On Thu, Sep 2, 2010 at 10:03 AM, Doug Warren doug.war...@gmail.com wrote: That is the case, I made the change you suggested and it

Re: [IronPython] Access functions from other modules in an embedded environment

2010-07-14 Thread Curt Hagenlocher
good but its weird how things make sense in your own head. Thanks Danny On Tue, Jul 13, 2010 at 9:59 AM, Curt Hagenlocher c...@hagenlocher.orgwrote: The easiest way to import a file as a module is with ScriptRuntime.UseFile. On Mon, Jul 12, 2010 at 2:51 PM, Danny Fernandez

Re: [IronPython] overriding methods from C# classes

2010-07-09 Thread Curt Hagenlocher
On Fri, Jul 9, 2010 at 10:43 AM, Marcin Krol mrk...@gmail.com wrote: Bc when I changed declaration of the method to protected virtual in the Form1.cs, the inherited class calls my Ipython method all right - that looks like overriding to me, at least when looking at it from the outside and not

Re: [IronPython] Missing folders in SVN

2010-06-27 Thread Curt Hagenlocher
Those projects don't exist for .NET 4.0; did you want to build for 2.0 or 4.0? 2010/6/27 Lukas Cenovsky cenov...@bakalari.cz Hi, I wanted to build IronPython from sources but some files are missing: Microsoft.Scripting.Core.csproj Microsoft.Scripting.ExtensionAttribute.csproj Actually the

Re: [IronPython] Convert between python array and .NET Array

2010-06-15 Thread Curt Hagenlocher
On Tue, Jun 15, 2010 at 9:21 PM, Dino Viehland di...@microsoft.com wrote: For the 2 IntPtr cases there's no overloads on Marshal and I don't believe anywhere in .NET. Yes, this is my mistake. I think I saw the [IntPtr[], int, IntPtr, int] overload and mentally elided the first array specifier.

Re: [IronPython] Convert between python array and .NET Array

2010-06-14 Thread Curt Hagenlocher
+ 20, bitmap.Height + 45) self.CenterToScreen() Application.Run(IForm()) Using bitmap.SetPixel works, but I cannot find how to make it work using the LockBits and Marshal.Copy. Thanks, -- Marcel On Jun 12, 10:27 pm, Curt Hagenlocher c...@hagenlocher.org wrote: It looks like

Re: [IronPython] Convert between python array and .NET Array

2010-06-12 Thread Curt Hagenlocher
It looks like the automatic overload resolution may be failing -- at least, it's worth trying to resolve the overload manually. This would be something like from System import Array, Byte, IntPtr Marshal.Copy.Overloads[Array[Byte], int, IntPtr, int](bytes, 0, bmData.Scan0, total_bytes) On Sat,

Re: [IronPython] call .net module from ironPython

2010-06-11 Thread Curt Hagenlocher
I created a project VbClassLibrary which contains a public module Module1. The module contains a public function GetMaxIdentifier. From IronPython 2.6, I say IronPython 2.6 (2.6.10920.0) on .NET 4.0.30319.1 Type help, copyright, credits or license for more information. import clr

Re: [IronPython] Willing to pay for help

2010-05-27 Thread Curt Hagenlocher
You almost certainly need to be pump messages occasionally if you're going to be performing a long operation on the UI thread. With Windows Forms, this involves calling System.Windows.Forms.Application.DoEvents(). On Thu, May 27, 2010 at 11:55 AM, robinsiebler robinsieb...@321.net wrote: This

Re: [IronPython] Internal Assembly Dependency

2010-05-27 Thread Curt Hagenlocher
The bug at http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=26793 suggests you might have success with clr.LoadAssemblyFromFile. Otherwise, you might be able to use the Fusion log viewer ( http://msdn.microsoft.com/en-us/library/e74a18c4(VS.80).aspx) to debug the assembly load process.

Re: [IronPython] Willing to pay for help

2010-05-27 Thread Curt Hagenlocher
, robinsiebler robinsieb...@321.net wrote: That worked! Give me an e-mail address and I will send you the money. Can you recommend a good book to learn about WinForms and .NET in general? Curt Hagenlocher wrote: You almost certainly need to be pump messages occasionally if you're going

Re: [IronPython] Internal Assembly Dependency

2010-05-27 Thread Curt Hagenlocher
--- A detailed error log follows. LOG: IJW explicit bind. File path:C:\Users\bakalarmh\Documents\NIH Dropbox\My Dropbox\Target\Target\bin\Debug\MathNet.Iridium.dll. LOG: IJW assembly bind returned file not found. *From:* Curt Hagenlocher [mailto:c...@hagenlocher.org] *Sent

Re: [IronPython] Missing Framework Libraries

2010-05-17 Thread Curt Hagenlocher
First, some clarification about terminology: Assemblies are DLLs. The built-in ones that come with .NET are typically stored in a special location known as the GAC or Global Assembly Cache. As such, you don't need to specify where they are exactly, because that's a standard place where IronPython

Re: [IronPython] Can't install IronPython Tools for Visual Studio

2010-05-03 Thread Curt Hagenlocher
The problem is this line: controls['Button']['btnCreate'].Click += printHello(HELLO WORLD) This executes the function printHello(HELLO WORLD) and tries to add the result -- None -- as an event handler. Something like the following should probably work: controls['Button']['btnCreate'].Click +=

Re: [IronPython] Default-valued arguments to C# functions

2010-04-23 Thread Curt Hagenlocher
factory) I think you need to use DefaultValueParameter instead of DefaultValue. It's an easy mistake to make -- I've made it myself. :( -- Curt Hagenlocher c...@hagenlocher.org ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com

Re: [IronPython] Default-valued arguments to C# functions

2010-04-23 Thread Curt Hagenlocher
On Fri, Apr 23, 2010 at 8:43 PM, Curt Hagenlocher c...@hagenlocher.orgwrote: On Fri, Apr 23, 2010 at 4:57 PM, Jeff Hardy jdha...@gmail.com wrote: I've got some functions implemented in C# that need to have optional, defaulted parameters. So far I've been declaring them similar

Re: [IronPython] Code Access Security?

2010-04-16 Thread Curt Hagenlocher
What kind of environment are you running from? Is this, for instance, an ASP.NET application? If so, can you get the same error when running from outside that environment? On Fri, Apr 16, 2010 at 1:30 AM, Neidhoo Xaphier xaphi...@googlemail.comwrote: a.py is importing SimpleSqlClient.py which

Re: [IronPython] Using SetPropertyValue and Put()

2010-04-08 Thread Curt Hagenlocher
I don't really know anything about WMI -- what's the type of the object returned from the CreateWithNodeType method? What happens when you call b.Put()? As for the code, are you asking for a critique of the Python style? I hope so, because I'm about to provide one! :) As a long-time Python user,

Re: [IronPython] cpython library

2010-03-26 Thread Curt Hagenlocher
I think your impression is right. But if there are C-based Python extensions in use (these would have a .pyd file extension under Windows), you might have some difficulty making them work. For desktop use, there's a project called IronClad (http://code.google.com/p/ironclad/) that provides pretty

Re: [IronPython] IronPython 2.6 CodePlex Source Update

2010-03-26 Thread Curt Hagenlocher
Oh, the irony -- that the person who implemented the codeplex comment convention didn't actually use it :P On Fri, Mar 26, 2010 at 8:54 AM, Michael Foord fuzzy...@voidspace.org.ukwrote: Do I spot the signal module appearing here? :-) Michael On 26/03/2010 15:52, merl...@microsoft.com

Re: [IronPython] Update from IronPython v1.0 to IronPython v2.6

2010-03-25 Thread Curt Hagenlocher
One option is this: ScriptEngine engine = Python.CreateEngine(); ScriptScope pyScope = engine.CreateScope(); ScriptSource ss = engine.CreateScriptSourceFromFile(test.py); ss.Execute(pyScope); string address =

Re: [IronPython] CodeContext went from language-independent to IronPython-specific

2010-03-22 Thread Curt Hagenlocher
The only shared type system that exists in DLRland is the CLR type system. Individual DLR-based languages are free to define their types with the semantics similar to list (or dictionary or any other type). I think the most general thing you can do in a case like this is to make sure that the

Re: [IronPython] How to find import in ipy

2010-03-11 Thread Curt Hagenlocher
probably want System.Windows.Documents.ListItem. -- Curt Hagenlocher c...@hagenlocher.org ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: [IronPython] Suspending threads

2010-03-08 Thread Curt Hagenlocher
IronPython doesn't have its own threads; it runs on whatever thread it's called on. The .NET Thread class has methods Suspend ( http://msdn.microsoft.com/en-us/library/system.threading.thread.suspend.aspx) and Resume ( http://msdn.microsoft.com/en-us/library/system.threading.thread.resume.aspx).

Re: [IronPython] Events on Buttons, and Focus, in IronPython

2010-02-22 Thread Curt Hagenlocher
You want args.Key instead of e.Key. The standard event signature is function(object sender, EventArgs args). But the better way to do this is to set the OK button to be the default button. In Winforms, this is a property on the form: form.AcceptButton = self.ok_button. On Mon, Feb 22, 2010 at

Re: [IronPython] Don't execute files containing errors?

2010-02-19 Thread Curt Hagenlocher
The short answer is no, that's not possible. This is effectively a version of the halting problem ( http://en.wikipedia.org/wiki/Halting_problem). For an arbitrary script, you can check its syntax for correctness without executing fairly easily. Other errors are potentially detectable as long as

Re: [IronPython] [Noob]Ironpython catching Windows 'destroy' message, and posting confirm dialog

2010-02-18 Thread Curt Hagenlocher
Anything that talks about window messages or subclassing is pretty-much incompatible with WPF. What you really want to do is handle the Closing event on the WPF Window object. This will give you the opportunity to cancel. On Thu, Feb 18, 2010 at 12:59 PM, Ken MacDonald drken...@gmail.com wrote:

Re: [IronPython] IronPython 2.6.1 RC1, ctypes, and c_int.value

2010-02-11 Thread Curt Hagenlocher
Wow, that's awful. I imagine that you would need to use VirtualProtect to make that page writeable in order for this to work. I can't see how modifying IronPython's ctypes to make this possible would be a good idea -- the vast majority of uses for ctypes don't involve writing into arbitrary DLL

Re: [IronPython] XNA and how to specify the type arguments explicitly

2010-02-02 Thread Curt Hagenlocher
You should template on VertexPositionColor, not on VertexPositionColor[]. The reason for the error message is that you're saying T is VertexPositionColor[]. An array is a reference type, while the template constraint specifies a value type. On Tue, Feb 2, 2010 at 7:51 AM, Richard Steventon

Re: [IronPython] 'Cannot evaluate expression because the code of the current method is optimized.' when debugging IronPython 2.6

2010-01-31 Thread Curt Hagenlocher
Yes, this is true in the debugger in general and not just for IronPython. You have to step back to a managed function after hitting the Break. On Sun, Jan 31, 2010 at 2:35 PM, Jeff Hardy jdha...@gmail.com wrote: Hmm, this is only an issue when using System.Diagnostics.Debugger.Break(); as soon

Re: [IronPython] Error Iterating

2010-01-21 Thread Curt Hagenlocher
You need to instantiate the InstalledFontCollection because Families is not a static property. import clr clr.AddReference('System.Drawing') from System.Drawing.Text import InstalledFontCollection for f in InstalledFontCollection().Families: ... print f.Name ... break ... Agency FB

Re: [IronPython] Silverlight DataBinding Not Working

2009-12-30 Thread Curt Hagenlocher
Silverlight doesn't support ICustomTypeDescriptor, which is how IronPython objects interact with data binding on the desktop. For a workaround, see http://devhawk.net/2009/04/24/clrtype+Metaclasses+Demo+Silverlight+Databinding.aspx I believe Silverlight 4 supports IDynamicMetaObjectProvider for

Re: [IronPython] (UPDATE) Cannot create instances of RuntimeType because it has no public constructors

2009-12-28 Thread Curt Hagenlocher
fooclass is not a Python type. It's an instance of the CLR class System.RuntimeType. In order to derive from foo in this fashion, you might be able to turn fooclass into a IronPython.Runtime.Types.PythonType by saying import clr foo = clr.GetPythonType(fooclass) class bar(foo): pass If it's

Re: [IronPython] Embedding IronPython in MS-Office (fwd)

2009-11-15 Thread Curt Hagenlocher
VBA is embedded pretty tightly into Word and Excel; there's no way to swap it out for another scripting engine. On Sun, Nov 15, 2009 at 8:40 AM, Joshua Kramer j...@globalherald.netwrote: A while back, Slide wrote: You'd have to write an add-in for office that hosted the .NET runtime and

Re: [IronPython] .NET attributes for methods

2009-11-12 Thread Curt Hagenlocher
Silverlight doesn't support ICustomTypeDescriptor -- that's probably why binding is failing. You need to emit CLR properties to use data binding with Silverlight 2 and 3. 2009/11/12 Shri Borde shri.bo...@microsoft.com So the new clrtype.py still works - cool! I am not an expert on data

Re: [IronPython] Embedded IronPython 2.6 Module Name

2009-11-05 Thread Curt Hagenlocher
I'm not sure if there's a simpler way -- here's what I did a few months back when I needed to publish something via __main__: pythonContext = HostingHelpers.GetLanguageContext(self._engine) module = pythonContext.CreateModule() pythonContext.PublishModule('__main__', module) scope =

Re: [IronPython] IronPython integration via dotNET

2009-10-23 Thread Curt Hagenlocher
Execute has two variants with zero arity: a generic version and a non-generic version. It sounds like MAXScript isn't able to pick one of these. This isn't surprising for a dynamic language; I think IronPython might have the same problem. If the MAXScript language doesn't provide a way to

Re: [IronPython] Type analysis of expression

2009-10-19 Thread Curt Hagenlocher
this work somehow? Sure. That's how you create the intellisense experience. I don't know if there are any open source Python intellisense engines, though, and even if there were, it would need to be adapted to understand .NET. -- Curt Hagenlocher c...@hagenlocher.org

Re: [IronPython] Default install location and site-packages

2009-10-06 Thread Curt Hagenlocher
In principle, allowing unprivileged users to install code into a location where it can unknowingly be accessed by privileged users is a security problem. A per-user approach is the right one. On Tue, Oct 6, 2009 at 4:45 AM, Michael Foord fuzzy...@voidspace.org.ukwrote: Hello guys, The msi

Re: [IronPython] Performances and Profiling of ReportLab under IronPython

2009-08-20 Thread Curt Hagenlocher
Imports are specific to a ScriptEngine. When you create a new ScriptScope through the hosting interface and run import foo inside of it, the standard Python behavior applies -- if foo is already in sys.modules, it won't be imported again. Instead, the name will just be added to the current scope.

Re: [IronPython] FolderBrowserDialog does not show folders

2009-08-19 Thread Curt Hagenlocher
It's a COM issue. The emitted Main needs to be tagged with the [STAThread] attribute. On Wed, Aug 19, 2009 at 11:41 AM, David Escobar davidesco...@ieee.orgwrote: Yes, I am. The full command line I'm using is: *C:\Program Files\IronPython 2.0.2\ipy.exe pyc.py /out:FolderBrowserDialogTest

Re: [IronPython] How do you run compiled scripts(dll) by C# host?

2009-08-17 Thread Curt Hagenlocher
You can convert between Scope and ScriptScope by using Microsoft.Scripting.Hosting.Providers.HostingHelpers. On Mon, Aug 17, 2009 at 7:48 PM, KATO Kanryu k.kan...@gmail.com wrote: How do you run compiled scripts(dll) by C# host? Hitherto, I run IronPython scripts by my C# host with the

Re: [IronPython] C# - IronPython Integration

2009-08-09 Thread Curt Hagenlocher
There probably isn't one. But these are just helpers for functionality that's in the DLR hosting spec. The source ought to be pretty self-explanatory. On Sun, Aug 9, 2009 at 10:28 AM, Boris Aronshtam boris_aronsh...@vdptech.com wrote: Thanks a lot for your reply. I do see DLR description

Re: [IronPython] ValueError: cannot assign to value types

2009-08-07 Thread Curt Hagenlocher
__setattr__ it's not a *CLR*-level instance method of the type. IronPython just makes it look like it is. One possibility is to simply create an entirely new Parcel from scratch, assigning values as appropriate. For example, given the following C# classes: public struct Point { public int x,

Re: [IronPython] DataBinding from IronPython Object to WPF Property

2009-08-05 Thread Curt Hagenlocher
Python's __setattr__ hook makes INotifyPropertyChanged easy to implement if you're willing to pay the performance penalty. Just derive from a class like this one: class PropertyChangeNotifier(INotifyPropertyChanged): def __init__(self, *trackedNames): self._PropertyChanged,

Re: [IronPython] DataBinding from IronPython Object to WPF Property

2009-08-05 Thread Curt Hagenlocher
Oops -- I should have pointed out that pyevent.py is in the standard IronPython distribution; probably in a directory called samples or tutorial. (Network service in the bus is flaky, so I'm finding it hard to check.) On Wed, Aug 5, 2009 at 5:35 PM, Curt Hagenlocher c...@hagenlocher.orgwrote

Re: [IronPython] turn on -X:Frames option in DLR

2009-07-31 Thread Curt Hagenlocher
var opts = new Dictionarystring, object(); opts[Frames] = ScriptingRuntimeHelpers.True; var engine = Python.CreateEngine(opts); On Fri, Jul 31, 2009 at 1:11 AM, Pavel Suhotyuk pavel.suhot...@gmail.comwrote: Hello. I need to use inspect module, that require sys._getframe() function. But I'm

Re: [IronPython] sympy on IP 2.6B2

2009-07-26 Thread Curt Hagenlocher
reasonable to assume that Unladed Swallow will (at some point) be in the same place too. -- Curt Hagenlocher c...@hagenlocher.org ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: [IronPython] Issue 22239 closed as 'by design'

2009-07-17 Thread Curt Hagenlocher
I believe this was fixed for 2.6, but that the fix is too disruptive to backport (by a long shot!) On Fri, Jul 17, 2009 at 1:55 PM, Michael Foord fuzzy...@voidspace.org.ukwrote: Issue 22239 has been closed as 'by design'.

Re: [IronPython] Issue 22239 closed as 'by design'

2009-07-17 Thread Curt Hagenlocher
...and here's a reference to the original thread http://www.mail-archive.com/users@lists.ironpython.com/msg08978.html On Fri, Jul 17, 2009 at 2:26 PM, Curt Hagenlocher c...@hagenlocher.orgwrote: I believe this was fixed for 2.6, but that the fix is too disruptive to backport (by a long shot

Re: [IronPython] Problem with Creating Executable using SharpDevelop

2009-07-10 Thread Curt Hagenlocher
if you were to provide the specific error message and a listing of the directory from which you're trying to run the program. Given that it works on at least one machine, it's likely to be context-related rather than code-related. -- Curt Hagenlocher c...@hagenlocher.org

Re: [IronPython] How to capture a 'Carriage Return' in a windows form ?

2009-07-09 Thread Curt Hagenlocher
It sounds like you're hooking the KeyPress event instead of the KeyDown event. That's why you get a KeyChar instead of a KeyCode and it also might be why the code isn't working as you expect. I can get the Keys enumeration just fine: IronPython 2.6 Beta 1 DEBUG (2.6.0.10) on .NET 2.0.50727.3053

Re: [IronPython] Problem Running Compiled Ironpython APP .NET Issue

2009-07-08 Thread Curt Hagenlocher
When you run ipy.exe on these machines it starts up successfully, but when you start your app you get the MissingMethodException for that DynamicMethod constructor? On Wed, Jul 8, 2009 at 8:45 AM, Bruce Bromberek bruce.brombe...@gmail.comwrote: I'm stuck. I have an Ironpython (2.0.0.0 .NET

Re: [IronPython] Problem Running Compiled Ironpython APP .NET Issue

2009-07-08 Thread Curt Hagenlocher
the compiled app and dlls in the folder. Script compiled using SharpDevelop 3.1 On Wed, Jul 8, 2009 at 10:55 AM, Curt Hagenlocher c...@hagenlocher.orgwrote: When you run ipy.exe on these machines it starts up successfully, but when you start your app you get the MissingMethodException

Re: [IronPython] Problem Running Compiled Ironpython APP .NET Issue

2009-07-08 Thread Curt Hagenlocher
ipy really require SP2 for .NET20. That is the only difference I see between my install (.NET 3.5 SP1, .NET 2.0 SP2) and their install (.NET 3.5, .NET 2.0 SP1)? Bruce On Wed, Jul 8, 2009 at 11:10 AM, Curt Hagenlocher c...@hagenlocher.orgwrote: How have you confirmed

Re: [IronPython] IronPython question

2009-06-29 Thread Curt Hagenlocher
From hosting, you can call ScriptEngine.SetSearchPaths to achieve a similar effect. On Mon, Jun 29, 2009 at 2:02 PM, Lepisto, Stephen P stephen.p.lepi...@intel.com wrote: You have to have a version of CPython installed such as v2.5 (for IronPython 2.0) or v2.6 (for IronPython 2.6). From

Re: [IronPython] Hosting, Adaptive Compilation, and Interpreted Mode

2009-06-18 Thread Curt Hagenlocher
Adaptive compilation is built on an interpreter that uses heuristics to decide when to compile a particular function. If there were going to be a pure interpreted mode, it would probably come in the form of overriding those heuristics to say never compile. The original interpreter was a much less

Re: [IronPython] clarification on current state of embedding

2009-06-18 Thread Curt Hagenlocher
referencing IronPython assemblies and targeting .NET 2.0. Which means I don't know what is wrong, but it *should* work fine... :-) Michael Foord On Wed, Jun 17, 2009 at 6:05 PM, Curt Hagenlocher c...@hagenlocher.org mailto:c...@hagenlocher.org mailto:c

Re: [IronPython] clarification on current state of embedding

2009-06-17 Thread Curt Hagenlocher
Good point! On Wed, Jun 17, 2009 at 5:12 PM, Michael Foord fuzzy...@voidspace.org.ukwrote: Curt Hagenlocher wrote: ...except through the hosting API *and through the new C# dynamic functionality in .NET 4.0*. And how do you get to the classes to use them with the new dynamic

Re: [IronPython] Checking syntax of source code without running it

2009-06-10 Thread Curt Hagenlocher
Through the hosting API, it's something like this: engine = IronPython.Hosting.Python.CreateEngine() source = engine.CreateScriptSourceFromString(text, SourceCodeKind.File) errors = ErrorListener() command = source.Compile(errors) if command is None: # compilation failed Here, ErrorListener

Re: [IronPython] suddenly IronPython needs 2.0 SDK

2009-06-10 Thread Curt Hagenlocher
Sounds strange. Did reinstallation of the SDK solve your problem? On Mon, Jun 8, 2009 at 6:43 PM, Justin Regele jregel...@gmail.com wrote: Last week I moved a python application into IronPython and under IronPython studio I was building and debugging and everything just worked. But today I

Re: [IronPython] How to reference List objects?

2009-06-08 Thread Curt Hagenlocher
It indicates a nested class: class PythonEngine { class book { } } You can definitely interact with BCL generic List classes in this fashion: from System.Collections.Generic import List a = List[str]() a.Add('abc') a.Add('def') a List[str](['abc', 'def']) a[0] 'abc' ^Z There are

Re: [IronPython] CallTarget0 problem

2009-06-04 Thread Curt Hagenlocher
happen... I believe it's in 2.6 (and possibly 2.0.2). -- Curt Hagenlocher c...@hagenlocher.org ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: [IronPython] jagged arrays

2009-05-27 Thread Curt Hagenlocher
On Wed, May 27, 2009 at 7:52 AM, Curt Hagenlocher c...@hagenlocher.org wrote: def make_jagged(T, v):    return Array[Array[T]]([Array[T](x) for x in v]) Or maybe this: def make_jagged(T): def inner(*v): return Array[Array[T]]([Array[T](x) for x in v]) return inner make_jagged

Re: [IronPython] C# 4.0 DynamicObject in IronPython

2009-05-27 Thread Curt Hagenlocher
Have you cast the variable to type dynamic? that is, class MyDynamicObject : DynamicObject { ... } dynamic obj = new MyDynamicObject(); dynamic memberval = obj.SomeMember; On Wed, May 27, 2009 at 7:54 PM, R. Bear Smith rb...@rbear.net wrote: Hi, I am trying to use a c# 4.0 class that derives

Re: [IronPython] C# 4.0 DynamicObject in IronPython

2009-05-27 Thread Curt Hagenlocher
Oops! Apparently I haven't quite read your message correctly. :( On Wed, May 27, 2009 at 7:56 PM, Curt Hagenlocher c...@hagenlocher.orgwrote: Have you cast the variable to type dynamic? that is, class MyDynamicObject : DynamicObject { ... } dynamic obj = new MyDynamicObject(); dynamic

Re: [IronPython] IronPython for ASP.Net

2009-05-24 Thread Curt Hagenlocher
Judging by the last internal email I saw about this on Friday, I'd guess not... :( On Sun, May 24, 2009 at 5:25 AM, Dody Gunawinata empirebuil...@gmail.comwrote: Is there any chance for this to come up today? I know it's weekend and the summer. On Fri, May 22, 2009 at 10:21 PM, Jimmy

Re: [IronPython] Performance of dir

2009-05-24 Thread Curt Hagenlocher
The first time you do a dir() of Form, we have to use Reflection to introspect - every member on Form - every member on ContainerControl - every member on ScrollableControl - every member on Control - every member on Component (aka the inheritance hierarchy of Form :D ) After that, the members

Re: [IronPython] with_statement in IronPython 2.6 Alpha

2009-05-21 Thread Curt Hagenlocher
Nope. IronPython looks at only IRONPYTHONPATH. (This is easy to test for yourself! :P) On Thu, May 21, 2009 at 7:12 AM, Jonathan March j...@marchray.net wrote: Why are we discussing the environment variable PYTHONPATH rather than IRONPYTHONPATH? Does IronPython even look at the former? On

Re: [IronPython] with_statement in IronPython 2.6 Alpha

2009-05-19 Thread Curt Hagenlocher
The with statement is available by default in IronPython 2.6 -- you don't need any from __future__ import to use it (though that line should not give an error). I don't remember when we turned it on; it may not have been in Alpha 1 but it's certainly in the current source. On Tue, May 19, 2009 at

Re: [IronPython] Scripting an unmanaged app with IronPython?

2009-05-12 Thread Curt Hagenlocher
Is there any reason you wouldn't just do this with CPython? In a past life, I had a lot of success embedding CPython into a C++ / MFC application. On Tue, May 12, 2009 at 7:48 AM, Mike Krell mbk.li...@gmail.com wrote: I have an unmanaged app written in C++ / MFC that I'd like to script in some

Re: [IronPython] Groovy on the DLR

2009-05-11 Thread Curt Hagenlocher
Interesting. But if you look at the author's blog at http://gavingrover.blogspot.com/2009/05/groovys-groovier-roadmap.html, it sounds like the DLR part is a dead-end and that he plans to move back to Java. On Sun, May 10, 2009 at 12:57 AM, Dody Gunawinata empirebuil...@gmail.comwrote:

Re: [IronPython] adodbapi with ado.net? (on MONO?)

2009-05-11 Thread Curt Hagenlocher
In principle, using ADO.NET and a purely managed database driver would eliminate most native - managed transitions. So in particular, you shouldn't need to marshal string data back and forth any more. On the other hand, database and network I/O is still much more of a bottleneck than local

Re: [IronPython] Silverlight Application Hosting IronPython

2009-05-11 Thread Curt Hagenlocher
I don't know hardly anything about Silverlight, but it might be useful to know what error message you're getting when you fail to load System.Windows. Or if I misread and you're actually failing to import something from the System.Windows namespace in Python code, then it would be good to know

Re: [IronPython] Iron Python and Asp.net (framework 3.5)

2009-05-08 Thread Curt Hagenlocher
As I recall, we were never able to come up with a workaround for a VB web site, but a VB web application could be made to work. It would be easier if IronPython could depend on .NET 3.5, but we still have customers who need it to work on 2.0 and 3.0. There's nothing to prevent you from

Re: [IronPython] Iron Python and Asp.net (framework 3.5)

2009-05-08 Thread Curt Hagenlocher
2? Cheers, Patrik *Från:* users-boun...@lists.ironpython.com [mailto: users-boun...@lists.ironpython.com] *För *Curt Hagenlocher *Skickat:* den 8 maj 2009 15:17 *Till:* Discussion of IronPython *Ämne:* Re: [IronPython] Iron Python and Asp.net (framework 3.5) As I recall, we were

Re: [IronPython] Some Objects not visible in my Shell?

2009-05-06 Thread Curt Hagenlocher
System.Threading is actually in mscorlib, so you'd have to AddReference(mscorlib) as well. Alternatively, you can load both mscorlib and System.dll in your hosting code by saying something like this: ScriptDomainManager.CurrentManager.LoadAssembly(typeof(string).Assembly); //mscorlib.dll

Re: [IronPython] Getting type error when calling a .NET DLL interface.

2009-05-04 Thread Curt Hagenlocher
In a statically-typed language like C#, if you have a reference to an object, you need to tell the compiler that this object is really a Foo in order to use any of Foo's methods with the object. The compiler generates whatever code is necessary to cast the variable to a Foo and will then allow you

Re: [IronPython] .exe is not pre-compiled

2009-05-03 Thread Curt Hagenlocher
deleting it. If this is a Python extension written in C, then you might be able to use it with the Ironclad project ( http://code.google.com/p/ironclad/ ). IronPython itself doesn't support loading C extensions directly. -- Curt Hagenlocher c...@hagenlocher.org

Re: [IronPython] Control event ids

2009-04-30 Thread Curt Hagenlocher
it extremely cumbersome to detach from events (some events, anyway; I'm pretty certain that I've seen events which don't exhibit this behaviour, but I can't remember what they are). An example of this would be useful. -- Curt Hagenlocher c...@hagenlocher.org

Re: [IronPython] Crash with Action and reflection question

2009-04-30 Thread Curt Hagenlocher
instance representing the type? You mean like this? from System.Collections.Generic import List runtimeType = clr.GetClrType(List) -- Curt Hagenlocher c...@hagenlocher.org ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com

Re: [IronPython] Question on Multiple Discrete IronPython sessions in a single process

2009-04-30 Thread Curt Hagenlocher
On Thu, Apr 30, 2009 at 9:08 AM, Michael Foord fuzzy...@voidspace.org.uk wrote: Is CreateEngine not the correct way to get isolated engines? Yes, but it looks like ImportModule is importing into some kind of shared state. -- Curt Hagenlocher c...@hagenlocher.org

Re: [IronPython] Question on Multiple Discrete IronPython sessions in a single process

2009-04-30 Thread Curt Hagenlocher
If you import by executing the text import modname against the ScriptEngine instead of using the import API, you will avoid this particular incarnation of the bug. On Thu, Apr 30, 2009 at 10:25 AM, Lepisto, Stephen P stephen.p.lepi...@intel.com wrote: I voted for fixing the bug. In the

Re: [IronPython] IDLE like functionality

2009-04-29 Thread Curt Hagenlocher
Eagle is a managed version of TCL (that's also hosted on Codeplex) but I doubt that the more-important Tk part is there :). On Wed, Apr 29, 2009 at 6:24 AM, Michael Foord fuzzy...@voidspace.org.ukwrote: Vernon Cole wrote: Actually, the code editor for IDLE (and pythonwin) is written in

Re: [IronPython] sys._getframe(n)?

2009-04-29 Thread Curt Hagenlocher
them all of them through the Python stack frame. I don't know how serious a performance penalty this would exact, but I imagine it's not small. The Unladen Swallow project is likely to face similar tradeoffs. -- Curt Hagenlocher c...@hagenlocher.org

Re: [IronPython] can't inherit??

2009-04-28 Thread Curt Hagenlocher
One immediately apparent problem is that the strategy for formatting the code that initializes attributes is completely broken for Python -- you need to know how far to indent each of the lines in the code and not just the first one. On Mon, Apr 27, 2009 at 11:24 AM, Ivan Porto Carrero

Re: [IronPython] Can't dir ArgIterator

2009-04-27 Thread Curt Hagenlocher
I ran into this a few months back and concluded that it was some kind of internal CLR issue. ArgIterator is a special type, most of whose methods are internal and/or unsafe, and the CLR doesn't seem to like it when we try to specialize a generic method using that type. Is there any particular goal

Re: [IronPython] Can't dir ArgIterator

2009-04-27 Thread Curt Hagenlocher
That's pretty much what we would have to do as well -- special-case based on the type name. It seems to be more trouble than it's worth. On Mon, Apr 27, 2009 at 8:25 AM, Michael Foord fuzzy...@voidspace.org.ukwrote: Curt Hagenlocher wrote: I ran into this a few months back and concluded

Re: [IronPython] Please, help to get started with .Net and IronPython.

2009-04-23 Thread Curt Hagenlocher
It's great that you want to improve your skills. But I feel obliged to point out that IronPython -- and CPython, for that matter -- are about equally susceptible to memory leaks as C#. On Thu, Apr 23, 2009 at 2:00 AM, Vladimir Eremeev wl2...@gmail.com wrote: Dody Gunawinata wrote: Can I

Re: [IronPython] Please, help to get started with .Net and IronPython.

2009-04-23 Thread Curt Hagenlocher
, Apr 23, 2009 at 3:43 PM, William Reade will...@resolversystems.com wrote: I think he's rewriting a C++ component in IronPython, and wants to know how he can minimise the impact on the C# application which hosts it. Curt Hagenlocher wrote: It's great that you want to improve your skills

  1   2   3   4   5   >