From kfarmer at thuban.org Sun Jan 1 12:24:29 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Sun, 1 Jan 2006 03:24:29 -0800 Subject: [IronPython] 1.0 Beta 1 is out now! References: Message-ID: >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) ... shouldn't the strong name of the assembly be delimited so that we know this is a tuple of 2 elements, rather than a tuple of more than 2? Also, is there a way to disambiguate between namespaces from different sources? ie, is there an equivalent to the IL form [assembly]::namespace.type.member, or can an alias be supplied when loading an assembly? -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3516 bytes Desc: not available URL: From sanxiyn at gmail.com Mon Jan 2 03:33:43 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 2 Jan 2006 11:33:43 +0900 Subject: [IronPython] Generators are broken Message-ID: <5b0248170601011833r1a87bbc7g@mail.gmail.com> E:\IronPython-1.0-Beta1>IronPythonConsole IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> def g(): ... yield 1 ... Traceback (most recent call last): Exception: Object reference not set to an instance of an object. >>> Seo Sanghyeon From vagmi.mudumbai at gmail.com Mon Jan 2 06:05:06 2006 From: vagmi.mudumbai at gmail.com (Vagmi Mudumbai) Date: Mon, 2 Jan 2006 10:35:06 +0530 Subject: [IronPython] 1.0 Beta 1 is out now! In-Reply-To: References: <5C0A6F919D675745BB1DBA7412DB68F5BF3B9B@df-foxhound-msg.exchange.corp.microsoft.com> <43B649FB.4060207@objectrealms.net> Message-ID: On 1/1/06, Keith J. Farmer wrote: > That's what's needed.. WiX for Linux -- could call it LiX. > > MSBuild should be able to handle such a beast. > That would be a good idea. But what will you package it as? RPM/DEB or host of other formats. I like Ubuntu and use it on my machine. But RPM is promoted as a standard by LSB. I have personally found working with DEB better than working with RPM. But that is just my opinion. I completely understand that both the technologies achieve the same thing in the end. Making it a RPM or DEB also means that you need to have root privileges on the machine. Linux does not have concepts of advertised installs. Regards, Vagmi -- http://geekswithblogs.net/vagmi.mudumbai http://installneo.blogspot.com 'Given enough eyeballs, all bugs are shallow.' From kfarmer at thuban.org Mon Jan 2 07:17:21 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Sun, 1 Jan 2006 22:17:21 -0800 Subject: [IronPython] 1.0 Beta 1 is out now! References: <5C0A6F919D675745BB1DBA7412DB68F5BF3B9B@df-foxhound-msg.exchange.corp.microsoft.com><43B649FB.4060207@objectrealms.net> Message-ID: Frankly? I'm not sure I'd give a hoot. ;) Provide targets for each that conform to the WiX configuration format, so that a single file could target each. This may require coordination with the WiX team to extend the configuration as required, but otherwise just specify a set of destination file formats -- MSI, RPM, etc -- which are bound elsewhere to packaging providers (WiX, LiX, etc). Of course, it'd be even better to get VS's setup projects to use WiX files. They currently don't, and MSBuild doesn't currently understand vdproj. What does Mono's XBuild (?) have available? ________________________________ From: users-bounces at lists.ironpython.com on behalf of Vagmi Mudumbai Sent: Sun 1/1/2006 9:05 PM On 1/1/06, Keith J. Farmer wrote: > That's what's needed.. WiX for Linux -- could call it LiX. > > MSBuild should be able to handle such a beast. > That would be a good idea. But what will you package it as? RPM/DEB or host of other formats. I like Ubuntu and use it on my machine. But RPM -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 4504 bytes Desc: not available URL: From fantasysoft at hotmail.com Mon Jan 2 09:56:04 2006 From: fantasysoft at hotmail.com (=?gb2312?B?zLcg07G7qg==?=) Date: Mon, 02 Jan 2006 08:56:04 +0000 Subject: [IronPython] Problem in Loading Assembly In-Reply-To: Message-ID: Thank you very much, Martin. The problem has been fixed. I also find that IP 1.0 Beta fixed this bug. It really sounds great. Happy new year and cheer for IP! -----Original Message----- The failure is related to the STAThread attribute on IronPythonConsole's Main. We removed it recently to fix some problems, but we broke other scenarios. the fix will be in the upcoming release. For now, you can set STAThread attribute on the IronPythonConsole's Main and the COM exception should go away. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of ? ?? Sent: Thursday, December 29, 2005 8:36 AM To: users at lists.ironpython.com Subject: [IronPython] Problem in Loading Assembly Dear All, According to Tutorial provided by IronPython itself, I tried the third: IronPython and COM interoperability. But I failed to receive the expecting result. At first, I encountered this error: Traceback (most recent call last): at System.InvalidCastException: Creating an instance of the COM component with CLSID {D45FD2FC-5C6E-11D1-9EC1-00C04FD7081F} from the IClassFactory failed due to the following error: 80004002. And I considered this as version problem. So I tried this tutorial using IronPython 0.9.4. I also encountered other problems. At last, I went back to IronPython 0.9.6 and tried again. How surpring, I didn't encounter the previous problem any more. But I encountered this error: Traceback (most recent call last): at RuntimeError: Could not load assembly AgentServerObjects.dll And more annoyed, I also failed to load all of other external .dll files.By the way, I use .NET 2.0.50727.42. Regards, Michael From luismg at gmx.net Mon Jan 2 14:22:33 2006 From: luismg at gmx.net (Luis M. Gonzalez) Date: Mon, 2 Jan 2006 10:22:33 -0300 Subject: [IronPython] Avalon tutorial Message-ID: <000601c60f9f$9967c810$f8dbebc9@luis> Hi there! I'm having trouble with the Avalon tutorial. In fact, I can't even start... this is the reeor message I get when trying to initialize Windows Presentation Foundation: >>> from avalon import * Traceback (most recent call last): File , line 0, in input##0 File C:\Documents and Settings\Usuario1\Escritorio\IronPython-1.0-Beta1\Tutori al\avalon.py, line 27, in Initialize ImportError: cannot import Animation from Media Any hint? Thanks in advance... Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From lcatalin at siadv.com Mon Jan 2 16:44:48 2006 From: lcatalin at siadv.com (Catalin Lungu) Date: Mon, 2 Jan 2006 16:44:48 +0100 Subject: [IronPython] Avalon tutorial References: <000601c60f9f$9967c810$f8dbebc9@luis> Message-ID: <003001c60fb3$76598a20$c800a8c0@catalin> I am in a similar situation but not only with avalon. When I try to invoke "from System.Windows.Forms import *" I receive the folowing error Traceback (most recent call last): File , line 0, in input##26 ImportError: cannot import Windows from System With System.Drawing too. With Avalon: Warning (from warnings module): File "C:\IronPython-1.0-Beta\Tutorial\avalon.py", line 64 def LoadXaml(filename): SyntaxWarning: import * only allowed at module level >>> Traceback (most recent call last): File "C:\IronPython-1.0-Beta\Tutorial\avalon.py", line 18, in ? sys.LoadAssemblyByName("PresentationCore") AttributeError: 'module' object has no attribute 'LoadAssemblyByName' Thanks, Catalin ----- Original Message ----- From: Luis M. Gonzalez To: users at lists.ironpython.com Sent: Monday, January 02, 2006 2:22 PM Subject: [IronPython] Avalon tutorial Hi there! I'm having trouble with the Avalon tutorial. In fact, I can't even start... this is the reeor message I get when trying to initialize Windows Presentation Foundation: >>> from avalon import * Traceback (most recent call last): File , line 0, in input##0 File C:\Documents and Settings\Usuario1\Escritorio\IronPython-1.0-Beta1\Tutori al\avalon.py, line 27, in Initialize ImportError: cannot import Animation from Media Any hint? Thanks in advance... Luis ------------------------------------------------------------------------------ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jsacksteder at gmail.com Mon Jan 2 17:53:04 2006 From: jsacksteder at gmail.com (jeff sacksteder) Date: Mon, 2 Jan 2006 11:53:04 -0500 Subject: [IronPython] Avalon tutorial In-Reply-To: <003001c60fb3$76598a20$c800a8c0@catalin> References: <000601c60f9f$9967c810$f8dbebc9@luis> <003001c60fb3$76598a20$c800a8c0@catalin> Message-ID: <51c8a7be0601020853l7e610a4fpfb6c946d9b5f356d@mail.gmail.com> Are you using ip.bat or ironpythonconsole.exe? -------------- next part -------------- An HTML attachment was scrubbed... URL: From lcatalin at siadv.com Mon Jan 2 18:21:14 2006 From: lcatalin at siadv.com (Catalin Lungu) Date: Mon, 2 Jan 2006 18:21:14 +0100 Subject: [IronPython] Avalon tutorial References: <000601c60f9f$9967c810$f8dbebc9@luis><003001c60fb3$76598a20$c800a8c0@catalin> <51c8a7be0601020853l7e610a4fpfb6c946d9b5f356d@mail.gmail.com> Message-ID: <002301c60fc0$ef9896d0$c800a8c0@catalin> Hi, If the question is for mi I use both (ip.bat, IronPythonConsole.exe) and I receive the same result. ----- Original Message ----- From: jeff sacksteder To: Discussion of IronPython Sent: Monday, January 02, 2006 5:53 PM Subject: Re: [IronPython] Avalon tutorial Are you using ip.bat or ironpythonconsole.exe? ------------------------------------------------------------------------------ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From luismg at gmx.net Mon Jan 2 18:48:44 2006 From: luismg at gmx.net (Luis M. Gonzalez) Date: Mon, 2 Jan 2006 14:48:44 -0300 Subject: [IronPython] Avalon tutorial Message-ID: <000a01c60fc4$c8b7c050$f8dbebc9@luis> > Are you using ip.bat or ironpythonconsole.exe? I'm using both with the same result. By the way, I'm also having trouble with the winforms tutorial, just like Catalin: >>> from System.Windows.Forms import * Traceback (most recent call last): File , line 0, in input##0 ImportError: cannot import Windows from System Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Mon Jan 2 23:05:35 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 2 Jan 2006 14:05:35 -0800 Subject: [IronPython] Avalon tutorial In-Reply-To: <000a01c60fc4$c8b7c050$f8dbebc9@luis> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5BF3C02@df-foxhound-msg.exchange.corp.microsoft.com> As for the winforms tutorial, I suspect you are forgetting to do "import winforms". However, the winforms.py refers to an old namespace IronPython.Objects that was renamed to IronPython.Runtime After making the change, all works fine. The Avalon works just fine, as far as I can tell. However there were significant changes in Avalon in the last CTP so it may be versioning/setup problem. I hope this helps Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Luis M. Gonzalez Sent: Monday, January 02, 2006 9:49 AM To: users at lists.ironpython.com Subject: [IronPython] Avalon tutorial > Are you using ip.bat or ironpythonconsole.exe? I'm using both with the same result. By the way, I'm also having trouble with the winforms tutorial, just like Catalin: >>> from System.Windows.Forms import * Traceback (most recent call last): File , line 0, in input##0 ImportError: cannot import Windows from System Luis -------------- next part -------------- An HTML attachment was scrubbed... URL: From luismg at gmx.net Tue Jan 3 00:05:12 2006 From: luismg at gmx.net (Luis M. Gonzalez) Date: Mon, 2 Jan 2006 20:05:12 -0300 Subject: [IronPython] Avalon tutorial Message-ID: <000a01c60ff0$fe393ed0$f8dbebc9@luis> > As for the winforms tutorial, I suspect you are forgetting to do "import > winforms" Well, actually this is what happens when trying to import winforms: >>> import winforms Traceback (most recent call last): File , line 0, in input##0 File C:\Documents and Settings\Usuario1\Escritorio\IronPython-1.0-Beta1\Tutori al\winforms.py, line 24, in Initialize ImportError: cannot import Objects from IronPython Anyway, I'm sure this has to be a versioning problem as you said, but I already unintalled and installed everything and keep on getting errors. I will try again... Thanks! Luis From Martin.Maly at microsoft.com Tue Jan 3 00:29:15 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 2 Jan 2006 15:29:15 -0800 Subject: [IronPython] Generators are broken In-Reply-To: <5b0248170601011833r1a87bbc7g@mail.gmail.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5BF3C12@df-foxhound-msg.exchange.corp.microsoft.com> Unfortunately, this is something we broke in Beta 1. The somewhat good news is the bug is limited to interactive console. Thanks for letting us know the fix will come soon. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Sunday, January 01, 2006 6:34 PM To: users at lists.ironpython.com Subject: [IronPython] Generators are broken E:\IronPython-1.0-Beta1>IronPythonConsole IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> def g(): ... yield 1 ... From Martin.Maly at microsoft.com Tue Jan 3 00:31:16 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 2 Jan 2006 15:31:16 -0800 Subject: [IronPython] Avalon tutorial In-Reply-To: <000a01c60ff0$fe393ed0$f8dbebc9@luis> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5BF3C14@df-foxhound-msg.exchange.corp.microsoft.com> Yep, as I said before, we renamed the namespace IronPython.Objects to IronPython.Runtime and I didn't update the winforms.py file. Changing the import statement in the winforms.py to be: from IronPython.Runtime import CallTarget0 will get you going on the winforms front. Not sure what the Avalon problem may be though Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Luis M. Gonzalez Sent: Monday, January 02, 2006 3:05 PM To: users at lists.ironpython.com Subject: [IronPython] Avalon tutorial > As for the winforms tutorial, I suspect you are forgetting to do "import > winforms" Well, actually this is what happens when trying to import winforms: >>> import winforms Traceback (most recent call last): File , line 0, in input##0 File C:\Documents and Settings\Usuario1\Escritorio\IronPython-1.0-Beta1\Tutori al\winforms.py, line 24, in Initialize ImportError: cannot import Objects from IronPython Anyway, I'm sure this has to be a versioning problem as you said, but I already unintalled and installed everything and keep on getting errors. I will try again... Thanks! Luis _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From luismg at gmx.net Tue Jan 3 01:09:27 2006 From: luismg at gmx.net (Luis M. Gonzalez) Date: Mon, 2 Jan 2006 21:09:27 -0300 Subject: [IronPython] Avalon tutorial Message-ID: <000901c60ff9$f7da73c0$f8dbebc9@luis> > Changing the import statement in the winforms.py to be: > from IronPython.Runtime import CallTarget0 will get you going on the > winforms front. Still not working... >>> from IronPython.Runtime import CallTarget0 >>> from System.Windows.Forms import * Traceback (most recent call last): File , line 0, in input##1 ImportError: cannot import Windows from System From Martin.Maly at microsoft.com Tue Jan 3 01:24:39 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 2 Jan 2006 16:24:39 -0800 Subject: [IronPython] Avalon tutorial In-Reply-To: <000901c60ff9$f7da73c0$f8dbebc9@luis> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5BF3C1D@df-foxhound-msg.exchange.corp.microsoft.com> I may not have given clear answer last time. Here is the whole thing: My winforms.py with the fix for Objects=>Runtime change: import sys sys.LoadAssemblyByName("System.Windows.Forms") sys.LoadAssemblyByName("System.Drawing") sys.LoadAssemblyByName("IronPython") from System.Drawing import Size from System.Windows.Forms import Form, Application from System.Threading import Thread # here is the change: from IronPython.Runtime import CallTarget0 import IronPython def thread_proc(): global dispatcher dispatcher = Form(Size = Size(0,0)) dispatcher.Show() dispatcher.Hide() Application.Run() def callback(code): if code: dispatcher.Invoke(CallTarget0(code)) else: Application.Exit() t = Thread(thread_proc) t.Start() IronPython.Hosting.PythonEngine.ExecWrapper = callback The interactive session using IP from the released zip file C:\IronPython-1.0-Beta1\Tutorial>ip.bat IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import winforms >>> from System.Windows.Forms import * >>> f = Form() >>> f.Show() I hope this helps Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Luis M. Gonzalez Sent: Monday, January 02, 2006 4:09 PM To: users at lists.ironpython.com Subject: [IronPython] Avalon tutorial > Changing the import statement in the winforms.py to be: > from IronPython.Runtime import CallTarget0 will get you going on the > winforms front. Still not working... >>> from IronPython.Runtime import CallTarget0 >>> from System.Windows.Forms import * Traceback (most recent call last): File , line 0, in input##1 ImportError: cannot import Windows from System _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Tue Jan 3 01:52:32 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 2 Jan 2006 16:52:32 -0800 Subject: [IronPython] sys.LoadAssembly* changes in 1.0 Beta 1 Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5BF3C27@df-foxhound-msg.exchange.corp.microsoft.com> Hello, One of the design issues that followed IronPython pretty much since the very beginning was to find correct place for the two methods we added into the built-in sys module - sys.LoadAssemblyFromFile and sys.LoadAssemblyByName. The downsides were not only that these methods didn't belong to the built-in sys module, but also the assemblies were loaded by specifying file name or partial assembly name only and there was not a way to load assembly given strong assembly name. In 1.0 Beta 1 we changed the way .NET assemblies are loaded - or referenced. The new model is inspired by the Python's sys.path and import behavior. However, unlike sys.path, which usually contains list of directories, the IronPython references are list (currently tuple, actually) of .NET assemblies. This part was inspired by the assembly references passed to .NET compilers. First, we added a module "clr" which contains the functions to add references to .NET assemblies: * AddReference * AddReferenceToFile * AddReferenceByName * AddReferenceByPartialName They allow adding references to the .NET assemblies by specifying strong assembly name (AddReferenceByName), partial assembly name (AddReferenceByPartialName - formerly sys.LoadAssemblyByName), assembly file (AddReferenceToFile - formerly sys.LoadAssemblyFromFile) or by providing the assembly object (instance of System.Reflection.Assembly) itself (AddReference). AddReference not only adds reference to the assembly object, but also provides convenient way to add reference to the assembly by specifying file name, partial name or strong assembly name. If string argument is passed to AddReference, IronPython will try to interpret it first as strong assembly name, file name or partial assembly name. As a result the function may not give unambiguous results when passing string as a parameter (Susan Cook's blog explains more on this http://blogs.msdn.com/suzcook/archive/2003/05/30/57159.aspx). Using AddReference with string parameter is therefore suitable for interactive console, quick prototypes etc, but we recommend using AddReferenceByName or AddReferenceToFile for the longer-lasting scripts. clr module also has an attribute "References" - a tuple containing all referenced assemblies. While it is a tuple for now, this may - and probably will - change. We view this tuple as the list of assemblies that IronPython searches to find .NET namespaces being imported. For 1.0 Beta 1 we are keeping the sys.LoadAssembly* functions, but encourage you to start using the clr.AddReference* and give us feedback. For Beta 2 we will probably make sys.LoadAssembly* obsolete and will eventually remove them completely. As for the clr.AddReference*, we hope that we are getting closer to the right solution. Nonetheless, lease let us know what you would like to see changed, improved, or added. Thanks Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From lcatalin at siadv.com Tue Jan 3 08:37:23 2006 From: lcatalin at siadv.com (Catalin Lungu) Date: Tue, 3 Jan 2006 08:37:23 +0100 Subject: [IronPython] Avalon tutorial References: <5C0A6F919D675745BB1DBA7412DB68F5BF3C14@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <008e01c61038$8e9e4d70$c800a8c0@catalin> Hi, Changing the namespace Object to Runtime, fix the bug. Thank you all for your support. Catalin. ----- Original Message ----- From: "Martin Maly" To: "Discussion of IronPython" Sent: Tuesday, January 03, 2006 12:31 AM Subject: Re: [IronPython] Avalon tutorial > Yep, as I said before, we renamed the namespace IronPython.Objects to > IronPython.Runtime and I didn't update the winforms.py file. Changing the > import statement in the winforms.py to be: > > from IronPython.Runtime import CallTarget0 > > will get you going on the winforms front. Not sure what the Avalon problem > may be though > > Martin > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Luis M. Gonzalez > Sent: Monday, January 02, 2006 3:05 PM > To: users at lists.ironpython.com > Subject: [IronPython] Avalon tutorial > >> As for the winforms tutorial, I suspect you are forgetting to do "import >> winforms" > > Well, actually this is what happens when trying to import winforms: > >>>> import winforms > Traceback (most recent call last): > File , line 0, in input##0 > File C:\Documents and > Settings\Usuario1\Escritorio\IronPython-1.0-Beta1\Tutori > al\winforms.py, line 24, in Initialize > ImportError: cannot import Objects from IronPython > > Anyway, I'm sure this has to be a versioning problem as you said, > but I already unintalled and installed everything and keep on getting > errors. > I will try again... > > Thanks! > Luis > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From s.kobalczyk at softwaremind.pl Tue Jan 3 13:00:02 2006 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Tue, 03 Jan 2006 13:00:02 +0100 Subject: [IronPython] 1.0 Beta 1 is out now! In-Reply-To: References: Message-ID: <43BA6742.4060408@softwaremind.pl> Thanks for a great New Years present! I'm most interested in what you did to fix the memory issues from previous versions. I've already found the Compile and Execute(object) methods on PythonEngine. Are there any other changes that can help to limit memory footprint when hosting IP? I found one problem with the Compile/Execute duo: in this mode I don't have access to the '_' variable. It can be read when using the Execute(string) method and it was available with the earlier trick to precompile scripts. I found that it is disabled by last parameter in OutputGenerator.GenerateSnippet() method (printExprStmts) that is later passed to CodeGen. I don't know Python enough to know if this is intended behavior but I found the '_' variable really useful for 'multi statement evals'. Szymon Kobalczyk From rcs1000 at amoral.org Tue Jan 3 13:21:26 2006 From: rcs1000 at amoral.org (rcs1000 at amoral.org) Date: Tue, 03 Jan 2006 12:21:26 +0000 Subject: [IronPython] Visual Studio Express Edition Message-ID: <20060103122126.wm9omvug0w00ooow@mail.coolnina97.com> Hi all, In my search for the ultimate (or indeed any) IronPython IDE, I have run across (the free) Visual Studio Express Edition. Can this be used with Iron Python in the way described earlier in this list? Thanks, Robert ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.kobalczyk at softwaremind.pl Tue Jan 3 13:36:32 2006 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Tue, 03 Jan 2006 13:36:32 +0100 Subject: [IronPython] 1.0 Beta 1 is out now! In-Reply-To: <43BA6742.4060408@softwaremind.pl> References: <43BA6742.4060408@softwaremind.pl> Message-ID: <43BA6FD0.1040904@softwaremind.pl> Anopther problem: the method PythonEngine.ExecuteFile() throws System.ArgumentException: Error binding to target method. at System.Delegate.CreateDelegate(Type type, Object target, RuntimeMethodHandle method) It's called from: > IronPython.dll!IronPython.Runtime.Ops.CreateDynamicDelegate(System.Reflection.Emit.DynamicMethod meth = {System.Object showNotification$f2##11(IronPython.Runtime.Frame, System.Object, System.Object)}, System.Type delegateType = "IronPython.Runtime.CallTarget0", object target = {IronPython.Runtime.Frame}) + 0x24 bytes It was working on previous version with exactly the same script. Szymon. From fantasysoft at hotmail.com Tue Jan 3 14:46:05 2006 From: fantasysoft at hotmail.com (Tan Michael) Date: Tue, 03 Jan 2006 13:46:05 +0000 Subject: [IronPython] Problem of debugging IronPython Program Message-ID: Dear All, Happy new year! I really hope IP can grow up more quickly in 2006. :) My silly question is how to debug IronPython program. In the MSDN TV, Jim showed us how to debug IronPython code. But I failed to simulate the case which Jim demoed. The debugger of VS 2005 didn't locate the real exception point in trouble.py, but in the IntOps.cs file. What more strange thing is that the debugger works as Jim's demo shows when I restart the VS 2005 and the project, but the popup window disappears. I really don't know the why. Is it the versioning problem? I use the VS 2005 Professional Edition. Regards, Michael From antony.ma at pisa.org.hk Tue Jan 3 15:49:07 2006 From: antony.ma at pisa.org.hk (Antony Ma) Date: Tue, 3 Jan 2006 22:49:07 +0800 Subject: [IronPython] cStringIO Message-ID: <639ef1600601030649w1480da55kfcb8efcac9e3af53@mail.gmail.com> Hi , I am starting to learn and feel IronPython and now porting some py files to IronPython. How should the cStringIO be handled? Antony -------------- next part -------------- An HTML attachment was scrubbed... URL: From ironpython at bobs.org Tue Jan 3 16:51:14 2006 From: ironpython at bobs.org (Bob Arnson) Date: Tue, 03 Jan 2006 07:51:14 -0800 Subject: [IronPython] Visual Studio Express Edition In-Reply-To: <20060103122126.wm9omvug0w00ooow@mail.coolnina97.com> References: <20060103122126.wm9omvug0w00ooow@mail.coolnina97.com> Message-ID: <43BA9D72.9070207@bobs.org> rcs1000 at amoral.org wrote: > > In my search for the ultimate (or indeed any) IronPython IDE, I have > run across (the free) Visual Studio Express Edition. Can this be used > with Iron Python in the way described earlier in this list? > You can use Visual Studio Express to edit files but the integration talked about won't work. VSExpress does not load additional VSPackages; the minimum edition that does is Visual Studio Standard Edition. From lcatalin at siadv.com Tue Jan 3 16:58:05 2006 From: lcatalin at siadv.com (Catalin Lungu) Date: Tue, 3 Jan 2006 16:58:05 +0100 Subject: [IronPython] IP Tutorial Error Message-ID: <005801c6107e$7bd22090$c800a8c0@catalin> Hello, I compiled the folowing class with "csc" to csextend.dll using System; using System.Collections; public class Simple { private int data; public Simple(int data) { this.data = data; } public override string ToString() { return String.Format("Simple<{0}>", data); } } When I try to use the "csextend.dll" module the return variable is null. >>import clr >>a=clr.AddReferenceToFile("csextend.dll") >>print a None By the way I have tried with another .cs module and I receive the same result. I use VS2005 Professional and IronPython 1.0 - Beta1 Any ideea? Catalin -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Jan 3 18:05:34 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 3 Jan 2006 09:05:34 -0800 Subject: [IronPython] 1.0 Beta 1 is out now! In-Reply-To: <43BA6742.4060408@softwaremind.pl> Message-ID: <4039D552ADAB094BB1EA670F3E96214ED932F8@df-foxhound-msg.exchange.corp.microsoft.com> The change to fix the memory leak issues was to use dynamic methods instead of Reflection.Emit which generates non-garbage collectable types & code. There are some downsides to this in that having a type allowed us to make more optimizations. If you want more information than that hopefully Jim can chime in. The Compile/Execute change gives you a method to re-use compiled Python code within your program. It's usable as a work around if we didn't have the leak fix in Beta 1. It looks like there's some limitations to what can be done dynamically (currently), and if you hit one of those then you could always us this as a work around. But the real long-term purpose will be to provide a way to execute w/o recompiling commonly used code fragments in your program. That will allow you to avoid the overhead of consistently recompiling your scripts when they're not changing (or changing infrequently). I'll file a bug about not having access to the last result of Execute. One option might be to just have Execute return a value - would that be sufficient, or do you want to later access _ in another script?. If you want it from a script it probably makes sense to make it an option (as some people wouldn't want the output for every statement). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Szymon Kobalczyk Sent: Tuesday, January 03, 2006 4:00 AM To: Discussion of IronPython Subject: Re: [IronPython] 1.0 Beta 1 is out now! Thanks for a great New Years present! I'm most interested in what you did to fix the memory issues from previous versions. I've already found the Compile and Execute(object) methods on PythonEngine. Are there any other changes that can help to limit memory footprint when hosting IP? I found one problem with the Compile/Execute duo: in this mode I don't have access to the '_' variable. It can be read when using the Execute(string) method and it was available with the earlier trick to precompile scripts. I found that it is disabled by last parameter in OutputGenerator.GenerateSnippet() method (printExprStmts) that is later passed to CodeGen. I don't know Python enough to know if this is intended behavior but I found the '_' variable really useful for 'multi statement evals'. Szymon Kobalczyk _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Jan 3 18:19:55 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 3 Jan 2006 09:19:55 -0800 Subject: [IronPython] cStringIO In-Reply-To: <639ef1600601030649w1480da55kfcb8efcac9e3af53@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214ED93327@df-foxhound-msg.exchange.corp.microsoft.com> We do have part of a cStringIO implementation - what parts of cStringIO are we currently missing that you need? ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Antony Ma Sent: Tuesday, January 03, 2006 6:49 AM To: users at lists.ironpython.com Subject: [IronPython] cStringIO Hi , I am starting to learn and feel IronPython and now porting some py files to IronPython. How should the cStringIO be handled? Antony -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Tue Jan 3 18:35:12 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 3 Jan 2006 09:35:12 -0800 Subject: [IronPython] IP Tutorial Error In-Reply-To: <005801c6107e$7bd22090$c800a8c0@catalin> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5BF3CDE@df-foxhound-msg.exchange.corp.microsoft.com> clr.AddReferenceToFile doesn't return any value. It only adds reference to the .NET assembly. The assembly will then show up in clr.References tuple. The way to use the clr.AddReference is the same as the former sys.LoadAssembly*: >>> clr.AddReferenceToFile("csextend.dll") >>> import Simple >>> Simple(10) Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Catalin Lungu Sent: Tuesday, January 03, 2006 7:58 AM To: Discussion of IronPython Subject: [IronPython] IP Tutorial Error Hello, I compiled the folowing class with "csc" to csextend.dll using System; using System.Collections; public class Simple { private int data; public Simple(int data) { this.data = data; } public override string ToString() { return String.Format("Simple<{0}>", data); } } When I try to use the "csextend.dll" module the return variable is null. >>import clr >>a=clr.AddReferenceToFile("csextend.dll") >>print a None By the way I have tried with another .cs module and I receive the same result. I use VS2005 Professional and IronPython 1.0 - Beta1 Any ideea? Catalin -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Tue Jan 3 18:48:51 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 3 Jan 2006 09:48:51 -0800 Subject: [IronPython] Problem of debugging IronPython Program In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5BF3CEF@df-foxhound-msg.exchange.corp.microsoft.com> I think in this case Visual Studio may actually be doing the right thing. You are probably running debug build of IronPython that you built yourself. If you do that, VS will find that the exception was thrown by the division statement in IntOps.cs and display that location. At that point, however, your Python division statement is on the stack so you can walk up to it. Alternatively, if you debug IronPython release build, VS will find the location with debug symbols available - your Python source. Ultimately, we want to find solution where even debug build of IronPython can be used to debug Python scripts without having to get into the IronPython source code, but that is yet to come. Hope this helps. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tan Michael Sent: Tuesday, January 03, 2006 5:46 AM To: users at lists.ironpython.com Subject: [IronPython] Problem of debugging IronPython Program Dear All, Happy new year! I really hope IP can grow up more quickly in 2006. :) My silly question is how to debug IronPython program. In the MSDN TV, Jim showed us how to debug IronPython code. But I failed to simulate the case which Jim demoed. The debugger of VS 2005 didn't locate the real exception point in trouble.py, but in the IntOps.cs file. What more strange thing is that the debugger works as Jim's demo shows when I restart the VS 2005 and the project, but the popup window disappears. I really don't know the why. Is it the versioning problem? I use the VS 2005 Professional Edition. Regards, Michael From Martin.Maly at microsoft.com Tue Jan 3 18:50:39 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 3 Jan 2006 09:50:39 -0800 Subject: [IronPython] cStringIO In-Reply-To: <639ef1600601030649w1480da55kfcb8efcac9e3af53@mail.gmail.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5BF3CF4@df-foxhound-msg.exchange.corp.microsoft.com> We have (simple) cStringIO implementation so all you need is "import cStringIO". If you encounter problems/bugs, please let us know and we'll fix them. If you do find problems with our cStringIO, you can fall back to CPython's StringIO module. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Antony Ma Sent: Tuesday, January 03, 2006 6:49 AM To: users at lists.ironpython.com Subject: [IronPython] cStringIO Hi , I am starting to learn and feel IronPython and now porting some py files to IronPython. How should the cStringIO be handled? Antony -------------- next part -------------- An HTML attachment was scrubbed... URL: From haiboluo at exchange.microsoft.com Tue Jan 3 19:26:16 2006 From: haiboluo at exchange.microsoft.com (Haibo Luo) Date: Tue, 3 Jan 2006 10:26:16 -0800 Subject: [IronPython] IP Tutorial Error In-Reply-To: <005801c6107e$7bd22090$c800a8c0@catalin> Message-ID: clr.AddReferenceToFile returns void, so "print a gets None" is expected. clr.References could be what you are looking for. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Catalin Lungu Sent: Tuesday, January 03, 2006 7:58 AM To: Discussion of IronPython Subject: [IronPython] IP Tutorial Error Hello, I compiled the folowing class with "csc" to csextend.dll using System; using System.Collections; public class Simple { private int data; public Simple(int data) { this.data = data; } public override string ToString() { return String.Format("Simple<{0}>", data); } } When I try to use the "csextend.dll" module the return variable is null. >>import clr >>a=clr.AddReferenceToFile("csextend.dll") >>print a None By the way I have tried with another .cs module and I receive the same result. I use VS2005 Professional and IronPython 1.0 - Beta1 Any ideea? Catalin -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdrucker at microsoft.com Wed Jan 4 00:55:16 2006 From: sdrucker at microsoft.com (Steven Drucker) Date: Tue, 3 Jan 2006 15:55:16 -0800 Subject: [IronPython] Some new bugs with asssembly loading... Message-ID: A number of bugs seem to have been introduced with the new assembly loading code: First off, my assemblies will no longer load if they're named x.y (for instance, I was using an assembly that was named Aforge.Imaging). This will break since the code does a .split('.') to find all the names to load. Second, the first time that I call AddReferenceToFile doesn't effect the clr.References list at all, but it adds it the second time. See the following snippet. --------------- C:\SHO\private\sdrucker\vizdiff>ip IronPython 1.0.2194 (Beta) on .NET 2.0.50727.40 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Sy stem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) >>> clr.AddReferenceToFile('C:/code/iplab/AForge/Imaging/bin/Debug/AForgeIma ging .Dll') >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Sy stem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) >>> clr.AddReferenceToFile('C:/code/iplab/AForge/Imaging/bin/Debug/AForgeIma ging .Dll') >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Sy stem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, AForgeI maging, Version=2.2.0.27774, Culture=neutral, PublicKeyToken=null) >>> ---------------- Third, this breaks when I try to import the file. (No module named AForgeImaging): >>> import AForgeImaging Traceback (most recent call last): File , line 0, in input##12 ImportError: No module named AForgeImaging >>> Any assistance would be appreciated... --S From Martin.Maly at microsoft.com Wed Jan 4 01:31:03 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 3 Jan 2006 16:31:03 -0800 Subject: [IronPython] Some new bugs with asssembly loading... In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5BF40A2@df-foxhound-msg.exchange.corp.microsoft.com> Hi Steven, I am not observing the first and second set of the problems you reported. My assembly has name c.d.e.dll and adding reference to it works just fine. It shows up in the References right away also. >>> import clr >>> clr.AddReferenceToFile("D:\\Ip\\IronPython\\c.d.e.dll") >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, c.d.e, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null) As for the import, we do have a bug that affects global-level types in the referenced assembly. Types that are enclosed in the namespace can be imported without problems: >>> import N >>> N.C.M(1,2) 2 Where the assembly c.d.e.dll was compiled from: namespace N { public class C { public static int M(int a, int b) { return a * b; } } } Excluding the namespace N will break if I try to do corresponding: >>> import C < Exception here > Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Steven Drucker Sent: Tuesday, January 03, 2006 3:55 PM To: Discussion of IronPython Subject: [IronPython] Some new bugs with asssembly loading... A number of bugs seem to have been introduced with the new assembly loading code: First off, my assemblies will no longer load if they're named x.y (for instance, I was using an assembly that was named Aforge.Imaging). This will break since the code does a .split('.') to find all the names to load. Second, the first time that I call AddReferenceToFile doesn't effect the clr.References list at all, but it adds it the second time. See the following snippet. --------------- C:\SHO\private\sdrucker\vizdiff>ip IronPython 1.0.2194 (Beta) on .NET 2.0.50727.40 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Sy stem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) >>> clr.AddReferenceToFile('C:/code/iplab/AForge/Imaging/bin/Debug/AForgeIma ging .Dll') >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Sy stem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) >>> clr.AddReferenceToFile('C:/code/iplab/AForge/Imaging/bin/Debug/AForgeIma ging .Dll') >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Sy stem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, AForgeI maging, Version=2.2.0.27774, Culture=neutral, PublicKeyToken=null) >>> ---------------- Third, this breaks when I try to import the file. (No module named AForgeImaging): >>> import AForgeImaging Traceback (most recent call last): File , line 0, in input##12 ImportError: No module named AForgeImaging >>> Any assistance would be appreciated... --S _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From sdrucker at microsoft.com Wed Jan 4 01:58:56 2006 From: sdrucker at microsoft.com (Steven Drucker) Date: Tue, 3 Jan 2006 16:58:56 -0800 Subject: [IronPython] Some new bugs with asssembly loading... Message-ID: Ok, but I'm not sure why my situation is different. I've tried this over and over, and I keep getting the same behavior. The References are not updated until I do it twice, and I can't import my assembly. Could it be something odd about the assembly (this worked fine in ip version 0.9.6)? In fact, if I simply run the 0.9.6 version of IP, it still works just fine. It looks like I've got the most up-to-date CLR. Other potential things that could be different? --S -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Tuesday, January 03, 2006 4:31 PM To: Discussion of IronPython Subject: Re: [IronPython] Some new bugs with asssembly loading... Hi Steven, I am not observing the first and second set of the problems you reported. My assembly has name c.d.e.dll and adding reference to it works just fine. It shows up in the References right away also. >>> import clr >>> clr.AddReferenceToFile("D:\\Ip\\IronPython\\c.d.e.dll") >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, c.d.e, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null) As for the import, we do have a bug that affects global-level types in the referenced assembly. Types that are enclosed in the namespace can be imported without problems: >>> import N >>> N.C.M(1,2) 2 Where the assembly c.d.e.dll was compiled from: namespace N { public class C { public static int M(int a, int b) { return a * b; } } } Excluding the namespace N will break if I try to do corresponding: >>> import C < Exception here > Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Steven Drucker Sent: Tuesday, January 03, 2006 3:55 PM To: Discussion of IronPython Subject: [IronPython] Some new bugs with asssembly loading... A number of bugs seem to have been introduced with the new assembly loading code: First off, my assemblies will no longer load if they're named x.y (for instance, I was using an assembly that was named Aforge.Imaging). This will break since the code does a .split('.') to find all the names to load. Second, the first time that I call AddReferenceToFile doesn't effect the clr.References list at all, but it adds it the second time. See the following snippet. --------------- C:\SHO\private\sdrucker\vizdiff>ip IronPython 1.0.2194 (Beta) on .NET 2.0.50727.40 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Sy stem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) >>> clr.AddReferenceToFile('C:/code/iplab/AForge/Imaging/bin/Debug/AForgeIma ging .Dll') >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Sy stem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) >>> clr.AddReferenceToFile('C:/code/iplab/AForge/Imaging/bin/Debug/AForgeIma ging .Dll') >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Sy stem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, AForgeI maging, Version=2.2.0.27774, Culture=neutral, PublicKeyToken=null) >>> ---------------- Third, this breaks when I try to import the file. (No module named AForgeImaging): >>> import AForgeImaging Traceback (most recent call last): File , line 0, in input##12 ImportError: No module named AForgeImaging >>> Any assistance would be appreciated... --S _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From lcatalin at siadv.com Wed Jan 4 08:21:59 2006 From: lcatalin at siadv.com (Catalin Lungu) Date: Wed, 4 Jan 2006 08:21:59 +0100 Subject: [IronPython] IP Tutorial Error References: Message-ID: <00ac01c610ff$923aa6a0$c800a8c0@catalin> Ok, you have right. In clr.Reference I found "csextend", but when I import "import Simple" the console return: Trackback (most recent call last): File, line 0, in imput ##1 Import Error: No module named Simple I am sure that the name of the C class is Simple. Thanks, Catalin ----- Original Message ----- From: Haibo Luo To: Discussion of IronPython Sent: Tuesday, January 03, 2006 7:26 PM Subject: Re: [IronPython] IP Tutorial Error clr.AddReferenceToFile returns void, so "print a gets None" is expected. clr.References could be what you are looking for. ------------------------------------------------------------------------------ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Catalin Lungu Sent: Tuesday, January 03, 2006 7:58 AM To: Discussion of IronPython Subject: [IronPython] IP Tutorial Error Hello, I compiled the folowing class with "csc" to csextend.dll using System; using System.Collections; public class Simple { private int data; public Simple(int data) { this.data = data; } public override string ToString() { return String.Format("Simple<{0}>", data); } } When I try to use the "csextend.dll" module the return variable is null. >>import clr >>a=clr.AddReferenceToFile("csextend.dll") >>print a None By the way I have tried with another .cs module and I receive the same result. I use VS2005 Professional and IronPython 1.0 - Beta1 Any ideea? Catalin ------------------------------------------------------------------------------ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lcatalin at siadv.com Wed Jan 4 11:44:30 2006 From: lcatalin at siadv.com (Catalin Lungu) Date: Wed, 4 Jan 2006 11:44:30 +0100 Subject: [IronPython] IP Tutorial Error References: <00ac01c610ff$923aa6a0$c800a8c0@catalin> Message-ID: <002501c6111b$d7c048d0$c800a8c0@catalin> Hi, Reproducing the sample of Martin Maly everything is Ok. It will be for the namespace? The tutorial that come with IronP 1.0 - Beta 1 is for this version? Catalin ----- Original Message ----- From: Catalin Lungu To: Discussion of IronPython Sent: Wednesday, January 04, 2006 8:21 AM Subject: Re: [IronPython] IP Tutorial Error Ok, you have right. In clr.Reference I found "csextend", but when I import "import Simple" the console return: Trackback (most recent call last): File, line 0, in imput ##1 Import Error: No module named Simple I am sure that the name of the C class is Simple. Thanks, Catalin ----- Original Message ----- From: Haibo Luo To: Discussion of IronPython Sent: Tuesday, January 03, 2006 7:26 PM Subject: Re: [IronPython] IP Tutorial Error clr.AddReferenceToFile returns void, so "print a gets None" is expected. clr.References could be what you are looking for. ---------------------------------------------------------------------------- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Catalin Lungu Sent: Tuesday, January 03, 2006 7:58 AM To: Discussion of IronPython Subject: [IronPython] IP Tutorial Error Hello, I compiled the folowing class with "csc" to csextend.dll using System; using System.Collections; public class Simple { private int data; public Simple(int data) { this.data = data; } public override string ToString() { return String.Format("Simple<{0}>", data); } } When I try to use the "csextend.dll" module the return variable is null. >>import clr >>a=clr.AddReferenceToFile("csextend.dll") >>print a None By the way I have tried with another .cs module and I receive the same result. I use VS2005 Professional and IronPython 1.0 - Beta1 Any ideea? Catalin ---------------------------------------------------------------------------- _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ------------------------------------------------------------------------------ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From lcatalin at siadv.com Wed Jan 4 12:12:49 2006 From: lcatalin at siadv.com (Catalin Lungu) Date: Wed, 4 Jan 2006 12:12:49 +0100 Subject: [IronPython] IP Tutorial Error References: <00ac01c610ff$923aa6a0$c800a8c0@catalin> <002501c6111b$d7c048d0$c800a8c0@catalin> Message-ID: <001201c6111f$cc657f60$c800a8c0@catalin> By the way, is posible to add another type of file that is not class library? I need to add a form that contain several controls that belongs to System.Windows.Forms. From IP I want to change the properties of that controls, like position, size, color, etc. Is posible and how can I do that? TIA, Catalin ----- Original Message ----- From: Catalin Lungu To: Discussion of IronPython Sent: Wednesday, January 04, 2006 11:44 AM Subject: Re: [IronPython] IP Tutorial Error Hi, Reproducing the sample of Martin Maly everything is Ok. It will be for the namespace? The tutorial that come with IronP 1.0 - Beta 1 is for this version? Catalin ----- Original Message ----- From: Catalin Lungu To: Discussion of IronPython Sent: Wednesday, January 04, 2006 8:21 AM Subject: Re: [IronPython] IP Tutorial Error Ok, you have right. In clr.Reference I found "csextend", but when I import "import Simple" the console return: Trackback (most recent call last): File, line 0, in imput ##1 Import Error: No module named Simple I am sure that the name of the C class is Simple. Thanks, Catalin ----- Original Message ----- From: Haibo Luo To: Discussion of IronPython Sent: Tuesday, January 03, 2006 7:26 PM Subject: Re: [IronPython] IP Tutorial Error clr.AddReferenceToFile returns void, so "print a gets None" is expected. clr.References could be what you are looking for. -------------------------------------------------------------------------- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Catalin Lungu Sent: Tuesday, January 03, 2006 7:58 AM To: Discussion of IronPython Subject: [IronPython] IP Tutorial Error Hello, I compiled the folowing class with "csc" to csextend.dll using System; using System.Collections; public class Simple { private int data; public Simple(int data) { this.data = data; } public override string ToString() { return String.Format("Simple<{0}>", data); } } When I try to use the "csextend.dll" module the return variable is null. >>import clr >>a=clr.AddReferenceToFile("csextend.dll") >>print a None By the way I have tried with another .cs module and I receive the same result. I use VS2005 Professional and IronPython 1.0 - Beta1 Any ideea? Catalin -------------------------------------------------------------------------- _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ---------------------------------------------------------------------------- _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ------------------------------------------------------------------------------ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From fantasysoft at hotmail.com Wed Jan 4 15:56:12 2006 From: fantasysoft at hotmail.com (Michael Tan) Date: Wed, 04 Jan 2006 14:56:12 +0000 Subject: [IronPython] Encoding problem Message-ID: Dear All, Here I am. :) This time, I have another silly problem about encoding of IronPython. According to my experience in programming, now IP can support unicode under interactive mode. If I put the unicode into .py file, the unicode code can not be displayed correctly.And I followed the Python Specification and tried to add the encoding declaration into .py file like this: # -*- coding: utf-8 -*- But this declaration doesn't work. I found that what results in the encoding problem. The fromFile method in Parser.cs is the key factor. Here is the source of fromFile method: public static Parser fromFile(CompilerContext context, string filename) { string data; // we choose ASCII by default, if the file has a Unicode header though // we'll automatically get it as unicode. StreamReader sr = new StreamReader(File.OpenRead(filename), System.Text.Encoding.ASCII); using (sr) { data = sr.ReadToEnd(); sr.Close(); } return new Parser(context, filename, new Tokenizer(context, data.ToCharArray())); } I revised the System.Text.Encoding.ASCII to System.Text.Encoding.Default. The encoding problem was solved. I do hope receive the official comment about this revision. Thank you very much. Regards, Michael From Martin.Maly at microsoft.com Wed Jan 4 17:40:38 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 4 Jan 2006 08:40:38 -0800 Subject: [IronPython] IP Tutorial Error In-Reply-To: <00ac01c610ff$923aa6a0$c800a8c0@catalin> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5BF4220@df-foxhound-msg.exchange.corp.microsoft.com> You are correct. Actually, you are hitting the same problem that Steven Drucker reported yesterday. If the class is top-level (in the global namespace), IronPython won't import it. The simple workaround is to enclose the class in the namespace and then import from namespace import class I hope this helps. This is a bug that we introduced in Beta 1 and will fix it in the next release. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Catalin Lungu Sent: Tuesday, January 03, 2006 11:22 PM To: Discussion of IronPython Subject: Re: [IronPython] IP Tutorial Error Ok, you have right. In clr.Reference I found "csextend", but when I import "import Simple" the console return: Trackback (most recent call last): File, line 0, in imput ##1 Import Error: No module named Simple I am sure that the name of the C class is Simple. Thanks, Catalin ----- Original Message ----- From: Haibo Luo To: Discussion of IronPython Sent: Tuesday, January 03, 2006 7:26 PM Subject: Re: [IronPython] IP Tutorial Error clr.AddReferenceToFile returns void, so "print a gets None" is expected. clr.References could be what you are looking for. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Catalin Lungu Sent: Tuesday, January 03, 2006 7:58 AM To: Discussion of IronPython Subject: [IronPython] IP Tutorial Error Hello, I compiled the folowing class with "csc" to csextend.dll using System; using System.Collections; public class Simple { private int data; public Simple(int data) { this.data = data; } public override string ToString() { return String.Format("Simple<{0}>", data); } } When I try to use the "csextend.dll" module the return variable is null. >>import clr >>a=clr.AddReferenceToFile("csextend.dll") >>print a None By the way I have tried with another .cs module and I receive the same result. I use VS2005 Professional and IronPython 1.0 - Beta1 Any ideea? Catalin ________________________________ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jan 4 17:44:21 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 4 Jan 2006 08:44:21 -0800 Subject: [IronPython] Encoding problem In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214ED93A67@df-foxhound-msg.exchange.corp.microsoft.com> ASCII is actually a fine value here it's just that we don't currently support the # -*- encoding syntax. What we do currently support is the normal Unicode headers at the beginning of files that Windows typically does (CPython also will recognize these). If that's present then we'll decode the file as Unicode otherwise we'll decode it as ASCII (this is a feature of the BCL that we pick up for free). We do have an active bug to support PEP-263 file encoding syntax - which is what you're using here. Based upon your feedback I've raised the priority of this bug but I'm still not sure it'll make our next release. What we'd do then is get the encoding and then re-open the file w/ the correct encoding. It seems like you have a reasonable work around for yourself for the time being but I don't think this will be a portable solution that will work from machine to machine - for example if the default encoding is some non-Unicode encoding then many characters won't be available. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Tan Sent: Wednesday, January 04, 2006 6:56 AM To: users at lists.ironpython.com Subject: [IronPython] Encoding problem Dear All, Here I am. :) This time, I have another silly problem about encoding of IronPython. According to my experience in programming, now IP can support unicode under interactive mode. If I put the unicode into .py file, the unicode code can not be displayed correctly.And I followed the Python Specification and tried to add the encoding declaration into .py file like this: # -*- coding: utf-8 -*- But this declaration doesn't work. I found that what results in the encoding problem. The fromFile method in Parser.cs is the key factor. Here is the source of fromFile method: public static Parser fromFile(CompilerContext context, string filename) { string data; // we choose ASCII by default, if the file has a Unicode header though // we'll automatically get it as unicode. StreamReader sr = new StreamReader(File.OpenRead(filename), System.Text.Encoding.ASCII); using (sr) { data = sr.ReadToEnd(); sr.Close(); } return new Parser(context, filename, new Tokenizer(context, data.ToCharArray())); } I revised the System.Text.Encoding.ASCII to System.Text.Encoding.Default. The encoding problem was solved. I do hope receive the official comment about this revision. Thank you very much. Regards, Michael From jvm_cop at spamcop.net Wed Jan 4 17:50:39 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Wed, 04 Jan 2006 11:50:39 -0500 Subject: [IronPython] Some new bugs with asssembly loading... In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F5BF40A2@df-foxhound-msg.exc hange.corp.microsoft.com> References: Message-ID: <4.3.2.7.2.20060104114252.0671b008@mail.comcast.net> What is causing clr.References to display without any obvious separation of the info for the different assemblies? Shouldn't its ToString make it more clear that there are three different assemblies, e.g. with something like (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089), (System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089), (c.d.e, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null) (using "," as the separator). The way things are, it's certainly not obvious how many assemblies there are in the output. (The first few times I looked at this, I totally missed that System was in there at all!) At 07:31 PM 1/3/2006, Martin Maly wrote (in part) >[snip] >>>> import clr >>>> clr.AddReferenceToFile("D:\\Ip\\IronPython\\c.d.e.dll") >>>> clr.References >(mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, c.d.e, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null) >[snip] J. Merrill / Analytical Software Corp From Martin.Maly at microsoft.com Wed Jan 4 18:21:33 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 4 Jan 2006 09:21:33 -0800 Subject: [IronPython] Some new bugs with asssembly loading... In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5BF4285@df-foxhound-msg.exchange.corp.microsoft.com> Hi Steven, When trying to load the aforge.imaging.dll, I get an exception (below). The bugs in IronPython are: a) we don't tell you about the exception and fail to add clr.References b) on your second try we succeed loading the assembly because we already have it in our internal cache (regardless of the previous failure). Moreover, the only way to load the libraries correctly (and this may be limitation of CLR) is to have them in the same directory as IronPythonConsole.exe (see below for the list of folders CLR scans, looking for AForge.Math - they are IronPython directories, not directory where your Imaging dll came from. I don't know (yet) what to do about this one, but will track it down. After my initial discussion with Jim it seems result of our change in the way we load assemblies - Dino already posted comments on the alias. I am going to checkin a fix for the exception so you get reasonable error message in your case. If you like, you can then use our internal build (\\ironpython\python\latest) but as for the references between Imaging and Math, the only workaround for now is to place the dlls into the directory alongside IronPythonConsole.exe I hope this helps Martin The assembly with display name 'AForge.Math' failed to load in the 'Anonymous' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'AForge.Math, Version=1.0.2195.15851, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'AForge.Math, Version=1.0.2195.15851, Culture=neutral, PublicKeyToken=null' Assembly manager loaded from: C:\WINNT\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll Running under executable D:\Ip\IronPython\Public\IronPythonConsole.vshost.exe --- A detailed error log follows. === Pre-bind state information === LOG: User = REDMOND\martmaly LOG: DisplayName = AForge.Math, Version=1.0.2195.15851, Culture=neutral, PublicKeyToken=null (Fully-specified) LOG: Appbase = file:///D:/Ip/IronPython/Public/ LOG: Initial PrivatePath = NULL Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: No application configuration file found. LOG: Using machine configuration file from C:\WINNT\Microsoft.NET\Framework\v2.0.50727\config\machine.config. LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind). LOG: Attempting download of new URL file:///D:/Ip/IronPython/Public/AForge.Math.DLL. LOG: Attempting download of new URL file:///D:/Ip/IronPython/Public/AForge.Math/AForge.Math.DLL. LOG: Attempting download of new URL file:///D:/Ip/IronPython/Public/AForge.Math.EXE. LOG: Attempting download of new URL file:///D:/Ip/IronPython/Public/AForge.Math/AForge.Math.EXE. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Steven Drucker Sent: Tuesday, January 03, 2006 4:59 PM To: Discussion of IronPython Subject: Re: [IronPython] Some new bugs with asssembly loading... Ok, but I'm not sure why my situation is different. I've tried this over and over, and I keep getting the same behavior. The References are not updated until I do it twice, and I can't import my assembly. Could it be something odd about the assembly (this worked fine in ip version 0.9.6)? In fact, if I simply run the 0.9.6 version of IP, it still works just fine. It looks like I've got the most up-to-date CLR. Other potential things that could be different? --S -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Tuesday, January 03, 2006 4:31 PM To: Discussion of IronPython Subject: Re: [IronPython] Some new bugs with asssembly loading... Hi Steven, I am not observing the first and second set of the problems you reported. My assembly has name c.d.e.dll and adding reference to it works just fine. It shows up in the References right away also. >>> import clr >>> clr.AddReferenceToFile("D:\\Ip\\IronPython\\c.d.e.dll") >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, c.d.e, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null) As for the import, we do have a bug that affects global-level types in the referenced assembly. Types that are enclosed in the namespace can be imported without problems: >>> import N >>> N.C.M(1,2) 2 Where the assembly c.d.e.dll was compiled from: namespace N { public class C { public static int M(int a, int b) { return a * b; } } } Excluding the namespace N will break if I try to do corresponding: >>> import C < Exception here > Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Steven Drucker Sent: Tuesday, January 03, 2006 3:55 PM To: Discussion of IronPython Subject: [IronPython] Some new bugs with asssembly loading... A number of bugs seem to have been introduced with the new assembly loading code: First off, my assemblies will no longer load if they're named x.y (for instance, I was using an assembly that was named Aforge.Imaging). This will break since the code does a .split('.') to find all the names to load. Second, the first time that I call AddReferenceToFile doesn't effect the clr.References list at all, but it adds it the second time. See the following snippet. --------------- C:\SHO\private\sdrucker\vizdiff>ip IronPython 1.0.2194 (Beta) on .NET 2.0.50727.40 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Sy stem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) >>> clr.AddReferenceToFile('C:/code/iplab/AForge/Imaging/bin/Debug/AForgeIma ging .Dll') >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Sy stem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) >>> clr.AddReferenceToFile('C:/code/iplab/AForge/Imaging/bin/Debug/AForgeIma ging .Dll') >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Sy stem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, AForgeI maging, Version=2.2.0.27774, Culture=neutral, PublicKeyToken=null) >>> ---------------- Third, this breaks when I try to import the file. (No module named AForgeImaging): >>> import AForgeImaging Traceback (most recent call last): File , line 0, in input##12 ImportError: No module named AForgeImaging >>> Any assistance would be appreciated... --S _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Wed Jan 4 18:41:09 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 4 Jan 2006 09:41:09 -0800 Subject: [IronPython] Some new bugs with asssembly loading... In-Reply-To: <4.3.2.7.2.20060104114252.0671b008@mail.comcast.net> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5BF42B9@df-foxhound-msg.exchange.corp.microsoft.com> The reason is that clr.References is a tuple without improved formatting. Using tuple was a way to get the idea out there and gather feedback and experiences. Ultimately we may use some custom written tuple-like structure. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Wednesday, January 04, 2006 8:51 AM To: Discussion of IronPython Subject: Re: [IronPython] Some new bugs with asssembly loading... What is causing clr.References to display without any obvious separation of the info for the different assemblies? Shouldn't its ToString make it more clear that there are three different assemblies, e.g. with something like (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089), (System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089), (c.d.e, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null) (using "," as the separator). The way things are, it's certainly not obvious how many assemblies there are in the output. (The first few times I looked at this, I totally missed that System was in there at all!) At 07:31 PM 1/3/2006, Martin Maly wrote (in part) >[snip] >>>> import clr >>>> clr.AddReferenceToFile("D:\\Ip\\IronPython\\c.d.e.dll") >>>> clr.References >(mscorlib, Version=2.0.0.0, Culture=neutral, >PublicKeyToken=b77a5c561934e089, System, Version=2.0.0.0, >Culture=neutral, PublicKeyToken=b77a5c561934e089, c.d.e, >Version=0.0.0.0, Culture=neutral, PublicKeyToken=null) [snip] J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From giles.thomas at resolversystems.com Wed Jan 4 19:02:39 2006 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Wed, 04 Jan 2006 18:02:39 +0000 Subject: [IronPython] Lists of instances of classes In-Reply-To: <43A6F11E.30500@resolversystems.com> References: <43A6F11E.30500@resolversystems.com> Message-ID: <43BC0DBF.2020201@resolversystems.com> Hi, We've found what looks like a bug in list comparison: --------------- IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> class C: ... pass ... >>> c1 = C() >>> c2 = C() >>> [c1, c2] == [c2, c1] True >>> [c1] == [c2] True >>> c1 == c2 False >>> ----------------- Confirmed in 0.9.5, 0.9.6, and 1.0.2190 There is a horrible hack to work around it: ----------------- >>> str([c1, c2]) == str([c2, c1]) False ----------------- Cheers, Giles From giles.thomas at resolversystems.com Wed Jan 4 19:09:26 2006 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Wed, 04 Jan 2006 18:09:26 +0000 Subject: [IronPython] Lists of instances of classes In-Reply-To: <43BC0DBF.2020201@resolversystems.com> References: <43A6F11E.30500@resolversystems.com> <43BC0DBF.2020201@resolversystems.com> Message-ID: <43BC0F56.70009@resolversystems.com> Some more discoveries, following on from the below: --------------- >>> class D: ... pass ... >>> d1 = D() >>> [c1, c2, c1] == [c1, c2, d1] True >>> class E: ... def __init__(self): ... pass ... >>> e1 = E() >>> [c1, c2, c1] == [c1, c2, e1] True >>> e1.foo = "bar" >>> [c1, c2, c1] == [c1, c2, e1] True --------------- Looks like it's just assuming all objects are identical. Regards, Giles Giles Thomas wrote: > Hi, > > We've found what looks like a bug in list comparison: > > --------------- > IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> class C: > ... pass > ... > >>> c1 = C() > >>> c2 = C() > >>> [c1, c2] == [c2, c1] > True > >>> [c1] == [c2] > True > >>> c1 == c2 > False > >>> > ----------------- > > Confirmed in 0.9.5, 0.9.6, and 1.0.2190 > > There is a horrible hack to work around it: > > ----------------- > >>> str([c1, c2]) == str([c2, c1]) > False > ----------------- > > > Cheers, > > Giles > From kfarmer at thuban.org Thu Jan 5 03:23:41 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Wed, 4 Jan 2006 18:23:41 -0800 Subject: [IronPython] Some new bugs with asssembly loading... References: <5C0A6F919D675745BB1DBA7412DB68F5BF42B9@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: Actually, I'm wondering about the usefulness of an assembly delimiter for the import statement. IE, instead of clr.Add*, you have something more like: from (FooAssembly, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) import * This maintains the from/import structure in current use -- it just expands the type that the first argument can handle to include, instead of a python library identifier, an assembly reference. It'd be easier to parse, I think, when dealing with the whole IronPython->Assembly path, rather than hunting for scattered clr.Add* references. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Martin Maly Sent: Wed 1/4/2006 9:41 AM To: Discussion of IronPython Subject: Re: [IronPython] Some new bugs with asssembly loading... The reason is that clr.References is a tuple without improved formatting. Using tuple was a way to get the idea out there and gather feedback and experiences. Ultimately we may use some custom written tuple-like structure. -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 4365 bytes Desc: not available URL: From xtian at babbageclunk.com Thu Jan 5 11:13:22 2006 From: xtian at babbageclunk.com (xtian) Date: Thu, 5 Jan 2006 10:13:22 +0000 Subject: [IronPython] Some new bugs with asssembly loading... In-Reply-To: References: <5C0A6F919D675745BB1DBA7412DB68F5BF42B9@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <8a420c070601050213p63a1f3bcm777f1a91f655a91e@mail.gmail.com> I don't think that would work very well - assemblies and namespaces are orthogonal. The Python equivalent to adding a reference to an assembly is adding a path (or an egg or zip) to sys.path. That's important, because an assembly can contain many different namespaces (in the same way an egg can contain multiple packages or modules, although it's not quite equivalent). You wouldn't necessarily want all of the classes in an assembly to be imported into the global namespace. The main difference is that if you have two assemblies that expose the same namespace, when you do a using statement for that namespace, you'll have all of the members of the namespaces in both assemblies available, while in Python, you'd get only the members of the module that was first on the path. There are pluses and minuses for both cases. xtian On 1/5/06, Keith J. Farmer wrote: > Actually, I'm wondering about the usefulness of an assembly delimiter for the import statement. > > IE, instead of clr.Add*, you have something more like: > > from (FooAssembly, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) import * > > This maintains the from/import structure in current use -- it just expands the type that the first argument can handle to include, instead of a python library identifier, an assembly reference. It'd be easier to parse, I think, when dealing with the whole IronPython->Assembly path, rather than hunting for scattered clr.Add* references. > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of Martin Maly > Sent: Wed 1/4/2006 9:41 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Some new bugs with asssembly loading... > > > > The reason is that clr.References is a tuple without improved formatting. Using tuple was a way to get the idea out there and gather feedback and experiences. Ultimately we may use some custom written tuple-like structure. > > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From william at resolversystems.com Thu Jan 5 12:33:29 2006 From: william at resolversystems.com (William Reade) Date: Thu, 05 Jan 2006 11:33:29 +0000 Subject: [IronPython] Lists of instances of classes In-Reply-To: <43BC0F56.70009@resolversystems.com> References: <43A6F11E.30500@resolversystems.com> <43BC0DBF.2020201@resolversystems.com> <43BC0F56.70009@resolversystems.com> Message-ID: <43BD0409.1080609@resolversystems.com> It appears that tuples have similar problems to lists (tested on 0.9.5 and 1.0b1): ---------- >>> class C: ... pass ... >>> c1 = C() >>> c2 = C() >>> (c1, c2) == (c2, c1) True ---------- Cheers William Giles Thomas wrote: >Some more discoveries, following on from the below: > >--------------- > >>> class D: >... pass >... > >>> d1 = D() > >>> [c1, c2, c1] == [c1, c2, d1] >True > >>> class E: >... def __init__(self): >... pass >... > >>> e1 = E() > >>> [c1, c2, c1] == [c1, c2, e1] >True > >>> e1.foo = "bar" > >>> [c1, c2, c1] == [c1, c2, e1] >True >--------------- > >Looks like it's just assuming all objects are identical. > > >Regards, > >Giles > > >Giles Thomas wrote: > > >>Hi, >> >>We've found what looks like a bug in list comparison: >> >>--------------- >>IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 >>Copyright (c) Microsoft Corporation. All rights reserved. >> >>> class C: >>... pass >>... >> >>> c1 = C() >> >>> c2 = C() >> >>> [c1, c2] == [c2, c1] >>True >> >>> [c1] == [c2] >>True >> >>> c1 == c2 >>False >> >>> >>----------------- >> >>Confirmed in 0.9.5, 0.9.6, and 1.0.2190 >> >>There is a horrible hack to work around it: >> >>----------------- >> >>> str([c1, c2]) == str([c2, c1]) >>False >>----------------- >> >> >>Cheers, >> >>Giles >> >> >> >_______________________________________________ >users mailing list >users at lists.ironpython.com >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From kfarmer at thuban.org Thu Jan 5 12:43:08 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 5 Jan 2006 03:43:08 -0800 Subject: [IronPython] Some new bugs with asssembly loading... References: <5C0A6F919D675745BB1DBA7412DB68F5BF42B9@df-foxhound-msg.exchange.corp.microsoft.com> <8a420c070601050213p63a1f3bcm777f1a91f655a91e@mail.gmail.com> Message-ID: If you don't want all classes in an assembly loaded, then use something other than *. I don't view an assembly as fundamentally different in use from a Python dll. You can import both, and add their namespaces to the global namespace. You use path to specify where the packages may be found -- not where a namespace may be found. I would actually argue that sys.path is not an appropriate approach given the pre-existing rules for loading assemblies. from pythonLib import * .. searches sys.path for pythonLib, and imports the namespace therein from (assembly reference) import * .. uses .NET assembly resolution rules to locate the correct assembly, and imports the namespaces therein As far as merged namespaces, that is effectively a requirement -- see all the bits under System.* that aren't in the same file. Multi-file assemblies also exist and need to be accounted for. Those, plus the localization, versioning, and security features of strong-name referencing, lead me to believe that referencing by strong name is a better direction than specifying the assembly's filename. ________________________________ From: users-bounces at lists.ironpython.com on behalf of xtian Sent: Thu 1/5/2006 2:13 AM I don't think that would work very well - assemblies and namespaces are orthogonal. The Python equivalent to adding a reference to an assembly is adding a path (or an egg or zip) to sys.path. That's important, because an assembly can contain many different namespaces (in the same way an egg can contain multiple packages or modules, although it's not quite equivalent). You wouldn't necessarily want all of the classes in an assembly to be imported into the global namespace. The main difference is that if you have two assemblies that expose the same namespace, when you do a using statement for that namespace, you'll have all of the members of the namespaces in both assemblies available, while in Python, you'd get only the members of the module that was first on the path. There are pluses and minuses for both cases. -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 5073 bytes Desc: not available URL: From glc at well.com Thu Jan 5 16:03:12 2006 From: glc at well.com (Greg Chapman) Date: Thu, 05 Jan 2006 07:03:12 -0800 Subject: [IronPython] Cannot launch generated executables Message-ID: I'm using IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 (Windows XP SP2). It seems that any script I try runs fine if invoked with ironpythonconsole (i.e., from cmd's command line: "ironpythonconsole test.py"). However, when I try to run the generated executable, I first get a dialog box saying "test.exe is not a valid Win32 application", and then get an "Access is denied" message printed to the console. For example, the generated executable for a simple hello world script won't load: def Main(): print "hello world" Main() Any ideas on what's wrong? Thanks. --- Greg Chapman From fantasysoft at hotmail.com Thu Jan 5 16:23:27 2006 From: fantasysoft at hotmail.com (Michael Tan) Date: Thu, 05 Jan 2006 15:23:27 +0000 Subject: [IronPython] The bug about Tuple Message-ID: Dear All, I find these codes that run OK in IP 0.96 throw exception in IP 1.0. Here are the codes: >>> def A(*args): ... print args >>> def B(*args): ... A(*args) B(1,2,3) System.NullReferenceException: Object reference not set to an instance of an object. at IronPython.Runtime.Frame.TryGetLocal(String name, Object& ret) in F:\IronPython-1.0-Beta1\Src\ IronPython\Runtime\Frame.cs:line 67 at IronPython.Runtime.Frame.GetGlobal(String name) in F:\IronPython-1.0-Beta1\Src\IronPython\Runt ime\Frame.cs:line 90 at moduleHolder_1.B$f1(Object args) at moduleHolder_1.B$f1(Object[] ) at IronPython.Runtime.FunctionX.Call(Object[] args) in F:\IronPython-1.0-Beta1\Src\IronPython\Run time\Function.cs:line 968 at IronPython.Runtime.FunctionN.Call(Object arg0, Object arg1, Object arg2) in F:\IronPython-1.0- Beta1\Src\IronPython\Runtime\Function.cs:line 849 at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object func, Object arg0, Objec t arg1, Object arg2) in F:\IronPython-1.0-Beta1\Src\IronPython\Runtime\Ops.cs:line 2055 at input##0(Frame ) at IronPython.Runtime.FrameCodeDelegate.Invoke(Frame frame) at IronPython.Runtime.FrameCode.Run(Frame frame) in F:\IronPython-1.0-Beta1\Src\IronPython\Runtim e\Frame.cs:line 165 at IronPython.Hosting.PythonEngine.DoOneInteractive(Frame topFrame) in F:\IronPython-1.0-Beta1\Sr c\IronPython\Hosting\PythonEngine.cs:line 333 at IronPython.Hosting.PythonEngine.RunInteractive() in F:\IronPython-1.0-Beta1\Src\IronPython\Hos ting\PythonEngine.cs:line 272 Exception: Object reference not set to an instance of an object. When I debug this error, I also find the f_locals in Frame.cs is the key point. When the global function with name B is retrieved, the f_locals is fine. And the workflow continues, the global function with name A should be fetched, but this time f_locals is null! I don't know what reset the f_locals variable, but I guess the Tuple.cs may be the criminal. Regards, Michael From fantasysoft at hotmail.com Thu Jan 5 16:35:30 2006 From: fantasysoft at hotmail.com (Michael Tan) Date: Thu, 05 Jan 2006 15:35:30 +0000 Subject: [IronPython] Another fatal bug when using global key word Message-ID: Dear all, I also encounter another problem in IP. Here is the codes: >>> i = 10 >>> class test: ... global i ... def s(self): ... return i These codes run OK in IP 0.96, but make the IronPythonConsole crash in IP 1.0. When I debug this fatal erro, I also find the factor is this line code in TryGetLocal method: if (dict != null) return dict.TryGetValue(name, out ret); I really find that the Try* method isn't robot enough. Regards, Michael From jimhug at exchange.microsoft.com Thu Jan 5 18:20:07 2006 From: jimhug at exchange.microsoft.com (Jim Hugunin) Date: Thu, 5 Jan 2006 09:20:07 -0800 Subject: [IronPython] The bug about Tuple (and globals and generators) In-Reply-To: Message-ID: There are a number of serious bugs that people have encountered using the interactive console in IronPython 1.0beta1. These bugs are caused by major changes that we (actually I) made to the way the interactive console works for this release. These changes removed a long-standing memory leak that was present in all previous releases where every line typed at the console would consume several K of memory which would never be released until the console was closed. Obviously, this was unacceptable and needed to be fixed before 1.0. Unfortunately, I didn't anticipate how complicated this change was and missed a fairly large number of cases that needed to be changed - hence the bugs with tuple parameters to functions, some uses of globals and any generators. The good news here is that these bugs should only show up when running from the interactive console. The workaround for now is to put any troublesome constructs in a .py file and import them. Moving forward, we're modifying the IronPython test suite so that it runs the majority of tests both in standard import mode and in a mode that simulates interactive console use. This should greatly reduce these errors in the future. All of these bugs should be fixed in the next couple of weeks in beta 2. Sorry for the partially broken console in this release - Jim -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Tan Sent: Thursday, January 05, 2006 7:23 AM To: users at lists.ironpython.com Subject: [IronPython] The bug about Tuple Dear All, I find these codes that run OK in IP 0.96 throw exception in IP 1.0. Here are the codes: >>> def A(*args): ... print args >>> def B(*args): ... A(*args) B(1,2,3) System.NullReferenceException: Object reference not set to an instance of an object. From jeffg at ActiveState.com Thu Jan 5 20:37:55 2006 From: jeffg at ActiveState.com (Jeff Griffiths) Date: Thu, 05 Jan 2006 11:37:55 -0800 Subject: [IronPython] IronPython 1.0 Beta 1 / Mono 1.1.12 Compilation Message-ID: <43BD7593.2060406@activestate.com> I looked into getting IronPython working on Linux with Mono 1.1.12 this morning. In my defense, I just hadn't seen anything about whether this would work either way, so these problems are likely known issues? Some problems: 1. makefile: I changed this: CSC=gmcs then got this: makefile:16: *** missing separator (did you mean TAB instead of 8 spaces?). Stop. I changed the 8 spaces to a tab in vim, then got a little farther: jeffg at apple Src> make gmcs -t:library -r:bin/IronMath.dll -out:bin/IronPython.dll -recurse:IronPython/*.cs IronPython/Compiler/NewTypeMaker.cs(1011,17): error CS0019: Operator `==' cannot be applied to operands of type `System.RuntimeMethodHandle' and `System.RuntimeMethodHandle' IronPython/Hosting/PythonEngine.cs(76,20): warning CS0219: The variable `o' is assigned but its value is never used Compilation failed: 1 error(s), 1 warnings make: *** [bin/IronPython.dll] Error 1 Is this a mono version incompatibility with 1.0 Beta 1? ( just guessing ) Background: we're looking at IronPython to see what kind of effort is involved in debugging it with Komodo. Using the MS .Net Runtime, currently the issues are: - IronPython has no '-u' option. We can hack around this as we did for Jython in the past. - IronPython does not have an 'os' module, which the PyDBGP client currently depends on. Current os module usage includes: os.environ, os.path.*, os.popen, os.getcwd. We have clever ideas about working around this in a fepy-specific code path. - IronPython does not have the logging module. We could fairly easily cobble up a stub one that was good enough... or look at porting enough of the logging module. cheers, JeffG From jimhug at exchange.microsoft.com Thu Jan 5 22:26:00 2006 From: jimhug at exchange.microsoft.com (Jim Hugunin) Date: Thu, 5 Jan 2006 13:26:00 -0800 Subject: [IronPython] IronPython related jobs and internships at Microsoft In-Reply-To: Message-ID: If you'd like to work with us on IronPython and the underlying runtime support for dynamic languages that makes it possible, we have a few positions available. We're looking for one developer, one program manager, one tester and at least one summer intern. See my blog for links to a little more information. http://blogs.msdn.com/hugunin/archive/2006/01/05/509812.aspx If you're interested, please send me (not the list!) email that clearly explains why you'd be the best choice for one of these jobs and attach a current resume. Thanks - Jim From jimhug at exchange.microsoft.com Thu Jan 5 23:41:44 2006 From: jimhug at exchange.microsoft.com (Jim Hugunin) Date: Thu, 5 Jan 2006 14:41:44 -0800 Subject: [IronPython] IronPython 1.0 Beta 1 / Mono 1.1.12 Compilation In-Reply-To: <43BD7593.2060406@activestate.com> Message-ID: Hi Jeff, It would be cool to see IronPython running in Komodo. The makefile doesn't work out of the box on anything except MS's SSCLI implementation. Your change to gmcs looks like the right one to compile on Mono. The TAB bug is one we need to fix. The general experience people report with Mono is that IronPython will run successfully on versions released after a given version of IronPython. I know that the Mono team uses the test suite we ship as part of their testing process. Because Mono is still in beta for the CLIv2 features that we use, it can sometimes take a release for them to catch up. I expect that this lag will go away as Mono gets to a final CLIv2 compatible release and IronPython development slows as we approach 1.0. Interestingly enough, the binaries that we ship will often run on Mono even if the sources can't be completely recompiled. You might want to try that. We'll take -u as a feature request, but if you have a work-around it'll be pretty low priority. Our primary hosting work is centered around making the CLS PythonEngine class as solid and easy to use as possible. It never occurred to me that there'd be a desire to use the command-line as a pseudo-hosting API. IronPython doesn't ship with any of the standard Python libraries that are implemented in Python. It is designed to be used with the Python-2.4 standard Lib directory - just add this to your site.py or copy into the Lib dir with IronPython. You can get an initial os module by doing this. That'll get you os.getcwd. The os.path you get will be the ntpath (there was a recent message about this). You'll probably want to replace that with the posixpath module on a Unixy platform. Os.popen is probably some work, but is a priority for us. This is something we want to get cleaned up. Similarly, you should be able to use the standard logging.py module. I just tried this in beta 1 and it fails because our time module is missing localtime. We're working on these issues too, but you might find a stub module is the best way to get things going in the very near term. Thanks and let us know if you get IronPython running in Komodo - Jim -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Griffiths Sent: Thursday, January 05, 2006 11:38 AM To: users-ironpython.com at lists.ironpython.com Subject: [IronPython] IronPython 1.0 Beta 1 / Mono 1.1.12 Compilation I looked into getting IronPython working on Linux with Mono 1.1.12 this morning. In my defense, I just hadn't seen anything about whether this would work either way, so these problems are likely known issues? Some problems: 1. makefile: I changed this: CSC=gmcs then got this: makefile:16: *** missing separator (did you mean TAB instead of 8 spaces?). Stop. I changed the 8 spaces to a tab in vim, then got a little farther: jeffg at apple Src> make gmcs -t:library -r:bin/IronMath.dll -out:bin/IronPython.dll -recurse:IronPython/*.cs IronPython/Compiler/NewTypeMaker.cs(1011,17): error CS0019: Operator `==' cannot be applied to operands of type `System.RuntimeMethodHandle' and `System.RuntimeMethodHandle' IronPython/Hosting/PythonEngine.cs(76,20): warning CS0219: The variable `o' is assigned but its value is never used Compilation failed: 1 error(s), 1 warnings make: *** [bin/IronPython.dll] Error 1 Is this a mono version incompatibility with 1.0 Beta 1? ( just guessing ) Background: we're looking at IronPython to see what kind of effort is involved in debugging it with Komodo. Using the MS .Net Runtime, currently the issues are: - IronPython has no '-u' option. We can hack around this as we did for Jython in the past. - IronPython does not have an 'os' module, which the PyDBGP client currently depends on. Current os module usage includes: os.environ, os.path.*, os.popen, os.getcwd. We have clever ideas about working around this in a fepy-specific code path. - IronPython does not have the logging module. We could fairly easily cobble up a stub one that was good enough... or look at porting enough of the logging module. cheers, JeffG _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jeffg at ActiveState.com Thu Jan 5 23:55:22 2006 From: jeffg at ActiveState.com (Jeff Griffiths) Date: Thu, 05 Jan 2006 14:55:22 -0800 Subject: [IronPython] IronPython 1.0 Beta 1 / Mono 1.1.12 Compilation In-Reply-To: References: Message-ID: <43BDA3DA.1020307@activestate.com> Hi Jim, Thanks for taking the time to go over our issues. I'll see about building a snapshot of Mono to see if that helps, and have passed along all of your comments to the dev team. Mono is important to us because Komodo is available for OS X and Linux as well. I remember vaguely the bit about using Python's libs with the IronPython interpreter, thanks for reminding me. We'll grind on this some more and let you know how it goes. cheers, JeffG Jim Hugunin wrote: > Hi Jeff, > > It would be cool to see IronPython running in Komodo. > > The makefile doesn't work out of the box on anything except MS's > SSCLI implementation. Your change to gmcs looks like the right one > to compile on Mono. The TAB bug is one we need to fix. > > The general experience people report with Mono is that IronPython > will run successfully on versions released after a given version of > IronPython. I know that the Mono team uses the test suite we ship as > part of their testing process. Because Mono is still in beta for > the CLIv2 features that we use, it can sometimes take a release for > them to catch up. I expect that this lag will go away as Mono gets > to a final CLIv2 compatible release and IronPython development slows > as we approach 1.0. Interestingly enough, the binaries that we ship > will often run on Mono even if the sources can't be completely > recompiled. You might want to try that. > > We'll take -u as a feature request, but if you have a work-around > it'll be pretty low priority. Our primary hosting work is centered > around making the CLS PythonEngine class as solid and easy to use as > possible. It never occurred to me that there'd be a desire to use > the command-line as a pseudo-hosting API. > > IronPython doesn't ship with any of the standard Python libraries > that are implemented in Python. It is designed to be used with the > Python-2.4 standard Lib directory - just add this to your site.py or > copy into the Lib dir with IronPython. You can get an initial os > module by doing this. That'll get you os.getcwd. The os.path you > get will be the ntpath (there was a recent message about this). > You'll probably want to replace that with the posixpath module on a > Unixy platform. Os.popen is probably some work, but is a priority > for us. This is something we want to get cleaned up. > > Similarly, you should be able to use the standard logging.py module. > I just tried this in beta 1 and it fails because our time module is > missing localtime. We're working on these issues too, but you might > find a stub module is the best way to get things going in the very > near term. > > Thanks and let us know if you get IronPython running in Komodo - Jim > > > -----Original Message----- From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff > Griffiths Sent: Thursday, January 05, 2006 11:38 AM To: > users-ironpython.com at lists.ironpython.com Subject: [IronPython] > IronPython 1.0 Beta 1 / Mono 1.1.12 Compilation > > I looked into getting IronPython working on Linux with Mono 1.1.12 > this morning. In my defense, I just hadn't seen anything about > whether this would work either way, so these problems are likely > known issues? > > Some problems: > > 1. makefile: I changed this: > > CSC=gmcs > > then got this: > > makefile:16: *** missing separator (did you mean TAB instead of 8 > spaces?). Stop. > > I changed the 8 spaces to a tab in vim, then got a little farther: > > jeffg at apple Src> make gmcs -t:library -r:bin/IronMath.dll > -out:bin/IronPython.dll -recurse:IronPython/*.cs > IronPython/Compiler/NewTypeMaker.cs(1011,17): error CS0019: Operator > `==' cannot be applied to operands of type > `System.RuntimeMethodHandle' and `System.RuntimeMethodHandle' > IronPython/Hosting/PythonEngine.cs(76,20): warning CS0219: The > variable `o' is assigned but its value is never used Compilation > failed: 1 error(s), 1 warnings make: *** [bin/IronPython.dll] Error 1 > > > > Is this a mono version incompatibility with 1.0 Beta 1? ( just > guessing ) > > Background: we're looking at IronPython to see what kind of effort is > involved in debugging it with Komodo. Using the MS .Net Runtime, > currently the issues are: > > - IronPython has no '-u' option. We can hack around this as we did > for Jython in the past. > > - IronPython does not have an 'os' module, which the PyDBGP client > currently depends on. Current os module usage includes: os.environ, > os.path.*, os.popen, os.getcwd. We have clever ideas about working > around this in a fepy-specific code path. > > - IronPython does not have the logging module. We could fairly easily > cobble up a stub one that was good enough... or look at porting > enough of the logging module. > > cheers, JeffG > > > _______________________________________________ users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jnorthrup at io-informatics.com Fri Jan 6 00:12:16 2006 From: jnorthrup at io-informatics.com (James Northrup) Date: Thu, 5 Jan 2006 15:12:16 -0800 Subject: [IronPython] IronPython 1.0 Beta 1 / Mono 1.1.12 Compilation Message-ID: <63183B4A444D944193B0DC06F808544214C28E@mail-01.io-informatics.com> IronPython appears to be the ideal set of circumstances from which other CLI languages might model themselves. As such, it seems to be the farthest such example along in CLR evolution. The object models of Ruby and Python are close. Is there a clean non-python specific set of design patterns for a nice clean language break while keeping the engine footprint as close as possible? -----Original Message----- Hi Jeff, It would be cool to see IronPython running in Komodo. From vargaz at gmail.com Fri Jan 6 00:13:43 2006 From: vargaz at gmail.com (Zoltan Varga) Date: Fri, 6 Jan 2006 00:13:43 +0100 Subject: [IronPython] IronPython 1.0 Beta 1 / Mono 1.1.12 Compilation In-Reply-To: <43BDA3DA.1020307@activestate.com> References: <43BDA3DA.1020307@activestate.com> Message-ID: <295e750a0601051513u2b217f1cq1e6e83a9f7e8a87f@mail.gmail.com> Hi, The upcoming mono 1.1.13 release will run IronPython 1.0 beta 1. Zoltan On 1/5/06, Jeff Griffiths wrote: > Hi Jim, > > Thanks for taking the time to go over our issues. I'll see about > building a snapshot of Mono to see if that helps, and have passed along > all of your comments to the dev team. Mono is important to us because > Komodo is available for OS X and Linux as well. > > I remember vaguely the bit about using Python's libs with the IronPython > interpreter, thanks for reminding me. We'll grind on this some more and > let you know how it goes. > > cheers, JeffG > > Jim Hugunin wrote: > > Hi Jeff, > > > > It would be cool to see IronPython running in Komodo. > > > > The makefile doesn't work out of the box on anything except MS's > > SSCLI implementation. Your change to gmcs looks like the right one > > to compile on Mono. The TAB bug is one we need to fix. > > > > The general experience people report with Mono is that IronPython > > will run successfully on versions released after a given version of > > IronPython. I know that the Mono team uses the test suite we ship as > > part of their testing process. Because Mono is still in beta for > > the CLIv2 features that we use, it can sometimes take a release for > > them to catch up. I expect that this lag will go away as Mono gets > > to a final CLIv2 compatible release and IronPython development slows > > as we approach 1.0. Interestingly enough, the binaries that we ship > > will often run on Mono even if the sources can't be completely > > recompiled. You might want to try that. > > > > We'll take -u as a feature request, but if you have a work-around > > it'll be pretty low priority. Our primary hosting work is centered > > around making the CLS PythonEngine class as solid and easy to use as > > possible. It never occurred to me that there'd be a desire to use > > the command-line as a pseudo-hosting API. > > > > IronPython doesn't ship with any of the standard Python libraries > > that are implemented in Python. It is designed to be used with the > > Python-2.4 standard Lib directory - just add this to your site.py or > > copy into the Lib dir with IronPython. You can get an initial os > > module by doing this. That'll get you os.getcwd. The os.path you > > get will be the ntpath (there was a recent message about this). > > You'll probably want to replace that with the posixpath module on a > > Unixy platform. Os.popen is probably some work, but is a priority > > for us. This is something we want to get cleaned up. > > > > Similarly, you should be able to use the standard logging.py module. > > I just tried this in beta 1 and it fails because our time module is > > missing localtime. We're working on these issues too, but you might > > find a stub module is the best way to get things going in the very > > near term. > > > > Thanks and let us know if you get IronPython running in Komodo - Jim > > > > > > -----Original Message----- From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff > > Griffiths Sent: Thursday, January 05, 2006 11:38 AM To: > > users-ironpython.com at lists.ironpython.com Subject: [IronPython] > > IronPython 1.0 Beta 1 / Mono 1.1.12 Compilation > > > > I looked into getting IronPython working on Linux with Mono 1.1.12 > > this morning. In my defense, I just hadn't seen anything about > > whether this would work either way, so these problems are likely > > known issues? > > > > Some problems: > > > > 1. makefile: I changed this: > > > > CSC=gmcs > > > > then got this: > > > > makefile:16: *** missing separator (did you mean TAB instead of 8 > > spaces?). Stop. > > > > I changed the 8 spaces to a tab in vim, then got a little farther: > > > > jeffg at apple Src> make gmcs -t:library -r:bin/IronMath.dll > > -out:bin/IronPython.dll -recurse:IronPython/*.cs > > IronPython/Compiler/NewTypeMaker.cs(1011,17): error CS0019: Operator > > `==' cannot be applied to operands of type > > `System.RuntimeMethodHandle' and `System.RuntimeMethodHandle' > > IronPython/Hosting/PythonEngine.cs(76,20): warning CS0219: The > > variable `o' is assigned but its value is never used Compilation > > failed: 1 error(s), 1 warnings make: *** [bin/IronPython.dll] Error 1 > > > > > > > > Is this a mono version incompatibility with 1.0 Beta 1? ( just > > guessing ) > > > > Background: we're looking at IronPython to see what kind of effort is > > involved in debugging it with Komodo. Using the MS .Net Runtime, > > currently the issues are: > > > > - IronPython has no '-u' option. We can hack around this as we did > > for Jython in the past. > > > > - IronPython does not have an 'os' module, which the PyDBGP client > > currently depends on. Current os module usage includes: os.environ, > > os.path.*, os.popen, os.getcwd. We have clever ideas about working > > around this in a fepy-specific code path. > > > > - IronPython does not have the logging module. We could fairly easily > > cobble up a stub one that was good enough... or look at porting > > enough of the logging module. > > > > cheers, JeffG > > > > > > _______________________________________________ users mailing list > > users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ users mailing list > > users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From kfarmer at thuban.org Fri Jan 6 00:28:31 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 5 Jan 2006 15:28:31 -0800 Subject: [IronPython] FW: VBScript issue References: <006001c6124f$6b4f6700$3b64a8c0@polivec.com> Message-ID: A buddy of mine is trying to get information that I don't know how to locate off-hand. Perhaps someone here knows how. This could be a good IP example.. ;) ________________________________ I am trying to use VBScript natively to access some info that isn't (AFAIK) available without shelling out and using something like NTRights.exe or SecEdit.exe. Some of the things I am trying to get info on are the objects in the User Rights Assignment from the Local Security Policy for security audits. We do this with VBScript so that all the windows machines will support the scripts. But since shelling out is kinda slow, I would like to find a way to avoid that. I don't know if a custom COM or .NET object would allow access to these objects without shelling out, but that is the only option I can think of at this point. From Nathan.Ernst at citadelgroup.com Fri Jan 6 01:55:16 2006 From: Nathan.Ernst at citadelgroup.com (Ernst, Nathan) Date: Thu, 5 Jan 2006 18:55:16 -0600 Subject: [IronPython] FW: VBScript issue Message-ID: Keith, try looking at the windows management interface objects (WMI). This is likely something you can query with WMI, and WMI is accessible via COM (and of course thus VBS). -Nathan -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Thursday, January 05, 2006 5:29 PM To: users-ironpython.com at lists.ironpython.com Subject: [IronPython] FW: VBScript issue A buddy of mine is trying to get information that I don't know how to locate off-hand. Perhaps someone here knows how. This could be a good IP example.. ;) ________________________________ I am trying to use VBScript natively to access some info that isn't (AFAIK) available without shelling out and using something like NTRights.exe or SecEdit.exe. Some of the things I am trying to get info on are the objects in the User Rights Assignment from the Local Security Policy for security audits. We do this with VBScript so that all the windows machines will support the scripts. But since shelling out is kinda slow, I would like to find a way to avoid that. I don't know if a custom COM or .NET object would allow access to these objects without shelling out, but that is the only option I can think of at this point. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jeffg at ActiveState.com Fri Jan 6 02:00:46 2006 From: jeffg at ActiveState.com (Jeff Griffiths) Date: Thu, 05 Jan 2006 17:00:46 -0800 Subject: [IronPython] IronPython 1.0 Beta 1 / Mono 1.1.12 Compilation In-Reply-To: <295e750a0601051513u2b217f1cq1e6e83a9f7e8a87f@mail.gmail.com> References: <43BDA3DA.1020307@activestate.com> <295e750a0601051513u2b217f1cq1e6e83a9f7e8a87f@mail.gmail.com> Message-ID: <43BDC13E.8090500@activestate.com> Awesome, thanks for the clarification on that. I suspected I had the wrong version. Oh, and it turns out the debugger client itself does *not* need os.popen. cheers, JeffG Zoltan Varga wrote: > Hi, > > The upcoming mono 1.1.13 release will run IronPython 1.0 beta 1. > > Zoltan > > On 1/5/06, Jeff Griffiths wrote: >> Hi Jim, >> >> Thanks for taking the time to go over our issues. I'll see about >> building a snapshot of Mono to see if that helps, and have passed along >> all of your comments to the dev team. Mono is important to us because >> Komodo is available for OS X and Linux as well. >> >> I remember vaguely the bit about using Python's libs with the IronPython >> interpreter, thanks for reminding me. We'll grind on this some more and >> let you know how it goes. >> >> cheers, JeffG >> >> Jim Hugunin wrote: >>> Hi Jeff, >>> >>> It would be cool to see IronPython running in Komodo. >>> >>> The makefile doesn't work out of the box on anything except MS's >>> SSCLI implementation. Your change to gmcs looks like the right one >>> to compile on Mono. The TAB bug is one we need to fix. >>> >>> The general experience people report with Mono is that IronPython >>> will run successfully on versions released after a given version of >>> IronPython. I know that the Mono team uses the test suite we ship as >>> part of their testing process. Because Mono is still in beta for >>> the CLIv2 features that we use, it can sometimes take a release for >>> them to catch up. I expect that this lag will go away as Mono gets >>> to a final CLIv2 compatible release and IronPython development slows >>> as we approach 1.0. Interestingly enough, the binaries that we ship >>> will often run on Mono even if the sources can't be completely >>> recompiled. You might want to try that. >>> >>> We'll take -u as a feature request, but if you have a work-around >>> it'll be pretty low priority. Our primary hosting work is centered >>> around making the CLS PythonEngine class as solid and easy to use as >>> possible. It never occurred to me that there'd be a desire to use >>> the command-line as a pseudo-hosting API. >>> >>> IronPython doesn't ship with any of the standard Python libraries >>> that are implemented in Python. It is designed to be used with the >>> Python-2.4 standard Lib directory - just add this to your site.py or >>> copy into the Lib dir with IronPython. You can get an initial os >>> module by doing this. That'll get you os.getcwd. The os.path you >>> get will be the ntpath (there was a recent message about this). >>> You'll probably want to replace that with the posixpath module on a >>> Unixy platform. Os.popen is probably some work, but is a priority >>> for us. This is something we want to get cleaned up. >>> >>> Similarly, you should be able to use the standard logging.py module. >>> I just tried this in beta 1 and it fails because our time module is >>> missing localtime. We're working on these issues too, but you might >>> find a stub module is the best way to get things going in the very >>> near term. >>> >>> Thanks and let us know if you get IronPython running in Komodo - Jim >>> >>> >>> -----Original Message----- From: users-bounces at lists.ironpython.com >>> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff >>> Griffiths Sent: Thursday, January 05, 2006 11:38 AM To: >>> users-ironpython.com at lists.ironpython.com Subject: [IronPython] >>> IronPython 1.0 Beta 1 / Mono 1.1.12 Compilation >>> >>> I looked into getting IronPython working on Linux with Mono 1.1.12 >>> this morning. In my defense, I just hadn't seen anything about >>> whether this would work either way, so these problems are likely >>> known issues? >>> >>> Some problems: >>> >>> 1. makefile: I changed this: >>> >>> CSC=gmcs >>> >>> then got this: >>> >>> makefile:16: *** missing separator (did you mean TAB instead of 8 >>> spaces?). Stop. >>> >>> I changed the 8 spaces to a tab in vim, then got a little farther: >>> >>> jeffg at apple Src> make gmcs -t:library -r:bin/IronMath.dll >>> -out:bin/IronPython.dll -recurse:IronPython/*.cs >>> IronPython/Compiler/NewTypeMaker.cs(1011,17): error CS0019: Operator >>> `==' cannot be applied to operands of type >>> `System.RuntimeMethodHandle' and `System.RuntimeMethodHandle' >>> IronPython/Hosting/PythonEngine.cs(76,20): warning CS0219: The >>> variable `o' is assigned but its value is never used Compilation >>> failed: 1 error(s), 1 warnings make: *** [bin/IronPython.dll] Error 1 >>> >>> >>> >>> Is this a mono version incompatibility with 1.0 Beta 1? ( just >>> guessing ) >>> >>> Background: we're looking at IronPython to see what kind of effort is >>> involved in debugging it with Komodo. Using the MS .Net Runtime, >>> currently the issues are: >>> >>> - IronPython has no '-u' option. We can hack around this as we did >>> for Jython in the past. >>> >>> - IronPython does not have an 'os' module, which the PyDBGP client >>> currently depends on. Current os module usage includes: os.environ, >>> os.path.*, os.popen, os.getcwd. We have clever ideas about working >>> around this in a fepy-specific code path. >>> >>> - IronPython does not have the logging module. We could fairly easily >>> cobble up a stub one that was good enough... or look at porting >>> enough of the logging module. >>> >>> cheers, JeffG >>> >>> >>> _______________________________________________ users mailing list >>> users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> _______________________________________________ users mailing list >>> users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> users mailing list >> users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dnguyen16 at houston.rr.com Fri Jan 6 04:18:33 2006 From: dnguyen16 at houston.rr.com (dnguyen16) Date: Thu, 5 Jan 2006 21:18:33 -0600 Subject: [IronPython] IronPython related jobs and internships at Microsoft References: Message-ID: <014a01c6126f$e0b3afe0$6400a8c0@darkhorse> Jim, Can I reply (with the resume) to this email thread or do you have a different email that I can send it to? Thanks, Daniel ----- Original Message ----- From: "Jim Hugunin" To: "Discussion of IronPython" Sent: Thursday, January 05, 2006 3:26 PM Subject: [IronPython] IronPython related jobs and internships at Microsoft > If you'd like to work with us on IronPython and the underlying runtime > support for dynamic languages that makes it possible, we have a few > positions available. We're looking for one developer, one program > manager, one tester and at least one summer intern. See my blog for links > to a little more information. > http://blogs.msdn.com/hugunin/archive/2006/01/05/509812.aspx > > If you're interested, please send me (not the list!) email that clearly > explains why you'd be the best choice for one of these jobs and attach a > current resume. > > Thanks - Jim > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From paparipote at hotmail.com Fri Jan 6 18:19:54 2006 From: paparipote at hotmail.com (Paparipote .) Date: Fri, 06 Jan 2006 13:19:54 -0400 Subject: [IronPython] ValueError: Absolute path information is required Message-ID: In Exercise 1: Merlin the Wizard, task 2: >>>import clr >>>clr.AddReferenceToFile("AgentServerObjects.dll") Traceback (most recent call last): File , line 0, in input##1 File , line 0, in .ctor File , line 0, in AddPathList File , line 0, in CreateListFromExpressions ValueError: Absolute path information is required. Only when I write: >>>import clr >>>clr.AddReferenceToFile("C:\Documents and Settings\egironas\My >>>Documents\My >>>Apps\Py\IronPython-1.0-Beta1\Tutorial\AgentServerObjects.dll") it works. Questions are why? How can I avoid to write all the path? Best regards. _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ From furtwan1 at msu.edu Fri Jan 6 17:59:30 2006 From: furtwan1 at msu.edu (Brandon Furtwangler) Date: Fri, 6 Jan 2006 11:59:30 -0500 Subject: [IronPython] calling multiple python methods Message-ID: <000201c612e2$8fd04de0$af70e9a0$@edu> I am hosting iron python I my C# app and I'm running into problems calling python methods. For example given the following script: (in MethodTest.py) def Method1(): return 5 def Method2(): return 10 and the following C# code: PythonEngine pe = new PythonEngine(); pe.ExecuteFile("MethodTest.py"); Console.WriteLine(pe.Evaluate("1+1")); Console.WriteLine(pe.Evaluate("Method1()")); Console.WriteLine(pe.Evaluate("Method2()")); I would expect the following output: 2 5 10 But I actually get: 2 5 5 I fould out that when I call "Method2()" it actually just calls the first method in the py file.so changing MethodTest.py to: def Method2(): return 10 def Method1(): return 5 then I get the output of: 2 10 10 This is basically a show stopper for me because I need the user to be able to define more than one function which I call from C#. Any suggestions? -Brandon Furtwangler -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Fri Jan 6 18:41:56 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 6 Jan 2006 09:41:56 -0800 Subject: [IronPython] ValueError: Absolute path information is required In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5CFE2C2@df-foxhound-msg.exchange.corp.microsoft.com> Before we release fix for this in the next IronPython release, what you can do is load the assembly using the System.Reflection.Assembly.LoadFrom method and then use: clr.AddReference with the assembly object. That gives you absolute control over the assembly loading process: >>> import System >>> import clr >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) >>> aso = System.Reflection.Assembly.LoadFrom("AgentServerObjects.dll") >>> aso AgentServerObjects, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null >>> clr.AddReference(aso) >>> clr.References (mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, AgentServerObjects, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null) >>> Hope this helps Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote . Sent: Friday, January 06, 2006 9:20 AM To: users at lists.ironpython.com Subject: [IronPython] ValueError: Absolute path information is required In Exercise 1: Merlin the Wizard, task 2: >>>import clr >>>clr.AddReferenceToFile("AgentServerObjects.dll") Traceback (most recent call last): File , line 0, in input##1 File , line 0, in .ctor File , line 0, in AddPathList File , line 0, in CreateListFromExpressions ValueError: Absolute path information is required. Only when I write: >>>import clr >>>clr.AddReferenceToFile("C:\Documents and Settings\egironas\My >>>Documents\My >>>Apps\Py\IronPython-1.0-Beta1\Tutorial\AgentServerObjects.dll") it works. Questions are why? How can I avoid to write all the path? Best regards. _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Mohammed.QadeerAhmed at aes.ws Wed Jan 4 22:42:14 2006 From: Mohammed.QadeerAhmed at aes.ws (Mohammed QadeerAhmed) Date: Wed, 4 Jan 2006 16:42:14 -0500 Subject: [IronPython] Pyenchant Message-ID: <20060104214227.AC9E31BBD6@che.dreamhost.com> Hi all, I am trying to use Pyenchant with IronPython but have not been successful. Here are few things that I tried to get it to work. I have python 2.4 installed and the Pyenchant library using the pre-built windows installer for python 2.4 downloaded from the pyenchant website. After installing IronPython-1.0-Beta1, I copied the enchant folder from 'C:\Python24\Lib\site-packages' and placed it under the IronPython installation folder. Now if I run the IronPythonConsole and type 'import enchant' it gives me the following error - "No module named _enchant". As a different approach I tried compiling the pyenchant library from source using IronPython but was not successful. Does anyone know how to get modules that have been built using the Python Distribution Utilities ('Distutils') to work with IronPython. Thank you, Regards, Qadeer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Fri Jan 6 18:43:43 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 6 Jan 2006 09:43:43 -0800 Subject: [IronPython] ValueError: Absolute path information is required In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214EE72B99@df-foxhound-msg.exchange.corp.microsoft.com> Does clr.AddReference (instead of AddReferenceToFile) work for you instead? I think it should if AgentServerObjects.dll is in the app base (usually iron python's directory), a subdir of the app base called "bin", or a subdir called AgentServerObjects. This is probably due to the change from using LoadFrom to LoadFile. This in many ways is better than LoadFrom but may have some disadvantages as well such as this. Let us know if AddReference doesn't work - if not we may need some improvements still in our loading story. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote . Sent: Friday, January 06, 2006 9:20 AM To: users at lists.ironpython.com Subject: [IronPython] ValueError: Absolute path information is required In Exercise 1: Merlin the Wizard, task 2: >>>import clr >>>clr.AddReferenceToFile("AgentServerObjects.dll") Traceback (most recent call last): File , line 0, in input##1 File , line 0, in .ctor File , line 0, in AddPathList File , line 0, in CreateListFromExpressions ValueError: Absolute path information is required. Only when I write: >>>import clr >>>clr.AddReferenceToFile("C:\Documents and Settings\egironas\My >>>Documents\My >>>Apps\Py\IronPython-1.0-Beta1\Tutorial\AgentServerObjects.dll") it works. Questions are why? How can I avoid to write all the path? Best regards. _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Fri Jan 6 18:50:14 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 6 Jan 2006 09:50:14 -0800 Subject: [IronPython] Pyenchant In-Reply-To: <20060104214227.AC9E31BBD6@che.dreamhost.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5CFE2DC@df-foxhound-msg.exchange.corp.microsoft.com> IronPython doesn't, by default, look under site-packages directory for imported modules. That may be one part of the problem. Also, since as you do "import enchant" and get error "no module named _enchant", I assume that there may be C extension coming with the enchant library. IronPython doesn't as of now, support the C-extension modules written for CPython. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mohammed QadeerAhmed Sent: Wednesday, January 04, 2006 1:42 PM To: users at lists.ironpython.com Subject: [IronPython] Pyenchant Hi all, I am trying to use Pyenchant with IronPython but have not been successful. Here are few things that I tried to get it to work. I have python 2.4 installed and the Pyenchant library using the pre-built windows installer for python 2.4 downloaded from the pyenchant website. After installing IronPython-1.0-Beta1, I copied the enchant folder from 'C:\Python24\Lib\site-packages' and placed it under the IronPython installation folder. Now if I run the IronPythonConsole and type 'import enchant' it gives me the following error - "No module named _enchant". As a different approach I tried compiling the pyenchant library from source using IronPython but was not successful. Does anyone know how to get modules that have been built using the Python Distribution Utilities ('Distutils') to work with IronPython. Thank you, Regards, Qadeer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Fri Jan 6 18:53:25 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 6 Jan 2006 09:53:25 -0800 Subject: [IronPython] calling multiple python methods In-Reply-To: <000201c612e2$8fd04de0$af70e9a0$@edu> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5CFE2E1@df-foxhound-msg.exchange.corp.microsoft.com> This is a bug in IronPython. A workaround you can use before we release the fix is following: In the Options.cs (Src\IronPython\Compiler\Options.cs), change the GenerateDynamicMethods to false: public static bool GenerateDynamicMethods = false; Hope this helps for now and we'll have fix for this soon. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Brandon Furtwangler Sent: Friday, January 06, 2006 9:00 AM To: users at lists.ironpython.com Subject: [IronPython] calling multiple python methods I am hosting iron python I my C# app and I'm running into problems calling python methods. For example given the following script: (in MethodTest.py) def Method1(): return 5 def Method2(): return 10 and the following C# code: PythonEngine pe = new PythonEngine(); pe.ExecuteFile("MethodTest.py"); Console.WriteLine(pe.Evaluate("1+1")); Console.WriteLine(pe.Evaluate("Method1()")); Console.WriteLine(pe.Evaluate("Method2()")); I would expect the following output: 2 5 10 But I actually get: 2 5 5 I fould out that when I call "Method2()" it actually just calls the first method in the py file...so changing MethodTest.py to: def Method2(): return 10 def Method1(): return 5 then I get the output of: 2 10 10 This is basically a show stopper for me because I need the user to be able to define more than one function which I call from C#. Any suggestions? -Brandon Furtwangler -------------- next part -------------- An HTML attachment was scrubbed... URL: From furtwan1 at msu.edu Fri Jan 6 19:08:21 2006 From: furtwan1 at msu.edu (Brandon Furtwangler) Date: Fri, 6 Jan 2006 13:08:21 -0500 Subject: [IronPython] Calling a method with arguments from C# Message-ID: <001901c612ec$2dd4a410$897dec30$@edu> Is it possible to call a python method from C# and pass C# variables as the arguments? For example py: def Method3(person): return person.name If so how do I call this from C# passing in some C# variable as person? I'm thinking it should be something like: pythonEngine.Evaluate("Method3({1})", myPerson); In other words, I'd expect an overload of Evaluate to act as Console.WriteLine and do whatever magic is required to link up the variables. Ideas? Comments? -Brandon Furtwangler -------------- next part -------------- An HTML attachment was scrubbed... URL: From furtwan1 at msu.edu Fri Jan 6 20:35:02 2006 From: furtwan1 at msu.edu (Brandon Furtwangler) Date: Fri, 6 Jan 2006 14:35:02 -0500 Subject: [IronPython] Calling a method with arguments from C# In-Reply-To: <001901c612ec$2dd4a410$897dec30$@edu> Message-ID: <002a01c612f8$4a02ba80$de082f80$@edu> Woot, I think I just wrote the exact method I was requesting. I haven't tested it extensively but it seems to work so far. Here is an example: My python script looks like this (MethodTest.py): def Add(s1, s2): return s1 + s2 And my C# is like this: PythonEngine pe = new PythonEngine(); pe.ExecuteFile("MethodTest.py"); string myString1 = "test1"; string myString2 = "test2"; Console.WriteLine(pe.Evaluate("Add({0}, {1})", myString1, myString2)); Console.WriteLine(pe.Evaluate("Add({0}, {1})", 4, 5)); The output is then: test1test2 9 As you can see I've added an overload to PythonEngine.Evalute that takes an extra params array public object Evaluate(string expr, params object[] args) { Dictionary locals = new Dictionary(); //make sure we have less than 27 args because we are only using 1 letter variable names if (args.Length > 27) return new ArgumentException("You can only pass up to 27 arguments to this method"); //for each argument, associate it with a one letter local variable in python string[] argsVars = new string[args.Length]; for (int i = 0; i < args.Length; i++) { argsVars[i] = ((char)((int)'a' + i)).ToString(); //"a", "b", "c", ... locals.Add(argsVars[i], args[i]); } string exprFormat = string.Format(expr, argsVars); return Builtin.eval(_module, exprFormat, Builtin.globals(_module), locals); } What do you think? Is this something worth adding to the next release? If I'm not mistaken, there isn't an easy way to do this type of thing on your own.please provide feedback because I'm new to IP and I might be missing something simpler. -Brandon Furtwangler _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Brandon Furtwangler Sent: Friday, January 06, 2006 1:08 PM To: users at lists.ironpython.com Subject: [IronPython] Calling a method with arguments from C# Is it possible to call a python method from C# and pass C# variables as the arguments? For example py: def Method3(person): return person.name If so how do I call this from C# passing in some C# variable as person? I'm thinking it should be something like: pythonEngine.Evaluate("Method3({1})", myPerson); In other words, I'd expect an overload of Evaluate to act as Console.WriteLine and do whatever magic is required to link up the variables. Ideas? Comments? -Brandon Furtwangler -------------- next part -------------- An HTML attachment was scrubbed... URL: From paparipote at hotmail.com Sat Jan 7 02:36:36 2006 From: paparipote at hotmail.com (Paparipote .) Date: Fri, 06 Jan 2006 21:36:36 -0400 Subject: [IronPython] List of Python Libraries you think to implement Message-ID: Hello: Do you have an established list of Pyhton 2.4 libraries pending of implementation in future IP versions? Is this possible to know the list? Many, many thanks. Best regards. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From clicklist at gmail.com Sat Jan 7 08:42:51 2006 From: clicklist at gmail.com (Fabio) Date: Sat, 7 Jan 2006 05:42:51 -0200 Subject: [IronPython] Newbie question about 'import' Message-ID: <192d28970601062342i4ff5b9e8r@mail.gmail.com> I'm new in python (and IronPython). I have used the tutorial of IronPython 1.0 Beta, and when I "import first" I receive this error: >>> import first Traceback (most recent call last): File , line 0, in input##0 ImportError: No module named first I think what I need set some like import "Tutorial\first" but I know not the syntax... Someone can help? PS: How I do to in console get help about any command? Thanks for all! Fabio -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Sat Jan 7 08:59:14 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 6 Jan 2006 23:59:14 -0800 Subject: [IronPython] Newbie question about 'import' In-Reply-To: <192d28970601062342i4ff5b9e8r@mail.gmail.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5D9FF0F@df-foxhound-msg.exchange.corp.microsoft.com> Hi Fabio, The tutorial is meant to be ran from the Tutorial directory (there are 2 batch files to execute the IronPythonConsole from there) Other option is to add the Tutorial directory to your sys.path: >>> import sys >>> sys.path.append(sys.prefix + "\\Tutorial") >>> import first Since the tutorial is designed to work from the tutorial directory, I'd recommend using the batch files to start the console. This way, IronPython will run in the correct directory and import lookup paths will be set correctly. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fabio Sent: Friday, January 06, 2006 11:43 PM To: IronPython Subject: [IronPython] Newbie question about 'import' I'm new in python (and IronPython). I have used the tutorial of IronPython 1.0 Beta, and when I "import first" I receive this error: >>> import first Traceback (most recent call last): File , line 0, in input##0 ImportError: No module named first I think what I need set some like import "Tutorial\first" but I know not the syntax... Someone can help? PS: How I do to in console get help about any command? Thanks for all! Fabio -------------- next part -------------- An HTML attachment was scrubbed... URL: From clicklist at gmail.com Sat Jan 7 09:21:15 2006 From: clicklist at gmail.com (Fabio) Date: Sat, 7 Jan 2006 06:21:15 -0200 Subject: [IronPython] Newbie question about 'import' In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F5D9FF0F@df-foxhound-msg.exchange.corp.microsoft.com> References: <192d28970601062342i4ff5b9e8r@mail.gmail.com> <5C0A6F919D675745BB1DBA7412DB68F5D9FF0F@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <192d28970601070021h6c988017y@mail.gmail.com> Thank you, Martin. Worked very fine! Do you know if have some command to obatin help about the commands? like in DOS we can use DIR /? Regards Fabio 2006/1/7, Martin Maly : > > Hi Fabio, > > > > The tutorial is meant to be ran from the Tutorial directory (there are 2 > batch files to execute the IronPythonConsole from there) > > Other option is to add the Tutorial directory to your sys.path: > > > > >>> import sys > > >>> sys.path.append(sys.prefix + "\\Tutorial") > > >>> import first > > > > Since the tutorial is designed to work from the tutorial directory, I'd > recommend using the batch files to start the console. This way, IronPython > will run in the correct directory and import lookup paths will be set > correctly. > > > > Martin > > > ------------------------------ > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Fabio > *Sent:* Friday, January 06, 2006 11:43 PM > *To:* IronPython > *Subject:* [IronPython] Newbie question about 'import' > > > > I'm new in python (and IronPython). > > > > I have used the tutorial of IronPython 1.0 Beta, and when I "import first" > I receive this error: > > > > >>> import first > Traceback (most recent call last): > File , line 0, in input##0 > ImportError: No module named first > > > > I think what I need set some like import "Tutorial\first" but I know not > the syntax... > > > > Someone can help? > > > > PS: How I do to in console get help about any command? > > > > Thanks for all! > > Fabio > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Sat Jan 7 09:29:28 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sat, 7 Jan 2006 00:29:28 -0800 Subject: [IronPython] Newbie question about 'import' In-Reply-To: <192d28970601070021h6c988017y@mail.gmail.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5D9FF13@df-foxhound-msg.exchange.corp.microsoft.com> Depends what you want to find out. The easy way is using dir and __doc__: import sys dir(sys) dir(obj) lists attributes available on the given object dir() lists contents of global namespace __doc__ provides documentation, if any: >>> import first >>> first.add.__doc__ 'add(a, b) -> returns a + b' However, IronPython only provides some information... Consider: IronPython: >>> print pow.__doc__ static object pow(object x, object y) static object pow(object x, object y, object z) CPython: >>> print pow.__doc__ pow(x, y[, z]) -> number With two arguments, equivalent to x**y. With three arguments, equivalent to (x**y) % z, but may be more efficient (e.g. for longs). I find the CPython help extremely useful when it comes to questions on built-in modules or functions, language definition etc. Hope this helps. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fabio Sent: Saturday, January 07, 2006 12:21 AM To: Discussion of IronPython Subject: Re: [IronPython] Newbie question about 'import' Thank you, Martin. Worked very fine! Do you know if have some command to obatin help about the commands? like in DOS we can use DIR /? Regards Fabio 2006/1/7, Martin Maly : Hi Fabio, The tutorial is meant to be ran from the Tutorial directory (there are 2 batch files to execute the IronPythonConsole from there) Other option is to add the Tutorial directory to your sys.path: >>> import sys >>> sys.path.append(sys.prefix + "\\Tutorial") >>> import first Since the tutorial is designed to work from the tutorial directory, I'd recommend using the batch files to start the console. This way, IronPython will run in the correct directory and import lookup paths will be set correctly. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fabio Sent: Friday, January 06, 2006 11:43 PM To: IronPython Subject: [IronPython] Newbie question about 'import' I'm new in python (and IronPython). I have used the tutorial of IronPython 1.0 Beta, and when I "import first" I receive this error: >>> import first Traceback (most recent call last): File , line 0, in input##0 ImportError: No module named first I think what I need set some like import "Tutorial\first" but I know not the syntax... Someone can help? PS: How I do to in console get help about any command? Thanks for all! Fabio _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From alleykat at gmail.com Sat Jan 7 16:03:03 2006 From: alleykat at gmail.com (Travis Watkins) Date: Sat, 7 Jan 2006 09:03:03 -0600 Subject: [IronPython] Newbie question about 'import' In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F5D9FF13@df-foxhound-msg.exchange.corp.microsoft.com> References: <192d28970601070021h6c988017y@mail.gmail.com> <5C0A6F919D675745BB1DBA7412DB68F5D9FF13@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: On 1/7/06, Martin Maly wrote: > >>> print pow.__doc__ >>> help(pow) This will provide nicer formatting of the help text. -- Travis Watkins http://www.realistanew.com From bernardgraham at gmail.com Sat Jan 7 16:51:35 2006 From: bernardgraham at gmail.com (Bernard Graham) Date: Sat, 7 Jan 2006 17:51:35 +0200 Subject: [IronPython] Python Memory Usage Message-ID: Hi there. I am (like many) quite new to IronPython (and Python in general), but I am trying to use it as a scripting language for a MUD system I am creating (like the old text-based games, only multiplayer). Now the scripts are executed and run very frequently (like when timers are executed, or when players type commands, etc). The problem I have is that after about an hour of serving, my windows system goes out of virtual memory. When I remove the references to IronPython and don't execute any scripts, the memory stays stable. I am sure I am using the IronPython engine incorrectly, so I thought that maybe someone would be able to shed some light on this for me. Here is the code I use to run a script (passed as a string to the c# method): pythonEngine = new PythonEngine(); if (parameters != null) { //Pass "parameters" to the script that will be executed foreach (PythonParameter pp in parameters) { pythonEngine.SetVariable(pp.Name, pp.Value); //Variable name/variable value } } pythonEngine.Execute(pythonScript); This is executed everytime any script must be executed. Please let me know if you can spot anything wrong with this... Regards, Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Sat Jan 7 21:18:00 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Sat, 7 Jan 2006 12:18:00 -0800 Subject: [IronPython] Python Memory Usage References: Message-ID: Idle curiosity, but does MooPy run under IP? -- Feyd at DuneMUSH, Feyd at Dune3, etc... but those were PennMUSH installations ;) ________________________________ From: users-bounces at lists.ironpython.com on behalf of Bernard Graham Sent: Sat 1/7/2006 7:51 AM I am (like many) quite new to IronPython (and Python in general), but I am trying to use it as a scripting language for a MUD system I am creating (like the old text-based games, only multiplayer). -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3621 bytes Desc: not available URL: From david at david-irvine.com Sat Jan 7 22:52:05 2006 From: david at david-irvine.com (David Irvine) Date: Sat, 07 Jan 2006 21:52:05 +0000 Subject: [IronPython] is IP for me Message-ID: <1136670732.9877.179.camel@localhost.localdomain> Hi Python newbee spent many years with php. I am looking to write a cross platform non web based app (windows, *nix and MAC). I am looking for 1: Portability 2: Constant GUI based on platform 3: All code to be done in Linux 4: Fast - it has to be fairly quick (python speed) 5: Commercial to begin with then open source after I have made a wee bit of cash (I am trying a new model out) I am wondering if IP is the one or should I use CPython and wxWindows libs etc. Hope you can help all comments no matter how crazy appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Sat Jan 7 23:17:18 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Sat, 7 Jan 2006 14:17:18 -0800 Subject: [IronPython] is IP for me References: <1136670732.9877.179.camel@localhost.localdomain> Message-ID: Forgive the scattered comments -- IP's speed is going to be influenced by the runtime it is executed under: Microsoft's CLR, Mono, or some other third party runtime. Speed gains can be realized by both the underlying runtime as well as the efficiency of the IL being generated. Mono is a suitable runtime for non-Windows systems, and generally supports IP at the Mono release following an IP release (they use IP as part of their test suite). It's still catching up to full parity, but releases more often than either CPython or Microsoft, so there is the potential for swiftly closing any gaps that may exist. Completeness of the BCL may or may not be an issue, depending on your needs. That said, have you checked out Phalanger? It's an implementation of PHP for .NET, which may grant you more immediate satisfaction for a commercial project. As I understand, it's also more mature than IP (not being a PHP-head, this is mere conjecture), and still grants access to the BCL. GUI: Mono's working on System.Windows parity, as I understand, but has Gtk# available already. I understand there's also a WxWindows port to .NET which may be usable. There's also Cocoa#, but that's going to be Mac-specific. Personally, I'd recommend using System.Windows unless you absolutely could not, just as a point of not having to install yet-another-GUI-library. ________________________________ From: users-bounces at lists.ironpython.com on behalf of David Irvine Sent: Sat 1/7/2006 1:52 PM To: Discussion of IronPython Subject: [IronPython] is IP for me Hi Python newbee spent many years with php. I am looking to write a cross platform non web based app (windows, *nix and MAC). I am looking for 1: Portability 2: Constant GUI based on platform 3: All code to be done in Linux 4: Fast - it has to be fairly quick (python speed) 5: Commercial to begin with then open source after I have made a wee bit of cash (I am trying a new model out) I am wondering if IP is the one or should I use CPython and wxWindows libs etc. Hope you can help all comments no matter how crazy appreciated. -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 5006 bytes Desc: not available URL: From clicklist at gmail.com Sun Jan 8 01:41:56 2006 From: clicklist at gmail.com (Fabio) Date: Sat, 7 Jan 2006 22:41:56 -0200 Subject: [IronPython] Method overload Message-ID: <192d28970601071641y3cb78f1eg@mail.gmail.com> I'm studing IronPython and I liked very much! But I have one question. In .Net Framework, several classes has method overload. In my study, Python does not support method overload, and when we define methods with the same name, they are redefined then only the last is used. How IronPython handle this? By example, the method "System.Console.Write()" has 18 overloads! This will work in .Net? Regards Fabio -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Sun Jan 8 03:51:51 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Sat, 07 Jan 2006 21:51:51 -0500 Subject: [IronPython] is IP for me In-Reply-To: <1136670732.9877.179.camel@localhost.localdomain> Message-ID: <4.3.2.7.2.20060107215140.02bd86b8@mail.comcast.net> From what you say, CPython would be a better fit than IP (IMO) -- unless your target audience is people who work at big companies with very anal system administrators (they might disallow install of anything that isn't "100% managed code). You could also consider, if you're about to learn a new language to do this project, Ruby -- though Python (CPython in particular) is considerably more mature. Good luck... At 04:52 PM 1/7/2006, David Irvine wrote >Hi > >Python newbee spent many years with php. I am looking to write a cross platform non web based app (windows, *nix and MAC). I am looking for > >1: Portability >2: Constant GUI based on platform >3: All code to be done in Linux >4: Fast - it has to be fairly quick (python speed) >5: Commercial to begin with then open source after I have made a wee bit of cash (I am trying a new model out) > >I am wondering if IP is the one or should I use CPython and wxWindows libs etc. > >Hope you can help all comments no matter how crazy appreciated. J. Merrill / Analytical Software Corp From Martin.Maly at microsoft.com Sun Jan 8 06:48:04 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sat, 7 Jan 2006 21:48:04 -0800 Subject: [IronPython] Method overload In-Reply-To: <192d28970601071641y3cb78f1eg@mail.gmail.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5D9FF5C@df-foxhound-msg.exchange.corp.microsoft.com> Yes, it will work on .NET. IronPython will try to find the 'best fit' among the overloads based on types of arguments that you pass to the method call. There may be cases when IronPython may not choose the right method ... and we want to hear about those cases so we can fix them. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fabio Sent: Saturday, January 07, 2006 4:42 PM To: IronPython Subject: [IronPython] Method overload I'm studing IronPython and I liked very much! But I have one question. In .Net Framework, several classes has method overload. In my study, Python does not support method overload, and when we define methods with the same name, they are redefined then only the last is used. How IronPython handle this? By example, the method "System.Console.Write()" has 18 overloads! This will work in .Net? Regards Fabio -------------- next part -------------- An HTML attachment was scrubbed... URL: From clicklist at gmail.com Sun Jan 8 07:13:20 2006 From: clicklist at gmail.com (Fabio) Date: Sun, 8 Jan 2006 04:13:20 -0200 Subject: [IronPython] Method overload In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F5D9FF5C@df-foxhound-msg.exchange.corp.microsoft.com> References: <192d28970601071641y3cb78f1eg@mail.gmail.com> <5C0A6F919D675745BB1DBA7412DB68F5D9FF5C@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <192d28970601072213i4926f12ay@mail.gmail.com> Thank you, Martin And when we develop new classes in IronPython, already exists some guideline about method overload? Using the previous example, if I wish create a " System.Console" class with in a "Write()" method with 18 overloads? Regards Fabio 2006/1/8, Martin Maly : > > Yes, it will work on .NET. IronPython will try to find the 'best fit' > among the overloads based on types of arguments that you pass to the method > call. There may be cases when IronPython may not choose the right method ? > and we want to hear about those cases so we can fix them. > > > > Martin > > > ------------------------------ > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Fabio > *Sent:* Saturday, January 07, 2006 4:42 PM > *To:* IronPython > *Subject:* [IronPython] Method overload > > > > I'm studing IronPython and I liked very much! > > > > But I have one question. > > > > In .Net Framework, several classes has method overload. In my study, > Python does not support method overload, and when we define methods with > the same name, they are redefined then only the last is used. > > > > How IronPython handle this? By example, the method "System.Console.Write()" > has 18 overloads! This will work in .Net? > > > > Regards > > Fabio > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at david-irvine.com Sun Jan 8 14:19:25 2006 From: david at david-irvine.com (David Irvine) Date: Sun, 08 Jan 2006 13:19:25 +0000 Subject: [IronPython] {Dangerous Content?} RE: is IP for me In-Reply-To: References: <1136670732.9877.179.camel@localhost.localdomain> Message-ID: <1136726367.7518.6.camel@localhost.localdomain> Many thanks Keith (and Martin) I think it looks like CPython and wxPython for me and that way I can create a cross platform app. I looked at phplanger and its very interesting. My own feeling is for web apps PHP cannot be beaten but for traditional apps and socket programming etc. Python is a better solution (I have not looked at ruby though, which I should). I am a wee bit lost as to exactly what .net / mono offers programmers. I was under the impression that I could do a gui based app on mono and it would work on .net although I was unsure of the gtk bindings and how they convert to work with windows ? Just lack of research on my behalf. I am ideally looking to protect my app in the short term (earn some revenue) and then open source it. This is where python fails a bit as its dead easy to reverse engineer (even just supplying the pyc files alone). I guess I am going to create my app / idea and see what the world thinks and hope nobody steals it too early (if it's any good). Many thanks for all your ideas and I will watch IP with great interest. David PS I left the full mail below - my server is noting some attachment as dangerous - FYI On Sat, 2006-01-07 at 14:17 -0800, Keith J. Farmer wrote: > Warning: This message has had one or more attachments removed > Warning: (not named). > Warning: Please read the "WEB-DNS-Attachment-Warning.txt" attachment(s) for more information. > > Forgive the scattered comments -- > > IP's speed is going to be influenced by the runtime it is executed under: Microsoft's CLR, Mono, or some other third party runtime. Speed gains can be realized by both the underlying runtime as well as the efficiency of the IL being generated. > > Mono is a suitable runtime for non-Windows systems, and generally supports IP at the Mono release following an IP release (they use IP as part of their test suite). It's still catching up to full parity, but releases more often than either CPython or Microsoft, so there is the potential for swiftly closing any gaps that may exist. Completeness of the BCL may or may not be an issue, depending on your needs. > > That said, have you checked out Phalanger? It's an implementation of PHP for .NET, which may grant you more immediate satisfaction for a commercial project. As I understand, it's also more mature than IP (not being a PHP-head, this is mere conjecture), and still grants access to the BCL. > > GUI: Mono's working on System.Windows parity, as I understand, but has Gtk# available already. I understand there's also a WxWindows port to .NET which may be usable. There's also Cocoa#, but that's going to be Mac-specific. Personally, I'd recommend using System.Windows unless you absolutely could not, just as a point of not having to install yet-another-GUI-library. > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of David Irvine > Sent: Sat 1/7/2006 1:52 PM > To: Discussion of IronPython > Subject: [IronPython] is IP for me > > > Hi > > Python newbee spent many years with php. I am looking to write a cross platform non web based app (windows, *nix and MAC). I am looking for > > 1: Portability > 2: Constant GUI based on platform > 3: All code to be done in Linux > 4: Fast - it has to be fairly quick (python speed) > 5: Commercial to begin with then open source after I have made a wee bit of cash (I am trying a new model out) > > I am wondering if IP is the one or should I use CPython and wxWindows libs etc. > > Hope you can help all comments no matter how crazy appreciated. --



David Irvine

Mobile 07977 583 031
-------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Sun Jan 8 18:38:08 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Sun, 8 Jan 2006 09:38:08 -0800 Subject: [IronPython] {Dangerous Content?} RE: is IP for me References: <1136670732.9877.179.camel@localhost.localdomain> <1136726367.7518.6.camel@localhost.localdomain> Message-ID: Your web server is hyper-sensitive -- what you're seeing is evidence that I am using Outlook Web Access. I don't know the details, but historically OWA has always added a small attachment. This is a known oddity. The best way to discover what .NET has to offer is to sit down and use it exclusively for a couple months. There's just so much goodness and extensibility baked in that it's taking, literally, years to realize some of the implications. Web apps: You haven't used ASP.NET, and you also confuse language with platform. You could do ASP.NET (platform) using PHP (language) to get both the benefits of a language you obviously enjoy with a platform that I, personally, think kicks the snot out of the ASP/JSP/CGI-style web development. Seriously, try it -- it's amazing what you can do when you model a web page as a control tree you can fire events on. Regarding GUI under Mono, you must realize that it's no different from GUI in Python, Java, or C++ -- you pick some library (tkinter, wxPython, gtk, etc) and use it. There *happens* to be a canonical namespace reserved in Microsoft's framework (System.Windows) which is in the process of being implemented in Mono. You don't have to use it -- you could just as well use gtk# or the .NET wxWindows binding -- but you'd have to package whatever library you choose and ensure it was installed on the destination machine. This is true no matter which path you choose, but once Mono has full parity in the System.Windows namespace, you can assume that library as a pre-installed constant. Reverse engineering: every platform has that problem. You do, after all, have to be able to run it. ________________________________ From: David Irvine on behalf of David Irvine Sent: Sun 1/8/2006 5:19 AM To: Keith J. Farmer Cc: Discussion of IronPython Subject: Re: {Dangerous Content?} RE: [IronPython] is IP for me Many thanks Keith (and Martin) I think it looks like CPython and wxPython for me and that way I can create a cross platform app. I looked at phplanger and its very interesting. My own feeling is for web apps PHP cannot be beaten but for traditional apps and socket programming etc. Python is a better solution (I have not looked at ruby though, which I should). I am a wee bit lost as to exactly what .net / mono offers programmers. I was under the impression that I could do a gui based app on mono and it would work on .net although I was unsure of the gtk bindings and how they convert to work with windows ? Just lack of research on my behalf. I am ideally looking to protect my app in the short term (earn some revenue) and then open source it. This is where python fails a bit as its dead easy to reverse engineer (even just supplying the pyc files alone). I guess I am going to create my app / idea and see what the world thinks and hope nobody steals it too early (if it's any good). Many thanks for all your ideas and I will watch IP with great interest. David PS I left the full mail below - my server is noting some attachment as dangerous - FYI On Sat, 2006-01-07 at 14:17 -0800, Keith J. Farmer wrote: Warning: This message has had one or more attachments removed Warning: (not named). Warning: Please read the "WEB-DNS-Attachment-Warning.txt" attachment(s) for more information. Forgive the scattered comments -- IP's speed is going to be influenced by the runtime it is executed under: Microsoft's CLR, Mono, or some other third party runtime. Speed gains can be realized by both the underlying runtime as well as the efficiency of the IL being generated. Mono is a suitable runtime for non-Windows systems, and generally supports IP at the Mono release following an IP release (they use IP as part of their test suite). It's still catching up to full parity, but releases more often than either CPython or Microsoft, so there is the potential for swiftly closing any gaps that may exist. Completeness of the BCL may or may not be an issue, depending on your needs. That said, have you checked out Phalanger? It's an implementation of PHP for .NET, which may grant you more immediate satisfaction for a commercial project. As I understand, it's also more mature than IP (not being a PHP-head, this is mere conjecture), and still grants access to the BCL. GUI: Mono's working on System.Windows parity, as I understand, but has Gtk# available already. I understand there's also a WxWindows port to .NET which may be usable. There's also Cocoa#, but that's going to be Mac-specific. Personally, I'd recommend using System.Windows unless you absolutely could not, just as a point of not having to install yet-another-GUI-library. ________________________________ From: users-bounces at lists.ironpython.com on behalf of David Irvine Sent: Sat 1/7/2006 1:52 PM To: Discussion of IronPython Subject: [IronPython] is IP for me Hi Python newbee spent many years with php. I am looking to write a cross platform non web based app (windows, *nix and MAC). I am looking for 1: Portability 2: Constant GUI based on platform 3: All code to be done in Linux 4: Fast - it has to be fairly quick (python speed) 5: Commercial to begin with then open source after I have made a wee bit of cash (I am trying a new model out) I am wondering if IP is the one or should I use CPython and wxWindows libs etc. Hope you can help all comments no matter how crazy appreciated. --



David Irvine

Mobile 07977 583 031
From david at david-irvine.com Sun Jan 8 19:37:21 2006 From: david at david-irvine.com (David Irvine) Date: Sun, 08 Jan 2006 18:37:21 +0000 Subject: [IronPython] {Dangerous Content?} RE: is IP for me In-Reply-To: References: <1136670732.9877.179.camel@localhost.localdomain> <1136726367.7518.6.camel@localhost.localdomain> Message-ID: <1136745442.7518.16.camel@localhost.localdomain> Ah its the outlook attachment (can't remember the name some servers appear to reject it). Again many thanks for your answer - one last question honest (I find people can explain loads from a few words as opposed to some web docs). When you say """you pick some library (tkinter, wxPython, gtk, etc) and use it. There *happens* to be a canonical namespace reserved in Microsoft's framework (System.Windows) which is in the process of being implemented in Mono. """ Does that mean under a .net platform say mono I could create a gtk app and it would simply work on an MS platform using .net native ? This would be great indeed. FYI I watch a system called ippfp http://ippfp.sourceforge.net/ which interestingly is a php system which allows your code to run in curses (text), pdf ??, xhtml (web) and gtk. It's early days yet but I did contemplate this as a choice but as said previously php is mostly for web processing but this is an interesting project - imagine if there were a system that allowed a write one run on any platform with or without a window manager. Anyway many thanks again for your very concise and very helpful answer. David On Sun, 2006-01-08 at 09:38 -0800, Keith J. Farmer wrote: > Your web server is hyper-sensitive -- what you're seeing is evidence that I am using Outlook Web Access. I don't know the details, but historically OWA has always added a small attachment. This is a known oddity. > > The best way to discover what .NET has to offer is to sit down and use it exclusively for a couple months. There's just so much goodness and extensibility baked in that it's taking, literally, years to realize some of the implications. > > Web apps: You haven't used ASP.NET, and you also confuse language with platform. You could do ASP.NET (platform) using PHP (language) to get both the benefits of a language you obviously enjoy with a platform that I, personally, think kicks the snot out of the ASP/JSP/CGI-style web development. Seriously, try it -- it's amazing what you can do when you model a web page as a control tree you can fire events on. > > Regarding GUI under Mono, you must realize that it's no different from GUI in Python, Java, or C++ -- you pick some library (tkinter, wxPython, gtk, etc) and use it. There *happens* to be a canonical namespace reserved in Microsoft's framework (System.Windows) which is in the process of being implemented in Mono. You don't have to use it -- you could just as well use gtk# or the .NET wxWindows binding -- but you'd have to package whatever library you choose and ensure it was installed on the destination machine. > > This is true no matter which path you choose, but once Mono has full parity in the System.Windows namespace, you can assume that library as a pre-installed constant. > > Reverse engineering: every platform has that problem. You do, after all, have to be able to run it. > > ________________________________ > > From: David Irvine on behalf of David Irvine > Sent: Sun 1/8/2006 5:19 AM > To: Keith J. Farmer > Cc: Discussion of IronPython > Subject: Re: {Dangerous Content?} RE: [IronPython] is IP for me > > > Many thanks Keith (and Martin) > > I think it looks like CPython and wxPython for me and that way I can create a cross platform app. I looked at phplanger and its very interesting. > > My own feeling is for web apps PHP cannot be beaten but for traditional apps and socket programming etc. Python is a better solution (I have not looked at ruby though, which I should). > > I am a wee bit lost as to exactly what .net / mono offers programmers. I was under the impression that I could do a gui based app on mono and it would work on .net although I was unsure of the gtk bindings and how they convert to work with windows ? Just lack of research on my behalf. > > I am ideally looking to protect my app in the short term (earn some revenue) and then open source it. This is where python fails a bit as its dead easy to reverse engineer (even just supplying the pyc files alone). I guess I am going to create my app / idea and see what the world thinks and hope nobody steals it too early (if it's any good). > > Many thanks for all your ideas and I will watch IP with great interest. > > David > > PS I left the full mail below - my server is noting some attachment as dangerous - FYI > > > On Sat, 2006-01-07 at 14:17 -0800, Keith J. Farmer wrote: > > Warning: This message has had one or more attachments removed > Warning: (not named). > Warning: Please read the "WEB-DNS-Attachment-Warning.txt" attachment(s) for more information. > > Forgive the scattered comments -- > > IP's speed is going to be influenced by the runtime it is executed under: Microsoft's CLR, Mono, or some other third party runtime. Speed gains can be realized by both the underlying runtime as well as the efficiency of the IL being generated. > > Mono is a suitable runtime for non-Windows systems, and generally supports IP at the Mono release following an IP release (they use IP as part of their test suite). It's still catching up to full parity, but releases more often than either CPython or Microsoft, so there is the potential for swiftly closing any gaps that may exist. Completeness of the BCL may or may not be an issue, depending on your needs. > > That said, have you checked out Phalanger? It's an implementation of PHP for .NET, which may grant you more immediate satisfaction for a commercial project. As I understand, it's also more mature than IP (not being a PHP-head, this is mere conjecture), and still grants access to the BCL. > > GUI: Mono's working on System.Windows parity, as I understand, but has Gtk# available already. I understand there's also a WxWindows port to .NET which may be usable. There's also Cocoa#, but that's going to be Mac-specific. Personally, I'd recommend using System.Windows unless you absolutely could not, just as a point of not having to install yet-another-GUI-library. > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of David Irvine > Sent: Sat 1/7/2006 1:52 PM > To: Discussion of IronPython > Subject: [IronPython] is IP for me > > > Hi > > Python newbee spent many years with php. I am looking to write a cross platform non web based app (windows, *nix and MAC). I am looking for > > 1: Portability > 2: Constant GUI based on platform > 3: All code to be done in Linux > 4: Fast - it has to be fairly quick (python speed) > 5: Commercial to begin with then open source after I have made a wee bit of cash (I am trying a new model out) > > I am wondering if IP is the one or should I use CPython and wxWindows libs etc. > > Hope you can help all comments no matter how crazy appreciated. > --



David Irvine

Mobile 07977 583 031
-------------- next part -------------- An HTML attachment was scrubbed... URL: From david at david-irvine.com Sun Jan 8 19:37:21 2006 From: david at david-irvine.com (David Irvine) Date: Sun, 08 Jan 2006 18:37:21 +0000 Subject: [IronPython] {Dangerous Content?} RE: is IP for me In-Reply-To: References: <1136670732.9877.179.camel@localhost.localdomain> <1136726367.7518.6.camel@localhost.localdomain> Message-ID: <1136745442.7518.16.camel@localhost.localdomain> Ah its the outlook attachment (can't remember the name some servers appear to reject it). Again many thanks for your answer - one last question honest (I find people can explain loads from a few words as opposed to some web docs). When you say """you pick some library (tkinter, wxPython, gtk, etc) and use it. There *happens* to be a canonical namespace reserved in Microsoft's framework (System.Windows) which is in the process of being implemented in Mono. """ Does that mean under a .net platform say mono I could create a gtk app and it would simply work on an MS platform using .net native ? This would be great indeed. FYI I watch a system called ippfp http://ippfp.sourceforge.net/ which interestingly is a php system which allows your code to run in curses (text), pdf ??, xhtml (web) and gtk. It's early days yet but I did contemplate this as a choice but as said previously php is mostly for web processing but this is an interesting project - imagine if there were a system that allowed a write one run on any platform with or without a window manager. Anyway many thanks again for your very concise and very helpful answer. David On Sun, 2006-01-08 at 09:38 -0800, Keith J. Farmer wrote: > Your web server is hyper-sensitive -- what you're seeing is evidence that I am using Outlook Web Access. I don't know the details, but historically OWA has always added a small attachment. This is a known oddity. > > The best way to discover what .NET has to offer is to sit down and use it exclusively for a couple months. There's just so much goodness and extensibility baked in that it's taking, literally, years to realize some of the implications. > > Web apps: You haven't used ASP.NET, and you also confuse language with platform. You could do ASP.NET (platform) using PHP (language) to get both the benefits of a language you obviously enjoy with a platform that I, personally, think kicks the snot out of the ASP/JSP/CGI-style web development. Seriously, try it -- it's amazing what you can do when you model a web page as a control tree you can fire events on. > > Regarding GUI under Mono, you must realize that it's no different from GUI in Python, Java, or C++ -- you pick some library (tkinter, wxPython, gtk, etc) and use it. There *happens* to be a canonical namespace reserved in Microsoft's framework (System.Windows) which is in the process of being implemented in Mono. You don't have to use it -- you could just as well use gtk# or the .NET wxWindows binding -- but you'd have to package whatever library you choose and ensure it was installed on the destination machine. > > This is true no matter which path you choose, but once Mono has full parity in the System.Windows namespace, you can assume that library as a pre-installed constant. > > Reverse engineering: every platform has that problem. You do, after all, have to be able to run it. > > ________________________________ > > From: David Irvine on behalf of David Irvine > Sent: Sun 1/8/2006 5:19 AM > To: Keith J. Farmer > Cc: Discussion of IronPython > Subject: Re: {Dangerous Content?} RE: [IronPython] is IP for me > > > Many thanks Keith (and Martin) > > I think it looks like CPython and wxPython for me and that way I can create a cross platform app. I looked at phplanger and its very interesting. > > My own feeling is for web apps PHP cannot be beaten but for traditional apps and socket programming etc. Python is a better solution (I have not looked at ruby though, which I should). > > I am a wee bit lost as to exactly what .net / mono offers programmers. I was under the impression that I could do a gui based app on mono and it would work on .net although I was unsure of the gtk bindings and how they convert to work with windows ? Just lack of research on my behalf. > > I am ideally looking to protect my app in the short term (earn some revenue) and then open source it. This is where python fails a bit as its dead easy to reverse engineer (even just supplying the pyc files alone). I guess I am going to create my app / idea and see what the world thinks and hope nobody steals it too early (if it's any good). > > Many thanks for all your ideas and I will watch IP with great interest. > > David > > PS I left the full mail below - my server is noting some attachment as dangerous - FYI > > > On Sat, 2006-01-07 at 14:17 -0800, Keith J. Farmer wrote: > > Warning: This message has had one or more attachments removed > Warning: (not named). > Warning: Please read the "WEB-DNS-Attachment-Warning.txt" attachment(s) for more information. > > Forgive the scattered comments -- > > IP's speed is going to be influenced by the runtime it is executed under: Microsoft's CLR, Mono, or some other third party runtime. Speed gains can be realized by both the underlying runtime as well as the efficiency of the IL being generated. > > Mono is a suitable runtime for non-Windows systems, and generally supports IP at the Mono release following an IP release (they use IP as part of their test suite). It's still catching up to full parity, but releases more often than either CPython or Microsoft, so there is the potential for swiftly closing any gaps that may exist. Completeness of the BCL may or may not be an issue, depending on your needs. > > That said, have you checked out Phalanger? It's an implementation of PHP for .NET, which may grant you more immediate satisfaction for a commercial project. As I understand, it's also more mature than IP (not being a PHP-head, this is mere conjecture), and still grants access to the BCL. > > GUI: Mono's working on System.Windows parity, as I understand, but has Gtk# available already. I understand there's also a WxWindows port to .NET which may be usable. There's also Cocoa#, but that's going to be Mac-specific. Personally, I'd recommend using System.Windows unless you absolutely could not, just as a point of not having to install yet-another-GUI-library. > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of David Irvine > Sent: Sat 1/7/2006 1:52 PM > To: Discussion of IronPython > Subject: [IronPython] is IP for me > > > Hi > > Python newbee spent many years with php. I am looking to write a cross platform non web based app (windows, *nix and MAC). I am looking for > > 1: Portability > 2: Constant GUI based on platform > 3: All code to be done in Linux > 4: Fast - it has to be fairly quick (python speed) > 5: Commercial to begin with then open source after I have made a wee bit of cash (I am trying a new model out) > > I am wondering if IP is the one or should I use CPython and wxWindows libs etc. > > Hope you can help all comments no matter how crazy appreciated. > --



David Irvine

Mobile 07977 583 031
-------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Sun Jan 8 20:40:56 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Sun, 8 Jan 2006 11:40:56 -0800 Subject: [IronPython] {Dangerous Content?} RE: is IP for me References: <1136670732.9877.179.camel@localhost.localdomain><1136726367.7518.6.camel@localhost.localdomain> <1136745442.7518.16.camel@localhost.localdomain> Message-ID: re gui: what I meant is that gtk# is a peer to system.windows. they are different libraries for achieving the same end, and so can be expected to have different api, namespace, etc. system.windows is installed with the framework whereas gtk# would be a seperate install. I don't know how mono's implementing system.windows -- either as its own, or as a wrapper around gtk# or whatnot, but the only way you'll have cross-platform gui is to use the same api on both ends. there's no magic that will automatically take system.windows calls and transform them into gtk#, or vice-versa. re ippfp: asp.net is predicated on a couple things: declarative page layout (control tree instead of html/code intermix), and centralized knowledge of client capabilities (giving a control the ability to modify its contribution to the output stream based on the client). ideally, you would be able to take a page that renders in the latest desktop browser, and have it downgrade gracefully to Lynx or WAP. theoretically, you could make a set of controls that could render as pdf forms just as easily as they render as html or structured text, and the web developer wouldn't have to care. also, everything's a control, including the page itself, so you can have different page types -- such as a soap endpoint which can inspect itself for methods which are marked with the [WebMethod] attribute, and thereby generate WSDL or execute the operation, depending on the client and request (browser or soap request). ________________________________ From: users-bounces at lists.ironpython.com on behalf of David Irvine Sent: Sun 1/8/2006 10:37 AM To: Discussion of IronPython Cc: users-ironpython.com at lists.ironpython.com Subject: Re: [IronPython] {Dangerous Content?} RE: is IP for me Ah its the outlook attachment (can't remember the name some servers appear to reject it). Again many thanks for your answer - one last question honest (I find people can explain loads from a few words as opposed to some web docs). When you say """you pick some library (tkinter, wxPython, gtk, etc) and use it. There *happens* to be a canonical namespace reserved in Microsoft's framework (System.Windows) which is in the process of being implemented in Mono. """ Does that mean under a .net platform say mono I could create a gtk app and it would simply work on an MS platform using .net native ? This would be great indeed. FYI I watch a system called ippfp http://ippfp.sourceforge.net/ which interestingly is a php system which allows your code to run in curses (text), pdf ??, xhtml (web) and gtk. It's early days yet but I did contemplate this as a choice but as said previously php is mostly for web processing but this is an interesting project - imagine if there were a system that allowed a write one run on any platform with or without a window manager. Anyway many thanks again for your very concise and very helpful answer. David On Sun, 2006-01-08 at 09:38 -0800, Keith J. Farmer wrote: Your web server is hyper-sensitive -- what you're seeing is evidence that I am using Outlook Web Access. I don't know the details, but historically OWA has always added a small attachment. This is a known oddity. The best way to discover what .NET has to offer is to sit down and use it exclusively for a couple months. There's just so much goodness and extensibility baked in that it's taking, literally, years to realize some of the implications. Web apps: You haven't used ASP.NET, and you also confuse language with platform. You could do ASP.NET (platform) using PHP (language) to get both the benefits of a language you obviously enjoy with a platform that I, personally, think kicks the snot out of the ASP/JSP/CGI-style web development. Seriously, try it -- it's amazing what you can do when you model a web page as a control tree you can fire events on. Regarding GUI under Mono, you must realize that it's no different from GUI in Python, Java, or C++ -- you pick some library (tkinter, wxPython, gtk, etc) and use it. There *happens* to be a canonical namespace reserved in Microsoft's framework (System.Windows) which is in the process of being implemented in Mono. You don't have to use it -- you could just as well use gtk# or the .NET wxWindows binding -- but you'd have to package whatever library you choose and ensure it was installed on the destination machine. This is true no matter which path you choose, but once Mono has full parity in the System.Windows namespace, you can assume that library as a pre-installed constant. Reverse engineering: every platform has that problem. You do, after all, have to be able to run it. ________________________________ From: David Irvine on behalf of David Irvine Sent: Sun 1/8/2006 5:19 AM To: Keith J. Farmer Cc: Discussion of IronPython Subject: Re: {Dangerous Content?} RE: [IronPython] is IP for me Many thanks Keith (and Martin) I think it looks like CPython and wxPython for me and that way I can create a cross platform app. I looked at phplanger and its very interesting. My own feeling is for web apps PHP cannot be beaten but for traditional apps and socket programming etc. Python is a better solution (I have not looked at ruby though, which I should). I am a wee bit lost as to exactly what .net / mono offers programmers. I was under the impression that I could do a gui based app on mono and it would work on .net although I was unsure of the gtk bindings and how they convert to work with windows ? Just lack of research on my behalf. I am ideally looking to protect my app in the short term (earn some revenue) and then open source it. This is where python fails a bit as its dead easy to reverse engineer (even just supplying the pyc files alone). I guess I am going to create my app / idea and see what the world thinks and hope nobody steals it too early (if it's any good). Many thanks for all your ideas and I will watch IP with great interest. David PS I left the full mail below - my server is noting some attachment as dangerous - FYI On Sat, 2006-01-07 at 14:17 -0800, Keith J. Farmer wrote: Warning: This message has had one or more attachments removed Warning: (not named). Warning: Please read the "WEB-DNS-Attachment-Warning.txt" attachment(s) for more information. Forgive the scattered comments -- IP's speed is going to be influenced by the runtime it is executed under: Microsoft's CLR, Mono, or some other third party runtime. Speed gains can be realized by both the underlying runtime as well as the efficiency of the IL being generated. Mono is a suitable runtime for non-Windows systems, and generally supports IP at the Mono release following an IP release (they use IP as part of their test suite). It's still catching up to full parity, but releases more often than either CPython or Microsoft, so there is the potential for swiftly closing any gaps that may exist. Completeness of the BCL may or may not be an issue, depending on your needs. That said, have you checked out Phalanger? It's an implementation of PHP for .NET, which may grant you more immediate satisfaction for a commercial project. As I understand, it's also more mature than IP (not being a PHP-head, this is mere conjecture), and still grants access to the BCL. GUI: Mono's working on System.Windows parity, as I understand, but has Gtk# available already. I understand there's also a WxWindows port to .NET which may be usable. There's also Cocoa#, but that's going to be Mac-specific. Personally, I'd recommend using System.Windows unless you absolutely could not, just as a point of not having to install yet-another-GUI-library. ________________________________ From: users-bounces at lists.ironpython.com on behalf of David Irvine Sent: Sat 1/7/2006 1:52 PM To: Discussion of IronPython Subject: [IronPython] is IP for me Hi Python newbee spent many years with php. I am looking to write a cross platform non web based app (windows, *nix and MAC). I am looking for 1: Portability 2: Constant GUI based on platform 3: All code to be done in Linux 4: Fast - it has to be fairly quick (python speed) 5: Commercial to begin with then open source after I have made a wee bit of cash (I am trying a new model out) I am wondering if IP is the one or should I use CPython and wxWindows libs etc. Hope you can help all comments no matter how crazy appreciated. --



David Irvine

Mobile 07977 583 031
From mbeckius at gmail.com Mon Jan 9 17:03:34 2006 From: mbeckius at gmail.com (Matt Beckius) Date: Mon, 9 Jan 2006 11:03:34 -0500 Subject: [IronPython] list of lambdas only evaluates first expression Message-ID: >>> l = [lambda x : x**2, lambda y : y**3, lambda z : z**4] >>> for x in l : print x(2) 4 4 4 Matt B. -- Matt Beckius 610.308.8827 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Mon Jan 9 18:31:57 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Mon, 09 Jan 2006 12:31:57 -0500 Subject: [IronPython] Method overload In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F5D9FF5C@df-foxhound-msg.exc hange.corp.microsoft.com> References: <192d28970601071641y3cb78f1eg@mail.gmail.com> Message-ID: <4.3.2.7.2.20060109123000.04298c80@mail.comcast.net> Isn't there a syntax (using []) by which you can tell IP explicitly which one it should use? I was expecting you to say what you did, but to add info about that as well. At 12:48 AM 1/8/2006, Martin Maly wrote >Yes, it will work on .NET. IronPython will try to find the best fit among the overloads based on types of arguments that you pass to the method call. There may be cases when IronPython may not choose the right method & and we want to hear about those cases so we can fix them. > >Martin > >---------- >From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fabio >Sent: Saturday, January 07, 2006 4:42 PM >To: IronPython >Subject: [IronPython] Method overload > >I'm studing IronPython and I liked very much! >But I have one question. > >In .Net Framework, several classes has method overload. In my study, Python does not support method overload, and when we define methods with the same name, they are redefined then only the last is used. > >How IronPython handle this? By example, the method "System.Console.Write()" has 18 overloads! This will work in .Net? > >Regards >Fabio J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Mon Jan 9 19:05:17 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 9 Jan 2006 10:05:17 -0800 Subject: [IronPython] Method overload In-Reply-To: <4.3.2.7.2.20060109123000.04298c80@mail.comcast.net> Message-ID: <4039D552ADAB094BB1EA670F3E96214EEECDFB@df-foxhound-msg.exchange.corp.microsoft.com> The [] syntax is for generic types - not for method overloads. Just for more info on method overloads in general - for those that have multiple method bindings we'll hit our ReflectedMethodBase.TryCall implementation. That will evaluate the conversions for each argument and methods and will ultimately dispatch to the method that has better conversions. If two methods have "mixed" conversions [(one "good", one "bad") / (one "bad", one "good") ] then we'll just end up picking the first method. We also take into account various other factors such as if we're turning the first argument into a this pointer and we'll have non-params arguments over params arguments. It's also worth pointing out this whole process is slow.... For optimized calls (currently just core built-in CLR types and types the IronPython runtime exposes) we'll generate fast-paths for methods that don't have multiple bindings. Our definition of multiple bindings is methods that have 1 overload for each number of parameters (eg 1 overload that takes 1 parameter, 1 overload that takes 2 parameters, etc...) and methods that only have 1 params method. If the method falls outside of this it's not optimized. That's an implementation detail that probably no one needs to know, but I'm just throwing it out there for completeness. We're also looking at improving our optimizer so it can optimize more methods this way (and there probably deserves some thought about how we can allow user-methods to be optimized when hosting IronPython as well). ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Monday, January 09, 2006 9:32 AM To: Discussion of IronPython Subject: Re: [IronPython] Method overload Isn't there a syntax (using []) by which you can tell IP explicitly which one it should use? I was expecting you to say what you did, but to add info about that as well. At 12:48 AM 1/8/2006, Martin Maly wrote Yes, it will work on .NET. IronPython will try to find the best fit among the overloads based on types of arguments that you pass to the method call. There may be cases when IronPython may not choose the right method & and we want to hear about those cases so we can fix them. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fabio Sent: Saturday, January 07, 2006 4:42 PM To: IronPython Subject: [IronPython] Method overload I'm studing IronPython and I liked very much! But I have one question. In .Net Framework, several classes has method overload. In my study, Python does not support method overload, and when we define methods with the same name, they are redefined then only the last is used. How IronPython handle this? By example, the method "System.Console.Write()" has 18 overloads! This will work in .Net? Regards Fabio J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From APliszka at AlienForceIT.Com Mon Jan 9 19:17:43 2006 From: APliszka at AlienForceIT.Com (Andrew Pliszka) Date: Mon, 9 Jan 2006 13:17:43 -0500 Subject: [IronPython] Python Memory Usage In-Reply-To: Message-ID: Hi, I had similar problems. I think major problem that I see with your code is that you create a new PythonEngine object every time you execute new script. I suggest caching the PythonEngine object or using object pooling. I also think the setVariable might be not releasing the object. I also suggest you download .Net profiler and run your code under that profiler. Then you should be able to pinpoint what objects are consuming the memory. Knowing what objects are causing the leaks, try to find different way to implement them and test again. Also take a look at last two months of the mailing list and you should find some answers on how to run scripts without leaking memory. There are some problems with memory usage by IronPython, but developers are doing a very good job to fix those problems. I think we also need a architectural blueprint of a stable, reliable IronPython scripting host, that people could use as a guideline. I see that more and more people would like to use IronPython as a server scripting host. Thanks Andrew -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com]On Behalf Of Bernard Graham Sent: Saturday, January 07, 2006 10:52 AM To: users at lists.ironpython.com Subject: [IronPython] Python Memory Usage Hi there. I am (like many) quite new to IronPython (and Python in general), but I am trying to use it as a scripting language for a MUD system I am creating (like the old text-based games, only multiplayer). Now the scripts are executed and run very frequently (like when timers are executed, or when players type commands, etc). The problem I have is that after about an hour of serving, my windows system goes out of virtual memory. When I remove the references to IronPython and don't execute any scripts, the memory stays stable. I am sure I am using the IronPython engine incorrectly, so I thought that maybe someone would be able to shed some light on this for me. Here is the code I use to run a script (passed as a string to the c# method): pythonEngine = new PythonEngine (); if (parameters != null) { //Pass "parameters" to the script that will be executed foreach (PythonParameter pp in parameters) { pythonEngine.SetVariable(pp.Name, pp.Value); //Variable name/variable value } } pythonEngine.Execute(pythonScript); This is executed everytime any script must be executed. Please let me know if you can spot anything wrong with this... Regards, Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Mon Jan 9 19:41:58 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 9 Jan 2006 10:41:58 -0800 Subject: [IronPython] Python Memory Usage In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214EEECE95@df-foxhound-msg.exchange.corp.microsoft.com> There's also the possibility of using the new Compile & Execute APIs to pre-compile the script once and then execute it over and over again. Those were added in beta 1 to help improve this (I'm not sure if this will work in this specific scenario, but it's a thought). The canonical host sample sounds like a good idea - I've gone ahead and logged a bug in our database but right now that will have to remain as a slightly lower priority. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Andrew Pliszka Sent: Monday, January 09, 2006 10:18 AM To: Discussion of IronPython Subject: Re: [IronPython] Python Memory Usage Hi, I had similar problems. I think major problem that I see with your code is that you create a new PythonEngine object every time you execute new script. I suggest caching the PythonEngine object or using object pooling. I also think the setVariable might be not releasing the object. I also suggest you download .Net profiler and run your code under that profiler. Then you should be able to pinpoint what objects are consuming the memory. Knowing what objects are causing the leaks, try to find different way to implement them and test again. Also take a look at last two months of the mailing list and you should find some answers on how to run scripts without leaking memory. There are some problems with memory usage by IronPython, but developers are doing a very good job to fix those problems. I think we also need a architectural blueprint of a stable, reliable IronPython scripting host, that people could use as a guideline. I see that more and more people would like to use IronPython as a server scripting host. Thanks Andrew -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com]On Behalf Of Bernard Graham Sent: Saturday, January 07, 2006 10:52 AM To: users at lists.ironpython.com Subject: [IronPython] Python Memory Usage Hi there. I am (like many) quite new to IronPython (and Python in general), but I am trying to use it as a scripting language for a MUD system I am creating (like the old text-based games, only multiplayer). Now the scripts are executed and run very frequently (like when timers are executed, or when players type commands, etc). The problem I have is that after about an hour of serving, my windows system goes out of virtual memory. When I remove the references to IronPython and don't execute any scripts, the memory stays stable. I am sure I am using the IronPython engine incorrectly, so I thought that maybe someone would be able to shed some light on this for me. Here is the code I use to run a script (passed as a string to the c# method): pythonEngine = new PythonEngine (); if (parameters != null) { //Pass "parameters" to the script that will be executed foreach (PythonParameter pp in parameters) { pythonEngine.SetVariable(pp.Name, pp.Value); //Variable name/variable value } } pythonEngine.Execute(pythonScript); This is executed everytime any script must be executed. Please let me know if you can spot anything wrong with this... Regards, Bernard -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Mon Jan 9 20:18:30 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 9 Jan 2006 11:18:30 -0800 Subject: [IronPython] Method overload In-Reply-To: <4.3.2.7.2.20060109123000.04298c80@mail.comcast.net> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5DA0255@df-foxhound-msg.exchange.corp.microsoft.com> There is a syntax for selecting the overload. However, I didn't mention it because we want to achieve state where the automatic binding we have satisfies most uses. More importantly, the selection mechanism may change in the near future. Having said that, yes, it is possible to select the very overload by using the square bracket syntax. However, this may change during our beta cycles so try to not depend on it too much. Martin >>> from System import Console >>> Console.Write(3) 3>>> Console.Write[str](3) Traceback (most recent call last): File , line 0, in input##2 TypeError: bad args to this method >>> ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Monday, January 09, 2006 9:32 AM To: Discussion of IronPython Subject: Re: [IronPython] Method overload Isn't there a syntax (using []) by which you can tell IP explicitly which one it should use? I was expecting you to say what you did, but to add info about that as well. At 12:48 AM 1/8/2006, Martin Maly wrote Yes, it will work on .NET. IronPython will try to find the best fit among the overloads based on types of arguments that you pass to the method call. There may be cases when IronPython may not choose the right method & and we want to hear about those cases so we can fix them. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fabio Sent: Saturday, January 07, 2006 4:42 PM To: IronPython Subject: [IronPython] Method overload I'm studing IronPython and I liked very much! But I have one question. In .Net Framework, several classes has method overload. In my study, Python does not support method overload, and when we define methods with the same name, they are redefined then only the last is used. How IronPython handle this? By example, the method "System.Console.Write()" has 18 overloads! This will work in .Net? Regards Fabio J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From furtwan1 at msu.edu Mon Jan 9 20:59:24 2006 From: furtwan1 at msu.edu (Brandon Furtwangler) Date: Mon, 9 Jan 2006 14:59:24 -0500 Subject: [IronPython] list of lambdas only evaluates first expression In-Reply-To: Message-ID: <007801c61557$307cc860$91765920$@edu> I wonder if this is the same problem I had a couple days ago (a bug with calling multiple python methods). Turning GenerateDynamicMethods to false in Options.cs and recompiling IronPython fixed my problem. _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Matt Beckius Sent: Monday, January 09, 2006 11:04 AM To: users at lists.ironpython.com Subject: [IronPython] list of lambdas only evaluates first expression >>> l = [lambda x : x**2, lambda y : y**3, lambda z : z**4] >>> for x in l : print x(2) 4 4 4 Matt B. -- Matt Beckius 610.308.8827 -------------- next part -------------- An HTML attachment was scrubbed... URL: From bernardgraham at gmail.com Mon Jan 9 21:01:14 2006 From: bernardgraham at gmail.com (Bernard Graham) Date: Mon, 9 Jan 2006 22:01:14 +0200 Subject: [IronPython] Python Memory Usage In-Reply-To: References: Message-ID: Hi Thanks for the reply! I will look into the things you proposed, but just to let you all know - my project was referencing an older build IP and not the latest beta release. As soon as I realized that and changed it, the memory usage completely dropped down, event with creating a new instance of the PythonEngine. Just for interest's sake: the reason I create a new engine is that in my application it is possible for one script to make a call back to my c# host application which might again invoke another python script. If I cache the PythonEngine, the two running scripts overrides each other's variables (since they are all in the same scope). I will probably have to look into object pooling, as you suggested. Thanks again! Bernard On 1/9/06, Andrew Pliszka wrote: > > Hi, > > I had similar problems. I think major problem that I see with your code is > that you create a new PythonEngine object every time you execute new script. > I suggest caching the PythonEngine object or using object pooling. I also > think the setVariable might be not releasing the object. > > I also suggest you download .Net profiler and run your code under that > profiler. Then you should be able to pinpoint what objects are consuming the > memory. Knowing what objects are causing the leaks, try to find different > way to implement them and test again. > > Also take a look at last two months of the mailing list and you should > find some answers on how to run scripts without leaking memory. > > There are some problems with memory usage by IronPython, but developers > are doing a very good job to fix those problems. > > I think we also need a architectural blueprint of a stable, reliable > IronPython scripting host, that people could use as a guideline. I see that > more and more people would like to use IronPython as a server scripting > host. > > Thanks > Andrew > > > -----Original Message----- > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com]*On Behalf Of *Bernard Graham > *Sent:* Saturday, January 07, 2006 10:52 AM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] Python Memory Usage > > Hi there. > > I am (like many) quite new to IronPython (and Python in general), but I am > trying to use it as a scripting language for a MUD system I am creating > (like the old text-based games, only multiplayer). > > Now the scripts are executed and run very frequently (like when timers are > executed, or when players type commands, etc). > > The problem I have is that after about an hour of serving, my windows > system goes out of virtual memory. When I remove the references to > IronPython and don't execute any scripts, the memory stays stable. > > I am sure I am using the IronPython engine incorrectly, so I thought that > maybe someone would be able to shed some light on this for me. > > Here is the code I use to run a script (passed as a string to the c# > method): > > > pythonEngine = > new PythonEngine (); > if (parameters != null) > { > //Pass "parameters" to the script that will be executed > foreach (PythonParameter pp in parameters) > { > pythonEngine.SetVariable(pp.Name, pp.Value); //Variable name/variable > value > } > } > pythonEngine.Execute(pythonScript); > > This is executed everytime any script must be executed. > > Please let me know if you can spot anything wrong with this... > > Regards, > > Bernard > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hostetlerm at gmail.com Mon Jan 9 21:26:35 2006 From: hostetlerm at gmail.com (Mike Hostetler) Date: Mon, 9 Jan 2006 14:26:35 -0600 Subject: [IronPython] When to load clr module? Message-ID: I have a unique module that I wrote that can either get to a Java API (via Jython) or COM API (via Python +Win32). The scripts that access this module generally don't know or care if they are running Java or COM. Now, with IP 1.0 beta, I'm trying to make add a .Net API to the module and am running into an issue with the clr module. If I do an "import clr" and "clr.AddReference('/Path/To/Assembly')" inside the module, the module can't find the object in the assembly. If I put both lines in the top level of the script, it works fine. Is this expected behavior? Is there a current way around this? -- Mike Hostetler http://mike.hostetlerhome.com/ From redmoon17 at gmail.com Tue Jan 10 03:56:48 2006 From: redmoon17 at gmail.com (Chu Kevin) Date: Tue, 10 Jan 2006 10:56:48 +0800 Subject: [IronPython] IronPython related jobs and internships at Microsoft In-Reply-To: <014a01c6126f$e0b3afe0$6400a8c0@darkhorse> References: <014a01c6126f$e0b3afe0$6400a8c0@darkhorse> Message-ID: <41d7f4a90601091856p505821b9p@mail.gmail.com> I very interest in developing some built-in module ,ex: _socket because of a exception,when I import a socket module (Standard Library of CPython) 2006/1/6, dnguyen16 : > > Jim, > > Can I reply (with the resume) to this email thread or do you have a > different email that I can send it to? > > Thanks, > Daniel > > > ----- Original Message ----- > From: "Jim Hugunin" > To: "Discussion of IronPython" > Sent: Thursday, January 05, 2006 3:26 PM > Subject: [IronPython] IronPython related jobs and internships at Microsoft > > > > If you'd like to work with us on IronPython and the underlying runtime > > support for dynamic languages that makes it possible, we have a few > > positions available. We're looking for one developer, one program > > manager, one tester and at least one summer intern. See my blog for > links > > to a little more information. > > http://blogs.msdn.com/hugunin/archive/2006/01/05/509812.aspx > > > > If you're interested, please send me (not the list!) email that clearly > > explains why you'd be the best choice for one of these jobs and attach a > > current resume. > > > > Thanks - Jim > > _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Tue Jan 10 04:41:01 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Mon, 09 Jan 2006 22:41:01 -0500 Subject: [IronPython] Method overload In-Reply-To: <4039D552ADAB094BB1EA670F3E96214EEECDFB@df-foxhound-msg.exc hange.corp.microsoft.com> References: <4.3.2.7.2.20060109123000.04298c80@mail.comcast.net> Message-ID: <4.3.2.7.2.20060109223950.04ed2d18@mail.comcast.net> Couldn't I use the [] syntax to tell IP what .Net type to use for each parameter? (Where is there a good description of the [] syntax?) At 01:05 PM 1/9/2006, Dino Viehland wrote >The [] syntax is for generic types - not for method overloads. > > > >Just for more info on method overloads in general for those that have multiple method bindings we ll hit our ReflectedMethodBase.TryCall implementation. That will evaluate the conversions for each argument and methods and will ultimately dispatch to the method that has better conversions. If two methods have mixed conversions [(one good , one bad ) / (one bad , one good ) ] then we ll just end up picking the first method. We also take into account various other factors such as if we re turning the first argument into a this pointer and we ll have non-params arguments over params arguments. It s also worth pointing out this whole process is slow&. > > > >For optimized calls (currently just core built-in CLR types and types the IronPython runtime exposes) we ll generate fast-paths for methods that don t have multiple bindings. Our definition of multiple bindings is methods that have 1 overload for each number of parameters (eg 1 overload that takes 1 parameter, 1 overload that takes 2 parameters, etc&) and methods that only have 1 params method. If the method falls outside of this it s not optimized. That s an implementation detail that probably no one needs to know, but I m just throwing it out there for completeness. We re also looking at improving our optimizer so it can optimize more methods this way (and there probably deserves some thought about how we can allow user-methods to be optimized when hosting IronPython as well). > > > >---------- >From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill >Sent: Monday, January 09, 2006 9:32 AM >To: Discussion of IronPython >Subject: Re: [IronPython] Method overload > > > >Isn't there a syntax (using []) by which you can tell IP explicitly which one it should use? I was expecting you to say what you did, but to add info about that as well. > >At 12:48 AM 1/8/2006, Martin Maly wrote > >Yes, it will work on .NET. IronPython will try to find the best fit among the overloads based on types of arguments that you pass to the method call. There may be cases when IronPython may not choose the right method & and we want to hear about those cases so we can fix them. > >Martin > >---------- >From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fabio >Sent: Saturday, January 07, 2006 4:42 PM >To: IronPython >Subject: [IronPython] Method overload > >I'm studing IronPython and I liked very much! >But I have one question. > >In .Net Framework, several classes has method overload. In my study, Python does not support method overload, and when we define methods with the same name, they are redefined then only the last is used. > >How IronPython handle this? By example, the method "System.Console.Write()" has 18 overloads! This will work in .Net? > >Regards >Fabio J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Jan 10 17:36:40 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 10 Jan 2006 08:36:40 -0800 Subject: [IronPython] Method overload In-Reply-To: <4.3.2.7.2.20060109223950.04ed2d18@mail.comcast.net> References: <4.3.2.7.2.20060109123000.04298c80@mail.comcast.net>, <4.3.2.7.2.20060109223950.04ed2d18@mail.comcast.net> Message-ID: <4039D552ADAB094BB1EA670F3E96214E235C23@df-foxhound-msg.exchange.corp.microsoft.com> Yes, I actually didn't realize that this worked w/ non generic parameters - but it does. I'm not sure if we have a good description of his but I'll look around and/or see if we can get something on the Wiki. ________________________________ From: users-bounces at lists.ironpython.com On Behalf Of J. Merrill Sent: Monday, January 09, 2006 7:41 PM To: Discussion of IronPython Subject: Re: [IronPython] Method overload Couldn't I use the [] syntax to tell IP what .Net type to use for eachparameter? (Where is there a good description of the [] syntax?) At 01:05 PM 1/9/2006, Dino Viehland wrote The [] syntax is for generic types - not for method overloads. Just for more info on method overloads in general for those that have multiple method bindings we ll hit our ReflectedMethodBase.TryCall implementation. That will evaluate the conversions for each argument and methods and will ultimately dispatch to the method that has better conversions. If two methods have mixed conversions [(one good , one bad ) / (one bad , one good ) ] then we ll just end up picking the first method. We also take into account various other factors such as if we re turning the first argument into a this pointer and we ll have non-params arguments over params arguments. It s also worth pointing out this whole process is slow&. For optimized calls (currently just core built-in CLR types and types the IronPython runtime exposes) we ll generate fast-paths for methods that don t have multiple bindings. Our definition of multiple bindings is methods that have 1 overload for each number of parameters (eg 1 overload that takes 1 parameter, 1 overload that takes 2 parameters, etc&) and methods that only have 1 params method. If the method falls outside of this it s not optimized. That s an implementation detail that probably no one needs to know, but I m just throwing it out there for completeness. We re also looking at improving our optimizer so it can optimize more methods this way (and there probably deserves some thought about how we can allow user-methods to be optimized when hosting IronPython as well). ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Monday, January 09, 2006 9:32 AM To: Discussion of IronPython Subject: Re: [IronPython] Method overload Isn't there a syntax (using []) by which you can tell IP explicitly which one it should use? I was expecting you to say what you did, but to add info about that as well. At 12:48 AM 1/8/2006, Martin Maly wrote Yes, it will work on .NET. IronPython will try to find the best fit among the overloads based on types of arguments that you pass to the method call. There may be cases when IronPython may not choose the right method & and we want to hear about those cases so we can fix them. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fabio Sent: Saturday, January 07, 2006 4:42 PM To: IronPython Subject: [IronPython] Method overload I'm studing IronPython and I liked very much! But I have one question. In .Net Framework, several classes has method overload. In my study, Python does not support method overload, and when we define methods with the same name, they are redefined then only the last is used. How IronPython handle this? By example, the method "System.Console.Write()" has 18 overloads! This will work in .Net? Regards Fabio J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon at titanic.co.uk Tue Jan 10 17:52:02 2006 From: simon at titanic.co.uk (Simon Faulkner) Date: Tue, 10 Jan 2006 16:52:02 +0000 Subject: [IronPython] Missing bin? Message-ID: <43C3E632.2070608@titanic.co.uk> Just downloaded beta 1.0 BETA 1 The read me says "After unpacking the distribution of IronPyhon, you can complete the installation by adding the included 'bin' directory to your PATH. To test your installation, you should launch the interactive interpreter as shown below:" But when you unzip there is no 'bin' directory? or am I being dopey? TIA Sim From jvm_cop at spamcop.net Tue Jan 10 18:07:05 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Tue, 10 Jan 2006 12:07:05 -0500 Subject: [IronPython] Method overload In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F5DA0255@df-foxhound-msg.exc hange.corp.microsoft.com> References: <4.3.2.7.2.20060109123000.04298c80@mail.comcast.net> Message-ID: <4.3.2.7.2.20060110112440.05e02188@mail.comcast.net> Clearly, having IP make the right which-overload decision a very high percentage of the time is desirable, but it's not a "portability of my Python code" issue if I need to do something special to invoke the desired overload. But it is _critical_ that we be able to determine, in IP alone (without VS debugger), which overload was actually selected. One solution would be to provide a way to iterate (in Python) through the (presumed by me to exist, without looking at the code) internal structure that describes the cached mapping of whatever-is-that-is-stored to .Net MethodInfo objects. Providing access to that structure as a Python dictionary (perhaps __overloads__ within Python function/method objects?) could permit user code to add and/or change entries and thus control things when that is needed. It would also let us write tests that exercise the IP code that makes the decisions and be certain that the results are as desired -- without having to write .Net methods that have particular parameter patterns and that somehow inform us about what the choice was. [Thinking out loud] Hmm, a Python program that took a .Net assembly/class spec, reflected through its callable methods, and produced a c# source file that defined IPOverloadTest_classname_methodname methods with the same signatures as all the methods with multiple overloads, where the implementation somehow records that it's been called, would not be that hard to write. So perhaps the "so we can write tests of the overload resolution mechanism" use for what I described above would not be necessary. (Has anyone there written this? Should one of us?) Good luck trying to figure out the best way to do this!! At 02:18 PM 1/9/2006, Martin Maly wrote >There is a syntax for selecting the overload. However, I didn t mention it because we want to achieve state where the automatic binding we have satisfies most uses. More importantly, the selection mechanism may change in the near future. > > > >Having said that, yes, it is possible to select the very overload by using the square bracket syntax. However, this may change during our beta cycles so try to not depend on it too much. > > > >Martin > > > >>>> from System import Console > >>>> Console.Write(3) > >3>>> Console.Write[str](3) > >Traceback (most recent call last): > > File , line 0, in input##2 > >TypeError: bad args to this method > >>>> > > > >---------- >From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill >Sent: Monday, January 09, 2006 9:32 AM >To: Discussion of IronPython >Subject: Re: [IronPython] Method overload > > > >Isn't there a syntax (using []) by which you can tell IP explicitly which one it should use? I was expecting you to say what you did, but to add info about that as well. > >At 12:48 AM 1/8/2006, Martin Maly wrote > >Yes, it will work on .NET. IronPython will try to find the best fit among the overloads based on types of arguments that you pass to the method call. There may be cases when IronPython may not choose the right method & and we want to hear about those cases so we can fix them. > >Martin > >---------- >From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fabio >Sent: Saturday, January 07, 2006 4:42 PM >To: IronPython >Subject: [IronPython] Method overload > >I'm studing IronPython and I liked very much! >But I have one question. > >In .Net Framework, several classes has method overload. In my study, Python does not support method overload, and when we define methods with the same name, they are redefined then only the last is used. > >How IronPython handle this? By example, the method "System.Console.Write()" has 18 overloads! This will work in .Net? > >Regards >Fabio J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Tue Jan 10 18:05:25 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 10 Jan 2006 09:05:25 -0800 Subject: [IronPython] Missing bin? In-Reply-To: <43C3E632.2070608@titanic.co.uk> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5DA08B2@df-foxhound-msg.exchange.corp.microsoft.com> The bin directory is, indeed, gone. We re-structured the zip file (the former bin directory contents are now directly in the main installation directory), but - apparently - forgot to update few references here and there. Thanks for pointing this out. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Simon Faulkner Sent: Tuesday, January 10, 2006 8:52 AM To: users at lists.ironpython.com Subject: [IronPython] Missing bin? Just downloaded beta 1.0 BETA 1 The read me says "After unpacking the distribution of IronPyhon, you can complete the installation by adding the included 'bin' directory to your PATH. To test your installation, you should launch the interactive interpreter as shown below:" But when you unzip there is no 'bin' directory? or am I being dopey? TIA Sim _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From s.kobalczyk at softwaremind.pl Tue Jan 10 21:36:39 2006 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Tue, 10 Jan 2006 21:36:39 +0100 Subject: [IronPython] IronPython kills CLR Message-ID: <43C41AD7.0@softwaremind.pl> I finally found why my NUnit suite doesnt work anymore. It occurs that its caused by following test case: string script = @" class Rectangle1(object): def __init__(self, width, height): self.width = width self.height = height def getArea(self): return self.width * self.height area = property(getArea, None, None, None) r = Rectangle1(10, 100) print r.area"; PythonEngine engine = new PythonEngine(); object code = engine.Compile(script); engine.Execute(code); Executing this in NUnit just kills the process with no error. When I execute it with debugger I get following exception: > IronPython.dll!IronPython.Runtime.Frame.TryGetLocal(string name = "property", out object ret = null) Line 65 + 0x12 bytes C# IronPython.dll!IronPython.Runtime.Frame.GetGlobal(string name = "property") Line 90 + 0xe bytes C# snippets.dll!moduleHolder_0.Rectangle1$maker0() + 0x158 bytes snippets.dll!moduleHolder_0.input() + 0xb6 bytes IronPython.dll!IronPython.Runtime.FrameCode.Run(IronPython.Runtime.Frame frame = {IronPython.Runtime.Frame}) Line 165 + 0xd bytes C# ... FatalExecutionEngineError was detected Message: The runtime has encountered a fatal error. The address of the error was at 0x79e7bd7e, on thread 0xc04. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack. If I execute the same script using IronPythonConsole it works fine. Please confirm if this issue would occur only when we use python properties (hopefully we don't have any yet in production code) or there are other cases to avoid. Szymon Kobalczyk. From stax0711-dev at yahoo.de Sun Jan 8 21:52:57 2006 From: stax0711-dev at yahoo.de (stax0711-dev at yahoo.de) Date: Sun, 08 Jan 2006 21:52:57 +0100 Subject: [IronPython] Run a script without a console to pop up? Message-ID: <43C17BA9.6050300@yahoo.de> Hi, I'm not much the console type of guy, I try to learn and try to like the console, I even played with monad and watched videos about it but most of the time it seems I do good without a console. Is there a way to run a script without a console to pop up? My other problem is there is a huge startup overhead, if I run a script like the one below it takes 2-3 seconds, it's the same slowness as monad startup, I really wish it would be < 1 second. My last question is what things can be expected regarding code completion for scripting? import sys sys.LoadAssemblyByName("System.Windows.Forms") from System.Windows.Forms import * MessageBox.Show("") thanks stax ___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de From furtwan1 at msu.edu Thu Jan 12 02:21:32 2006 From: furtwan1 at msu.edu (Brandon Furtwangler) Date: Wed, 11 Jan 2006 20:21:32 -0500 Subject: [IronPython] Multiple engines keep barfing In-Reply-To: <43C17BA9.6050300@yahoo.de> Message-ID: <001301c61716$85c70590$915510b0$@edu> I'm making a simple AI game and I can load a ship up that runs a python script to control its behavior. My python script uses the random python library (ripped from CPython) and works fine if I have one ship, but if I try to create another I get an exception saying that 'None is not enumerable'. It's in os.py on the line that says "if 'posix' in _names:". (and _names = sys.builtin_module_names) I don't see why it should act any different with the second engine because they are both going through the exact same code path: pe.AddToPath(System.Windows.Forms.Application.StartupPath + @"\Lib"); pe.LoadAssembly(System.Reflection.Assembly.GetAssembly(typeof(Ship))); pe.SetVariable("ship", this); pe.ExecuteFile(aiscript); <-- {"None is not enumerable"} from os.py The script: from IPExample import Action import random def GetAction(): p = random.uniform(0.0,1.0) d = 0.0 for i in range(0,6): d += actionProps[i] if p <= d: return allActions[i] return allActions[6] allActions = [Action.RotateClockwise, Action.RotateCounterClockwise, Action.RotateGunClockwise, Action.RotateGunCounterClockwise, Action.Fire, Action.MoveForward, Action.ActivateShield] actionProps = [0.1,0.1,0.05,0.05,0.2,0.4,0.1] Any ideas on what I'm doing wrong? Have others run into this? Known bug? Obviously sys.builtin_module_names is 'None' for some reason only on the second engine...but why? -Brandon From Jim.Hugunin at microsoft.com Thu Jan 12 02:35:16 2006 From: Jim.Hugunin at microsoft.com (Jim Hugunin) Date: Wed, 11 Jan 2006 17:35:16 -0800 Subject: [IronPython] Run a script without a console to pop up? In-Reply-To: <43C17BA9.6050300@yahoo.de> Message-ID: The current beta 1 release of IronPython always pops up a console. One of our pre-1.0 workitems is to add a way to launch IronPython applications without popping up a console, but we don't have that yet. The idea is that anyone who's willing to work with a 1st beta should be willing to deal with a console popping up - but we'll fix this pretty soon. I agree that the start-up time is annoying. We have some optimization work left to do here. If you run a static compiler on your Python code you can bring the start-up time from about 2 seconds to well under 1 second for simple programs today. Unfortunately, right now the only ways to use it are via the alpha preview VSIP integration or by writing your own front-end that uses IronPython.Hosting.PythonCompiler directly (see example at end of this message) Code completion today only works from the interactive console. Tab will do an excellent job in that environment of providing you with options. Doing code completion for a dynamic language in a static IDE is challenging and we're unsure what our timeframe is for support there. Thanks - Jim FYI - Here's the simple program I used to compile a test hello world program to confirm that this does offer a major reduction in start-up time. Feel free to experiment with this for yourself. import sys sys.LoadAssemblyByName('IronPython') from IronPython.Hosting import PythonCompiler from System.Collections.Generic import * sources = List[str]() sources.Add('hello.py') ipc = PythonCompiler(sources, 'hello.exe') ipc.MainFile = 'hello.py' ipc.Compile() -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of stax0711-dev at yahoo.de Sent: Sunday, January 08, 2006 12:53 PM To: users at lists.ironpython.com Subject: [IronPython] Run a script without a console to pop up? Hi, I'm not much the console type of guy, I try to learn and try to like the console, I even played with monad and watched videos about it but most of the time it seems I do good without a console. Is there a way to run a script without a console to pop up? My other problem is there is a huge startup overhead, if I run a script like the one below it takes 2-3 seconds, it's the same slowness as monad startup, I really wish it would be < 1 second. My last question is what things can be expected regarding code completion for scripting? import sys sys.LoadAssemblyByName("System.Windows.Forms") from System.Windows.Forms import * MessageBox.Show("") thanks stax From kfarmer at thuban.org Thu Jan 12 03:54:56 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Wed, 11 Jan 2006 18:54:56 -0800 Subject: [IronPython] Run a script without a console to pop up? References: Message-ID: Hey Jim -- You have an idea about what the startup time is from the CLR itself starting up and loading System.*? ________________________________ From: users-bounces at lists.ironpython.com on behalf of Jim Hugunin Sent: Wed 1/11/2006 5:35 PM I agree that the start-up time is annoying. We have some optimization work left to do here. If you run a static compiler on your Python code you can bring the start-up time from about 2 seconds to well under 1 second for simple programs today. Unfortunately, right now the only ways to use it are via the alpha preview VSIP integration or by writing your own front-end that uses IronPython.Hosting.PythonCompiler directly (see example at end of this message) -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3871 bytes Desc: not available URL: From Detlef.Stute at al-lighting.com Thu Jan 12 16:49:43 2006 From: Detlef.Stute at al-lighting.com (Stute, Detlef ALRT/EEG4) Date: Thu, 12 Jan 2006 16:49:43 +0100 Subject: [IronPython] Run a script without a console to pop up? Message-ID: Hi stax, I integrated IronPython in my C# application. There the user may select a python file and start the script. The program will transfer the script lines like a console line by line to the python engine and the output is redirected to a list box ( the list box is a control interface). I do this in this way to get access to the current line number and I may pause or cancel the script at each line. When the program is up ( which will take your 3 seconds) and the user use the start button, the script starts immediately. Mit freundlichen Gr??en/ kind regards/ Cordiali Saluti SEATEC GmbH Detlef Stute www.seatec-gmbh.com From Detlef.Stute at al-lighting.com Thu Jan 12 16:55:50 2006 From: Detlef.Stute at al-lighting.com (Stute, Detlef ALRT/EEG4) Date: Thu, 12 Jan 2006 16:55:50 +0100 Subject: [IronPython] Answers not added to the thread Message-ID: Hi all, A short non IronPython question. What must be the subject line of an answer to be integrated into the message thread? My answers to any questions are not added to the thread, the occur as a new independent message. Mit freundlichen Gr??en/ kind regards/ Cordiali Saluti SEATEC GmbH Detlef Stute www.seatec-gmbh.com From waylan at gmail.com Thu Jan 12 18:02:57 2006 From: waylan at gmail.com (Waylan Limberg) Date: Thu, 12 Jan 2006 12:02:57 -0500 Subject: [IronPython] Answers not added to the thread In-Reply-To: References: Message-ID: The reply subject to this message should be: Re: [IronPython] Answers not added to the thread but not [IronPython] Re: Answers not added to the thread In other words, the "Re:" can only be added to the very begining of the subject including the [list label] added by the list system. As an alternative, you could just never include "Re:" in your subject. Then the subject would always be the same - and that should work as well. On 1/12/06, Stute, Detlef ALRT/EEG4 wrote: > Hi all, > A short non IronPython question. > What must be the subject line of an answer to be integrated into the message thread? > My answers to any questions are not added to the thread, the occur as a new independent message. > > Mit freundlichen Gr??en/ kind regards/ Cordiali Saluti > SEATEC GmbH > Detlef Stute > www.seatec-gmbh.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- ---- Waylan Limberg waylan at gmail.com From jvm_cop at spamcop.net Thu Jan 12 19:51:51 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Thu, 12 Jan 2006 13:51:51 -0500 Subject: [IronPython] Answers not added to the thread In-Reply-To: References: Message-ID: <4.3.2.7.2.20060112132513.05f21930@mail.comcast.net> I'm pretty sure that the right answer depends on what software is being used to determine the threading. Every mail (and Usenet newsgroup) message includes (in the header) a Message-Id: header. This is the one from Detlef's original message: Message-Id: and when you Reply to a message, your email program "should" include, in the header of your reply message, an In-Reply-To: header that refers to it: In-Reply-To: as well as having its own Message-Id: header. That IRT header was in Waylan's reply, and it of course has its own Message-Id: Message-ID: My response to Waylan's message will include In-Reply-To: and any reply to this message will have an In-Reply-To: with the Message-ID: of this message (I don't know what it is, as it's not created until I send it). There are also References: headers that can list multiple other message ids, but the mechanism is a bit less obvious than the In-Reply-To: mechanism. So, Detlef, it's possible that your email program is not producing an In-Reply-To: header when you use the program's Reply feature; that would be a bug. It's possible that you're not using the Reply feature of your email program, but are instead starting a new message when replying -- so your email program doesn't know to include an In-Reply-To: header. It's possible that the threading mechanism whose result you're seeing relies at least as much on References: headers as on In-Reply-To: headers, and that your email program doesn't send what's expected. Finally, it's possible that the position / presence of the Re: is relevant, but that's a very non-robust way of doing threading. After all, how many sets of unrelated messages have had subjects like these over time? Is this a bug? Newbie question ADO.NET so that using just the subject is not going to produce accurate threading, while using In-Reply-To: (and/or References:) would not incorrectly intermingle those unrelated threads. Good luck... At 12:02 PM 1/12/2006, Waylan Limberg wrote >The reply subject to this message should be: > Re: [IronPython] Answers not added to the thread >but not > [IronPython] Re: Answers not added to the thread > >In other words, the "Re:" can only be added to the very begining of >the subject including the [list label] added by the list system. As >an alternative, you could just never include "Re:" in your subject. >Then the subject would always be the same - and that should work as >well. > >On 1/12/06, Stute, Detlef ALRT/EEG4 wrote: >> Hi all, >> A short non IronPython question. >> What must be the subject line of an answer to be integrated into the message thread? >> My answers to any questions are not added to the thread, the occur as a new independent message. >> >> Mit freundlichen Gr??en/ kind regards/ Cordiali Saluti >> SEATEC GmbH >> Detlef Stute >> www.seatec-gmbh.com >-- >---- >Waylan Limberg >waylan at gmail.com J. Merrill / Analytical Software Corp From giles.thomas at resolversystems.com Thu Jan 12 22:35:35 2006 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Thu, 12 Jan 2006 21:35:35 +0000 Subject: [IronPython] Trying to set methods on "built-in" classes fails silently Message-ID: <43C6CBA7.9030206@resolversystems.com> Hi, I suspect it's not something anyone's likely to come across often, but if you try to rebind a method on a built-in class, no exception will be thrown but it will not be changed. An example: You can rebind methods on regular classes easily: --- >>> class C: ... def m(self): ... return 2 ... >>> c = C() >>> c.m() 2 >>> def n(): ... return 3 ... >>> c.m = n >>> c.m() 3 --- However, when you try to do this with a CLR class there's no warning, but it doesn't work: --- >>> f = Form() >>> f.ToString() 'System.Windows.Forms.Form, Text: ' >>> def newToString(): ... return "Hello, world!" ... >>> f.ToString = newToString >>> f.ToString() 'System.Windows.Forms.Form, Text: ' >>> f.ToString == newToString False --- The behaviour when you try to set arbitrary attributes on the built-in classes is nicer, I think: --- >>> f.foobar = 23 Traceback (most recent call last): at TypeError: can't set arbitrary attributes on built-in type System.Windows.Forms.Form --- I've confirmed this in the beta and in 0.9.5 (I hasten to add that I'm not recommending rebinding methods as standard practive...) Cheers, Giles -- Giles Thomas Resolver Systems giles.thomas at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ From kfarmer at thuban.org Fri Jan 13 05:02:33 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 12 Jan 2006 20:02:33 -0800 Subject: [IronPython] Trying to set methods on "built-in" classes failssilently References: <43C6CBA7.9030206@resolversystems.com> Message-ID: Standard practice or not, this begs the question of whether it should be allowed at all. I would argue against it: * security issue * silent fails mask unexpected behavior However, adding *new* members doesn't, to my knowledge, present a security risk. As a comparison, MSH allows new members and aliases to be overlayed on top of existing types, but I don't know whether or not it chokes when attempting to override an existing member. It may be worthwhile to agree with the MSH team on a strategy. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Giles Thomas Sent: Thu 1/12/2006 1:35 PM I suspect it's not something anyone's likely to come across often, but if you try to rebind a method on a built-in class, no exception will be thrown but it will not be changed. An example: -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 4203 bytes Desc: not available URL: From s.kobalczyk at softwaremind.pl Fri Jan 13 08:04:48 2006 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Fri, 13 Jan 2006 08:04:48 +0100 Subject: [IronPython] IronPython kills CLR In-Reply-To: <43C41AD7.0@softwaremind.pl> References: <43C41AD7.0@softwaremind.pl> Message-ID: <43C75110.6000909@softwaremind.pl> Hi, Did you receive my last email? Have you been able to reproduce this issue? Please let me know how to avoid this bug (I don't want to blow up my application with some script by incident). Szymon. Szymon Kobalczyk wrote: >I finally found why my NUnit suite doesnt work anymore. It occurs that >its caused by following test case: > > string script = @" >class Rectangle1(object): > > def __init__(self, width, height): > self.width = width > self.height = height > > def getArea(self): > return self.width * self.height > > area = property(getArea, None, None, None) > >r = Rectangle1(10, 100) >print r.area"; > > PythonEngine engine = new PythonEngine(); > > object code = engine.Compile(script); > engine.Execute(code); > > >Executing this in NUnit just kills the process with no error. When I >execute it with debugger I get following exception: > > > IronPython.dll!IronPython.Runtime.Frame.TryGetLocal(string name = >"property", out object ret = null) Line 65 + 0x12 bytes C# > IronPython.dll!IronPython.Runtime.Frame.GetGlobal(string name = >"property") Line 90 + 0xe bytes C# > snippets.dll!moduleHolder_0.Rectangle1$maker0() + 0x158 bytes > snippets.dll!moduleHolder_0.input() + 0xb6 bytes > >IronPython.dll!IronPython.Runtime.FrameCode.Run(IronPython.Runtime.Frame >frame = {IronPython.Runtime.Frame}) Line 165 + 0xd bytes C# >... > >FatalExecutionEngineError was detected >Message: The runtime has encountered a fatal error. The address of the >error was at 0x79e7bd7e, on thread 0xc04. The error code is 0xc0000005. >This error may be a bug in the CLR or in the unsafe or non-verifiable >portions of user code. Common sources of this bug include user >marshaling errors for COM-interop or PInvoke, which may corrupt the stack. > >If I execute the same script using IronPythonConsole it works fine. >Please confirm if this issue would occur only when we use python >properties (hopefully we don't have any yet in production code) or there >are other cases to avoid. > >Szymon Kobalczyk. >_______________________________________________ >users mailing list >users at lists.ironpython.com >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From dinov at exchange.microsoft.com Fri Jan 13 21:56:55 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 13 Jan 2006 12:56:55 -0800 Subject: [IronPython] IronPython kills CLR In-Reply-To: <43C75110.6000909@softwaremind.pl> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01017A44@df-foxhound-msg.exchange.corp.microsoft.com> Sorry for the delayed response - this is the same issue we're seeing with code not working properly at the console. What's happening here is that we are making a call into TryGetLocal and passing in a variable of the wrong type (we end up passing in an instance of your Rectangle1 class but expect an instance of the Frame class where we can find the dictionary). This was introduced by the changes to cleanup the leaks. It is something that we're actively working on fixing. One workaround would be to include: if(False): locals() inside of __init__ (as this will prevent us from creating a dynamic method for this method). It's ugly, but it might unblock you for beta 1 and shouldn't have any cost other than the check for the if false. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Szymon Kobalczyk Sent: Thursday, January 12, 2006 11:05 PM To: s.kobalczyk at softwaremind.pl; Discussion of IronPython Subject: Re: [IronPython] IronPython kills CLR Hi, Did you receive my last email? Have you been able to reproduce this issue? Please let me know how to avoid this bug (I don't want to blow up my application with some script by incident). Szymon. Szymon Kobalczyk wrote: >I finally found why my NUnit suite doesnt work anymore. It occurs that >its caused by following test case: > > string script = @" >class Rectangle1(object): > > def __init__(self, width, height): > self.width = width > self.height = height > > def getArea(self): > return self.width * self.height > > area = property(getArea, None, None, None) > >r = Rectangle1(10, 100) >print r.area"; > > PythonEngine engine = new PythonEngine(); > > object code = engine.Compile(script); > engine.Execute(code); > > >Executing this in NUnit just kills the process with no error. When I >execute it with debugger I get following exception: > > > IronPython.dll!IronPython.Runtime.Frame.TryGetLocal(string name = >"property", out object ret = null) Line 65 + 0x12 bytes C# > IronPython.dll!IronPython.Runtime.Frame.GetGlobal(string name = >"property") Line 90 + 0xe bytes C# > snippets.dll!moduleHolder_0.Rectangle1$maker0() + 0x158 bytes > snippets.dll!moduleHolder_0.input() + 0xb6 bytes > >IronPython.dll!IronPython.Runtime.FrameCode.Run(IronPython.Runtime.Frame >frame = {IronPython.Runtime.Frame}) Line 165 + 0xd bytes C# >... > >FatalExecutionEngineError was detected >Message: The runtime has encountered a fatal error. The address of the >error was at 0x79e7bd7e, on thread 0xc04. The error code is 0xc0000005. >This error may be a bug in the CLR or in the unsafe or non-verifiable >portions of user code. Common sources of this bug include user >marshaling errors for COM-interop or PInvoke, which may corrupt the stack. > >If I execute the same script using IronPythonConsole it works fine. >Please confirm if this issue would occur only when we use python >properties (hopefully we don't have any yet in production code) or there >are other cases to avoid. > >Szymon Kobalczyk. >_______________________________________________ >users mailing list >users at lists.ironpython.com >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From riltim at gmail.com Fri Jan 13 22:49:12 2006 From: riltim at gmail.com (Tim Riley) Date: Fri, 13 Jan 2006 16:49:12 -0500 Subject: [IronPython] Problems with Mono and Tab Completion. Message-ID: Runtime: Mono-1.1.13 Version: IronPython 1.0.2190 When executing IronPython from the following batch file I get some weird behavior in IronPythonConsole.exe. It seems that as I type in the console it sends two of each character. This behavior only occurs when I pass the "-X:TabCompletion" parameter. Has anyone else experienced this type of behavior? If so is there a workaround? Regards, Tim Riley Contents of mono-ipc.bat ****************************************** @echo off "C:\Program Files\Mono-1.1.13\bin\mono.exe" C:\IronPython\IronPythonConsole.exe -X:TabCompletion @echo on ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From sesquile at gmail.com Sat Jan 14 03:00:55 2006 From: sesquile at gmail.com (m h) Date: Fri, 13 Jan 2006 18:00:55 -0800 Subject: [IronPython] Newbie mono question (setting up lib path) Message-ID: Folks, I'm new to IronPython (and Mono!). Following what I read in Jim's recent email, I tried copying my python2.3 lib directory into the "Lib" directory and added "Lib" to the sys.path in Lib/site.py. Then I tried to import string but it failed. Any hints? mharrison[1080] mono IronPythonConsole.exe IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import string Traceback (most recent call last): ImportError: No module named string >>> mharrison[1045] mono --version Mono JIT compiler version 1.1.13, (C) 2002-2005 Novell, Inc and Contributors. www.mono-project.com TLS: normal GC: Included Boehm (with typed GC) SIGSEGV : normal thanks matt From DevinG at 3sharp.com Sat Jan 14 07:00:56 2006 From: DevinG at 3sharp.com (Devin Ganger) Date: Fri, 13 Jan 2006 22:00:56 -0800 Subject: [IronPython] Newbie question: can I build .NET assemblies from Python code? Message-ID: <190178C01A8E02418A6CA9FB57AF3DD554275C@RED-EXCH01.redmond.3sharp.com> Hello all! I'm new to C# and don't have a lot of experience with advanced Python, so pardon this if it seems to be an obvious question. I have a C# project I'm working on for personal use that requires a functional RADIUS client library. I've searched high and low and have only found a single commercial library available. However, I did find a freely available Python RADIUS implementation, so when I ran across IronPython I immediately wondered if I'd be able to take the Python library and produce a stand-alone .NET assembly that I could then drop into another project. Is this possible, or would I need to incorproate IronPython and the Python RADIUS library into my C# project source code? If it is possible, how feasible would it be until I can get my coding skills to the point of writing a native C# implementation? Since it's all IL, would there be any drawbacks to using such an assembly? Thanks in advance! I very much look forward to playing with IronPython and learning more. -- Devin L. Ganger Email: deving at 3sharp.com 3Sharp LLC Phone: 425.882.1032 x 109 15311 NE 90th Street Cell: 425.239.2575 Redmond, WA 98052 Fax: 425.702.8455 (e)Mail Insecurity: http://blogs.3sharp.com/blog/deving/ From Martin.Maly at microsoft.com Sat Jan 14 07:19:41 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 13 Jan 2006 22:19:41 -0800 Subject: [IronPython] Newbie mono question (setting up lib path) In-Reply-To: References: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F52EECD4@df-foxhound-msg.exchange.corp.microsoft.com> this sounds like IronPython couldn't find the string module. try: >>> import sys >>> sys.path and make sure it found its way there correctly. If in doubt, try absolute paths. Hopefully this helps Martin ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of m h Sent: Friday, January 13, 2006 6:00 PM To: users at lists.ironpython.com Subject: [IronPython] Newbie mono question (setting up lib path) Folks, I'm new to IronPython (and Mono!). Following what I read in Jim's recent email, I tried copying my python2.3 lib directory into the "Lib" directory and added "Lib" to the sys.path in Lib/site.py. Then I tried to import string but it failed. Any hints? mharrison[1080] mono IronPythonConsole.exe IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import string Traceback (most recent call last): ImportError: No module named string >>> mharrison[1045] mono --version Mono JIT compiler version 1.1.13, (C) 2002-2005 Novell, Inc and Contributors. www.mono-project.com TLS: normal GC: Included Boehm (with typed GC) SIGSEGV : normal thanks matt _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jvm_cop at spamcop.net Sun Jan 15 02:07:37 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Sat, 14 Jan 2006 20:07:37 -0500 Subject: [IronPython] Newbie question: can I build .NET assemblies from Python code? In-Reply-To: <190178C01A8E02418A6CA9FB57AF3DD554275C@RED-EXCH01.redmond. 3sharp.com> Message-ID: <4.3.2.7.2.20060114195324.05e04108@mail.comcast.net> I think it's very likely that the Python RADIUS implementation you found is really a Python wrapper for a RADIUS C library. That is, someone wrote a "Python extension" in C, and wrote some Python code that talks to it. IronPython does not now support C extensions written for non-.Net versions of Python (and the technical problems probably mean it never will). Actually, I just took a look and the RADIUS library is _not_ C-based. However, it relies on at least one Python standard library that is not yet implemented in IronPython. So you're in the same situation -- the RADIUS library will work not work with IronPython "as is. The Python RADIUS implementation is no doubt usable from within "normal" (not .Net) Python. It is not difficult to write COM server apps in Python; the Python library that helps you do that (called win32com) is part of the standard Python distribution. If you go here http://www.python.org/windows/win32com/QuickStartServerCom.html there's an introduction to what you need to do to write a COM server in Python; your C# code should be able to work with it easily, particularly as you'll be able to design the COM side to match what the C# side needs done If you need help for doing that, this is not the right place (but I could perhaps help you off-list). Good luck! At 01:00 AM 1/14/2006, Devin Ganger wrote >Hello all! > >I'm new to C# and don't have a lot of experience with advanced Python, >so pardon this if it seems to be an obvious question. > >I have a C# project I'm working on for personal use that requires a >functional RADIUS client library. I've searched high and low and have >only found a single commercial library available. However, I did find a >freely available Python RADIUS implementation, so when I ran across >IronPython I immediately wondered if I'd be able to take the Python >library and produce a stand-alone .NET assembly that I could then drop >into another project. > >Is this possible, or would I need to incorproate IronPython and the >Python RADIUS library into my C# project source code? If it is possible, >how feasible would it be until I can get my coding skills to the point >of writing a native C# implementation? Since it's all IL, would there be >any drawbacks to using such an assembly? > >Thanks in advance! I very much look forward to playing with IronPython >and learning more. > >-- >Devin L. Ganger Email: deving at 3sharp.com >3Sharp LLC Phone: 425.882.1032 x 109 >15311 NE 90th Street Cell: 425.239.2575 >Redmond, WA 98052 Fax: 425.702.8455 >(e)Mail Insecurity: http://blogs.3sharp.com/blog/deving/ J. Merrill / Analytical Software Corp From DevinG at 3sharp.com Sun Jan 15 09:36:38 2006 From: DevinG at 3sharp.com (Devin Ganger) Date: Sun, 15 Jan 2006 00:36:38 -0800 Subject: [IronPython] Newbie question: can I build .NET assemblies from Python code? Message-ID: <190178C01A8E02418A6CA9FB57AF3DD5542761@RED-EXCH01.redmond.3sharp.com> J. Merrill wrote: > Actually, I just took a look and the RADIUS library is _not_ > C-based. However, it relies on at least one Python standard > library that is not yet implemented in IronPython. So you're > in the same situation -- the RADIUS library will work not > work with IronPython "as is. This is the pyrad library, yes? Out of curiosity, which library isn't implemented in IronPython yet? On a theoretical level, if I *did* have all of the libraries I needed available, would it be possible to compile a self-contained .NET assembly out of the Python code? > It is not difficult to write COM server apps in Python; the > Python library that helps you do that (called win32com) is > part of the standard Python distribution. Hmm. That's an approach I hadn't considered. > your C# code should be able to work with it easily, particularly > as you'll be able to design the COM side to match what the C# > side needs done I see what you're saying. Check me on this: anyone who wanted to use my project would then have to have Python installed, along with the pyrad library, along with my Python COM server wrapper for it, yes? That's a number of hoops to jump through and I suspect the result would be that no one (myself included) uses this particular module (I'm trying to do an authentication add-on for a blogging system). Since I have to learn C# in more depth anyway, I guess I'll go with plan A and work with some friends to create a native C# RADIUS client implementation. In the meantime, though, I'll be keeping my eye on IronPython. Thanks for the answers! -- Devin L. Ganger Email: deving at 3sharp.com 3Sharp LLC Phone: 425.882.1032 x 109 15311 NE 90th Street Cell: 425.239.2575 Redmond, WA 98052 Fax: 425.702.8455 (e)Mail Insecurity: http://blogs.3sharp.com/blog/deving/ From nicolasg at vtrip.net Mon Jan 16 10:03:27 2006 From: nicolasg at vtrip.net (Nicolas Georgakopoulos) Date: Mon, 16 Jan 2006 11:03:27 +0200 Subject: [IronPython] toolbox use in IronPython... Message-ID: <43CB615F.2050503@vtrip.net> Hello all , I'm just wondering if there is a way to design forms and add components just like in other .NET languages (C#,VB drag and drop style) ? I wont to avoid writing code by hand for buttons etc... From jvm_cop at spamcop.net Mon Jan 16 17:37:32 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Mon, 16 Jan 2006 11:37:32 -0500 Subject: [IronPython] Newbie question: can I build .NET assemblies from Python code? In-Reply-To: <190178C01A8E02418A6CA9FB57AF3DD5542761@RED-EXCH01.redmond. 3sharp.com> Message-ID: <4.3.2.7.2.20060116111008.041a1340@mail.comcast.net> At 03:36 AM 1/15/2006, Devin Ganger wrote >J. Merrill wrote: > >> Actually, I just took a look and the RADIUS library is _not_ >> C-based. However, it relies on at least one Python standard >> library that is not yet implemented in IronPython. So you're >> in the same situation -- the RADIUS library will work not >> work with IronPython "as is. > >This is the pyrad library, yes? Out of curiosity, which library isn't >implemented in IronPython yet? pyrad 0.8. It uses the standard Python "socket" library, which has not been implemented (yet) for IP. I haven't looked, but I suspect that on every platform at least some parts of that library are implemented in C (to get at OS-level socket functionality). It may use other not-implemented standard Python modules as well; I did not look in detail. >On a theoretical level, if I *did* have all of the libraries I needed >available, would it be possible to compile a self-contained .NET >assembly out of the Python code? Not without a bit of hassle, at this beta stage. One of the things not fully baked is the "build .Net libraries for use from outside" -- there is no mechanism to compile some .py file into a .Net DLL that can be used trivially by any .Net language. (Such a DLL would require the IronPython assemblies, of course.) However, you can jump through hoops involving renaming intended-to-be-temporary assemblies that the console app writes to file. We are promised much better "from outside IronPython" usage of pre-compiled IP code in the future. >> It is not difficult to write COM server apps in Python; the >> Python library that helps you do that (called win32com) is >> part of the standard Python distribution. > >Hmm. That's an approach I hadn't considered. That's why I mentioned it...but discussion of that approach should be done elsewhere as it would no longer involve IronPython. >> your C# code should be able to work with it easily, particularly >> as you'll be able to design the COM side to match what the C# >> side needs done > >I see what you're saying. Check me on this: anyone who wanted to use my >project would then have to have Python installed, along with the pyrad >library, along with my Python COM server wrapper for it, yes? That's a >number of hoops to jump through and I suspect the result would be that >no one (myself included) uses this particular module (I'm trying to do >an authentication add-on for a blogging system). Not necessarily, as CPython has mechanisms that allow you to create what are known as "frozen executables" where all the code needed (an embedded Python interpreter, your Python "main" module, and all Python modules that your code uses) can be glued together into a single .EXE file. (It's possible that some programs you already have on your Windows machines are written in Python.) Look here for more info: http://starship.python.net/crew/atuining/cx_Freeze/README.txt >Since I have to learn C# in more depth anyway, I guess I'll go with plan >A and work with some friends to create a native C# RADIUS client >implementation. In the meantime, though, I'll be keeping my eye on >IronPython. Depending on how many C-style structures etc are involved, this could be trivial or annoying experimentation with various "interop" mechanisms. People who have looked at it say that implementing the socket library for IP (by using the .Net socket libraries) should not be difficult. Why no one has done it if that's the case, I don't know; maybe someone did just what they needed and didn't share it as it's incomplete. You could check to see what parts of the socket library are used by the pyrad client code; if it's a small percentage (as I'd expect, as you're only building a client and not a server) you could build your own socket-subset package using IP's support for calling .Net libraries. >Thanks for the answers! Good luck. >-- >Devin L. Ganger Email: deving at 3sharp.com >3Sharp LLC Phone: 425.882.1032 x 109 >15311 NE 90th Street Cell: 425.239.2575 >Redmond, WA 98052 Fax: 425.702.8455 >(e)Mail Insecurity: http://blogs.3sharp.com/blog/deving/ J. Merrill / Analytical Software Corp From junk at krow.de Mon Jan 16 18:17:32 2006 From: junk at krow.de (Thomas) Date: Mon, 16 Jan 2006 18:17:32 +0100 Subject: [IronPython] Dynamic overloading of Reflected Methods Message-ID: <43CBD52C.8050500@krow.de> hi, I'm trying to dynamically overload an objects methods with IP. Something like: class A: def test(self): print "A" a = A() def newtest(self): print "newtest" testType = type(a.test) a.test = testType(newtest, a) a.test() prints "newtest" as expected. However I cannot overload a ReflectedMethod made in C# this way (or don't know how). A workaround for this, is to implement the methods in a derived class and override them them there. However these overloaded methods cannot be called. I have attached a C# and a Python file to reproduce this. Any Ideas? Is this supposed to work? l8r... Thomas -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: DynamicTest.cs URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: DynamicTestPython.py URL: From miuler at gmail.com Mon Jan 16 19:29:47 2006 From: miuler at gmail.com (Hector Miuler Malpica Gallegos) Date: Mon, 16 Jan 2006 13:29:47 -0500 Subject: [IronPython] import __main__ (ImportError:) Message-ID: <1137436187.8844.8.camel@localhost.localdomain> Hello friends, I have problems when trying to execute script I throw in python: miuler at miuler:/usr/lib/python2.4$ python Python 2.4.2 (#2, Nov 20 2005, 17:04:48) [GCC 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> __name__ '__main__' >>> import __main__ >>> type (__main__) >>> miuler at miuler:~$ IronPythonConsole.exe IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> __name__ '__main__' >>> import __main__ Traceback (most recent call last): ImportError: No module named __main__ >>> __name__ '__main__' >>> type (__main__) Traceback (most recent call last): NameError: name '__main__' is not defined >>> PS IPython also has east error. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sesquile at gmail.com Mon Jan 16 22:22:10 2006 From: sesquile at gmail.com (m h) Date: Mon, 16 Jan 2006 21:22:10 +0000 Subject: [IronPython] Newbie mono question (setting up lib path) In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F52EECD4@df-foxhound-msg.exchange.corp.microsoft.com> References: <5C0A6F919D675745BB1DBA7412DB68F52EECD4@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: hmmmm, string.py is in "\\tmp\\ipython\\IronPython-1.0-Beta1\\Lib".... which is in my path... mharrison[1080] mono IronPythonConsole.exe IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import string Traceback (most recent call last): ImportError: No module named string >>> import sys >>> sys.path ['\\tmp\\ipython\\IronPython-1.0-Beta1', '\\tmp\\ipython\\IronPython-1.0-Beta1\\Lib'] >>> On 1/14/06, Martin Maly wrote: > this sounds like IronPython couldn't find the string module. try: > > >>> import sys > >>> sys.path > > and make sure it found its way there correctly. If in doubt, try absolute paths. > > Hopefully this helps > Martin > > ________________________________________ > From: users-bounces at lists.ironpython.com On Behalf Of m h > Sent: Friday, January 13, 2006 6:00 PM > To: users at lists.ironpython.com > Subject: [IronPython] Newbie mono question (setting up lib path) > > Folks, I'm new to IronPython (and Mono!). > Following what I read in Jim's recent email, I tried copying my > python2.3 lib directory into the "Lib" directory and added "Lib" to > the sys.path in Lib/site.py. Then I tried to import string but it > failed. Any hints? > > mharrison[1080] mono IronPythonConsole.exe > IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import string > Traceback (most recent call last): > ImportError: No module named string > >>> > > mharrison[1045] mono --version > Mono JIT compiler version 1.1.13, (C) 2002-2005 Novell, Inc and > Contributors. www.mono-project.com > TLS: normal > GC: Included Boehm (with typed GC) > SIGSEGV : normal > > thanks > matt > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From vargaz at gmail.com Mon Jan 16 22:41:35 2006 From: vargaz at gmail.com (Zoltan Varga) Date: Mon, 16 Jan 2006 22:41:35 +0100 Subject: [IronPython] Newbie mono question (setting up lib path) In-Reply-To: References: Message-ID: <295e750a0601161341k62f7cc44g7a35793369e734b2@mail.gmail.com> Hi, You might be running into a mono bug instead of an IronPython bug. Try the MS runtime, and if that works, then its a mono bug, and you should report it at bugzilla.ximian.com. Zoltan On 1/14/06, m h wrote: > Folks, I'm new to IronPython (and Mono!). > Following what I read in Jim's recent email, I tried copying my > python2.3 lib directory into the "Lib" directory and added "Lib" to > the sys.path in Lib/site.py. Then I tried to import string but it > failed. Any hints? > > mharrison[1080] mono IronPythonConsole.exe > IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import string > Traceback (most recent call last): > ImportError: No module named string > >>> > > mharrison[1045] mono --version > Mono JIT compiler version 1.1.13, (C) 2002-2005 Novell, Inc and > Contributors. www.mono-project.com > TLS: normal > GC: Included Boehm (with typed GC) > SIGSEGV : normal > > thanks > matt > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From riltim at gmail.com Mon Jan 16 22:54:25 2006 From: riltim at gmail.com (Tim Riley) Date: Mon, 16 Jan 2006 16:54:25 -0500 Subject: [IronPython] Newbie mono question (setting up lib path) In-Reply-To: References: <5C0A6F919D675745BB1DBA7412DB68F52EECD4@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: This works for me using Mono 1.1.13 and IronPython 1.0.2190 on Windows XP. IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import sys >>> sys.path.append('c:\Python24\Lib') >>> import string >>> dir(string) ['ImportError', 'KeyError', 'Template', 'True', 'TypeError', 'ValueError', '_TemplateMetaclass', '__ builtins__', '__dict__', '__doc__', '__file__', '__name__', '_float', '_idmap', '_idmapL', '_int', ' _long', '_multimap', '_re', 'ascii_letters', 'ascii_lowercase', 'ascii_uppercase', 'atof', 'atof_err or', 'atoi', 'atoi_error', 'atol', 'atol_error', 'basestring', 'capitalize', 'capwords', 'center', ' chr', 'count', 'digits', 'expandtabs', 'find', 'float', 'hexdigits', 'index', 'index_error', 'int', 'isinstance', 'join', 'joinfields', 'len', 'letters', 'ljust', 'long', 'lower', 'lowercase', 'lstrip ', 'maketrans', 'map', 'octdigits', 'ord', 'printable', 'punctuation', 'range', 'replace', 'repr', ' rfind', 'rindex', 'rjust', 'rsplit', 'rstrip', 'split', 'splitfields', 'str', 'strip', 'super', 'swa pcase', 'translate', 'type', 'upper', 'uppercase', 'whitespace', 'xrange', 'zfill'] >>> On 1/16/06, m h wrote: > > hmmmm, string.py is in "\\tmp\\ipython\\IronPython-1.0-Beta1\\Lib".... > which is in my path... > > mharrison[1080] mono IronPythonConsole.exe > IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import string > Traceback (most recent call last): > ImportError: No module named string > >>> import sys > >>> sys.path > ['\\tmp\\ipython\\IronPython-1.0-Beta1', > '\\tmp\\ipython\\IronPython-1.0-Beta1\\Lib'] > >>> > > > > On 1/14/06, Martin Maly wrote: > > this sounds like IronPython couldn't find the string module. try: > > > > >>> import sys > > >>> sys.path > > > > and make sure it found its way there correctly. If in doubt, try > absolute paths. > > > > Hopefully this helps > > Martin > > > > ________________________________________ > > From: users-bounces at lists.ironpython.com On Behalf Of m h > > Sent: Friday, January 13, 2006 6:00 PM > > To: users at lists.ironpython.com > > Subject: [IronPython] Newbie mono question (setting up lib path) > > > > Folks, I'm new to IronPython (and Mono!). > > Following what I read in Jim's recent email, I tried copying my > > python2.3 lib directory into the "Lib" directory and added "Lib" to > > the sys.path in Lib/site.py. Then I tried to import string but it > > failed. Any hints? > > > > mharrison[1080] mono IronPythonConsole.exe > > IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 > > Copyright (c) Microsoft Corporation. All rights reserved. > > >>> import string > > Traceback (most recent call last): > > ImportError: No module named string > > >>> > > > > mharrison[1045] mono --version > > Mono JIT compiler version 1.1.13, (C) 2002-2005 Novell, Inc and > > Contributors. www.mono-project.com > > TLS: normal > > GC: Included Boehm (with typed GC) > > SIGSEGV : normal > > > > thanks > > matt > > _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Mon Jan 16 23:22:04 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 16 Jan 2006 14:22:04 -0800 Subject: [IronPython] Dynamic overloading of Reflected Methods In-Reply-To: <43CBD52C.8050500@krow.de> Message-ID: <4039D552ADAB094BB1EA670F3E96214E010CE353@df-foxhound-msg.exchange.corp.microsoft.com> This looks like a bug (or two). We currently don't allow you to override reflected methods on a per-instance basis (or at least the C# side won't see it). We also don't allow you to construct bound ReflectedMethod's in the manner that you'd like. Currently we only really expect the IronPython runtime to create reflected methods and so we'll need to fix that as well. Unfortunately I don't think the changes will be quite trivial so I'll be a little surprised if we get this fixed for beta 2. But it seems like it should work and that for now you have a reasonable work around until we get it fixed. Thanks for the bug report! -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Thomas Sent: Monday, January 16, 2006 9:18 AM To: users at lists.ironpython.com Subject: [IronPython] Dynamic overloading of Reflected Methods hi, I'm trying to dynamically overload an objects methods with IP. Something like: class A: def test(self): print "A" a = A() def newtest(self): print "newtest" testType = type(a.test) a.test = testType(newtest, a) a.test() prints "newtest" as expected. However I cannot overload a ReflectedMethod made in C# this way (or don't know how). A workaround for this, is to implement the methods in a derived class and override them them there. However these overloaded methods cannot be called. I have attached a C# and a Python file to reproduce this. Any Ideas? Is this supposed to work? l8r... Thomas From info at geatec.com Tue Jan 17 11:33:34 2006 From: info at geatec.com (J. de Hooge) Date: Tue, 17 Jan 2006 11:33:34 +0100 Subject: [IronPython] (no subject) Message-ID: <000001c61b51$77f05d60$6402a8c0@GEADELL> Hi, I've written quite some code in IP using Forms (from .NET 2.0) on Windows, but I may have to port that to Linux for a customer. Currently I don't have a Linux machine at my disposal. Does anyone have experience with System.Windows.Forms under Mono? Is it compatible with Forms 2.0 under Windows? How complete/bugfree is it. Are things like drag&drop implemented properly? Is layout management o.k.? In Windows I can just start a MSIL exe and it will be "interpreted" by the .NET VM , rather than directly run on the processor. Does it work the same on Mono, or do I first have to enter a specific "environment". How well do Mono apps mix with "regular" Linux apps? And (sensitive question?) how mainstream is Mono, e.g. as compared to the Java platform? Thanks for the trouble to be taken Jacques de Hooge info at geatec.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From riltim at gmail.com Tue Jan 17 17:40:03 2006 From: riltim at gmail.com (Tim Riley) Date: Tue, 17 Jan 2006 11:40:03 -0500 Subject: [IronPython] (no subject) In-Reply-To: <000001c61b51$77f05d60$6402a8c0@GEADELL> References: <000001c61b51$77f05d60$6402a8c0@GEADELL> Message-ID: >From what I understand System.Windows.Forms is not complete in Mono as of yet. You might want to check out http://www.mono-project.com/Mono_Project_Roadmap for an idea of what mono currently can and can't do. In the future you might want to look into GTK# for cross platform development. Good Luck, Tim Riley On 1/17/06, J. de Hooge wrote: > > Hi, > > > > I've written quite some code in IP using Forms (from .NET 2.0) on > Windows, but I may have to port that to Linux for a customer. > > Currently I don't have a Linux machine at my disposal. > > Does anyone have experience with System.Windows.Forms under Mono? > > Is it compatible with Forms 2.0 under Windows? > > How complete/bugfree is it. Are things like drag&drop implemented > properly? Is layout management o.k.? > > > > In Windows I can just start a MSIL exe and it will be "interpreted" by the > .NET VM , rather than directly run on the processor. > > Does it work the same on Mono, or do I first have to enter a specific > "environment". > > How well do Mono apps mix with "regular" Linux apps? > > > > And (sensitive question?) how mainstream is Mono, e.g. as compared to the > Java platform? > > > > Thanks for the trouble to be taken > > Jacques de Hooge > > info at geatec.com > > > > > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at geatec.com Tue Jan 17 21:03:13 2006 From: info at geatec.com (J. de Hooge) Date: Tue, 17 Jan 2006 21:03:13 +0100 Subject: [IronPython] (no subject) In-Reply-To: Message-ID: <000501c61ba1$0fc485e0$6402a8c0@GEADELL> The roadmap indeed makes quite clear that I'll have to wait quite a bit with regard to WinForms, since I use many of the 2.0 features. Thanks Jacques de Hooge info at geatec.com -----Oorspronkelijk bericht----- Van: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Namens Tim Riley Verzonden: Tuesday, January 17, 2006 5:40 PM Aan: Discussion of IronPython Onderwerp: Re: [IronPython] (no subject) >From what I understand System.Windows.Forms is not complete in Mono as of yet. You might want to check out http://www.mono-project.com/Mono_Project_Roadmap for an idea of what mono currently can and can't do. In the future you might want to look into GTK# for cross platform development. Good Luck, Tim Riley On 1/17/06, J. de Hooge < info at geatec.com > wrote: Hi, I've written quite some code in IP using Forms (from .NET 2.0) on Windows, but I may have to port that to Linux for a customer. Currently I don't have a Linux machine at my disposal. Does anyone have experience with System.Windows.Forms under Mono? Is it compatible with Forms 2.0 under Windows? How complete/bugfree is it. Are things like drag&drop implemented properly? Is layout management o.k.? In Windows I can just start a MSIL exe and it will be "interpreted" by the .NET VM , rather than directly run on the processor. Does it work the same on Mono, or do I first have to enter a specific "environment". How well do Mono apps mix with "regular" Linux apps? And (sensitive question?) how mainstream is Mono, e.g. as compared to the Java platform? Thanks for the trouble to be taken Jacques de Hooge info at geatec.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jussij at zeusedit.com Mon Jan 16 12:39:57 2006 From: jussij at zeusedit.com (Jussi Jumppanen) Date: Mon, 16 Jan 2006 22:39:57 +1100 Subject: [IronPython] IronPython IDE Message-ID: <43CB860D.5394@zeusedit.com> Giles Thomas wrote: > Right now I'm using TextPad with a Python syntax highlighing > configuration file, but if there's anything better out there The Zeus for Windows IDE comes with support for Python: http://www.zeusedit.com/features.html To make it work with Iron Python files just add the file extension to the Python document type using the Options Document Types menu. NOTE: Zeus is shareware and offers a 45 day fully functional trial period. Jussi Jumppanen Author of: Zeus for Windows From paul.moore at centrify.com Thu Jan 19 02:27:46 2006 From: paul.moore at centrify.com (Paul Moore) Date: Wed, 18 Jan 2006 17:27:46 -0800 Subject: [IronPython] get exit status from SystemExit exception Message-ID: Can I get that exit status somehow? I have hosted the ip engine and catch the exeption - seems like the exit code would be a nice thing to have -------------- next part -------------- An HTML attachment was scrubbed... URL: From stax0711-dev at yahoo.de Sat Jan 14 14:52:26 2006 From: stax0711-dev at yahoo.de (stax0711-dev at yahoo.de) Date: Sat, 14 Jan 2006 14:52:26 +0100 Subject: [IronPython] Run a script without a console to pop up? Message-ID: <43C9021A.3050203@yahoo.de> sounds great! Thanks, stax in reply to: The current beta 1 release of IronPython always pops up a console. One of our pre-1.0 workitems is to add a way to launch IronPython applications without popping up a console, but we don't have that yet. The idea is that anyone who's willing to work with a 1st beta should be willing to deal with a console popping up - but we'll fix this pretty soon. I agree that the start-up time is annoying. We have some optimization work left to do here. If you run a static compiler on your Python code you can bring the start-up time from about 2 seconds to well under 1 second for simple programs today. Unfortunately, right now the only ways to use it are via the alpha preview VSIP integration or by writing your own front-end that uses IronPython.Hosting.PythonCompiler directly (see example at end of this message) Code completion today only works from the interactive console. Tab will do an excellent job in that environment of providing you with options. Doing code completion for a dynamic language in a static IDE is challenging and we're unsure what our timeframe is for support there. Thanks - Jim FYI - Here's the simple program I used to compile a test hello world program to confirm that this does offer a major reduction in start-up time. Feel free to experiment with this for yourself. import sys sys.LoadAssemblyByName('IronPython') from IronPython.Hosting import PythonCompiler from System.Collections.Generic import * sources = List[str]() sources.Add('hello.py') ipc = PythonCompiler(sources, 'hello.exe') ipc.MainFile = 'hello.py' ipc.Compile() ___________________________________________________________ Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de From YU5M-OONK at j.asahi-net.or.jp Tue Jan 17 03:48:25 2006 From: YU5M-OONK at j.asahi-net.or.jp (Oonuki Makoto) Date: 17 Jan 2006 11:48:25 +0900 Subject: [IronPython] Can't call non-python instance method with argument name Message-ID: <43CC5AFA.32086.001@leopold.j.asahi-net.or.jp> Hello, Sorry if this is a known limitation, I've checked ML archive and the bug tracker though... I've got the following error with IP1.0 beta1 / .NET 2.0 (japanese). It seems that IP uses int 10 as the instance instead of R. --------------- >ironpythonconsole -X:ExceptionDetail >>> import System >>> R = System.Random() >>> R.Next(maxValue=10) System.Reflection.TargetException: Object does not match target type. at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at IronPython.Runtime.ReflectedMethodBase.Invoke(MethodBinding binding) at IronPython.Runtime.ReflectedMethodBase.Call(Object[] args, String[] names) at IronPython.Runtime.Ops.Call(Object func, Object[] args, String[] names) at input##2(Frame ) at IronPython.Runtime.FrameCodeDelegate.Invoke(Frame frame) at IronPython.Runtime.FrameCode.Run(Frame frame) at IronPython.Hosting.PythonEngine.DoOneInteractive(Frame topFrame) at IronPython.Hosting.PythonEngine.RunInteractive() StandardError: Object does not match target type. From pavan.podila at gmail.com Thu Jan 19 23:18:54 2006 From: pavan.podila at gmail.com (Pavan Podila) Date: Thu, 19 Jan 2006 16:18:54 -0600 Subject: [IronPython] Consuming IP generated DLL from C# Message-ID: <5ef850c60601191418x3c15a6en6a89d55b7ccf80e4@mail.gmail.com> Hello, I have been trying to consume a class written in IP from my C# code. I looked up some posts on this topic and somewhere it was mentioned that this is a planned feature for v1.0. Using Reflector the compiled class shows up as first.MyClass$maker0() : IDictionary first.MyClass : Object Is this a WIP right now? Regards, Pavan Podila -- the approach, rather than the solution -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Jan 19 23:22:12 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 19 Jan 2006 14:22:12 -0800 Subject: [IronPython] Can't call non-python instance method with argument name In-Reply-To: <43CC5AFA.32086.001@leopold.j.asahi-net.or.jp> Message-ID: <4039D552ADAB094BB1EA670F3E96214E012C9740@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the bug report - we hadn't seen this one before. We'll get this fixed for the next beta release. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Oonuki Makoto Sent: Monday, January 16, 2006 6:48 PM To: users at lists.ironpython.com Subject: [IronPython] Can't call non-python instance method with argument name Hello, Sorry if this is a known limitation, I've checked ML archive and the bug tracker though... I've got the following error with IP1.0 beta1 / .NET 2.0 (japanese). It seems that IP uses int 10 as the instance instead of R. --------------- >ironpythonconsole -X:ExceptionDetail >>> import System >>> R = System.Random() >>> R.Next(maxValue=10) System.Reflection.TargetException: Object does not match target type. at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at IronPython.Runtime.ReflectedMethodBase.Invoke(MethodBinding binding) at IronPython.Runtime.ReflectedMethodBase.Call(Object[] args, String[] names) at IronPython.Runtime.Ops.Call(Object func, Object[] args, String[] names) at input##2(Frame ) at IronPython.Runtime.FrameCodeDelegate.Invoke(Frame frame) at IronPython.Runtime.FrameCode.Run(Frame frame) at IronPython.Hosting.PythonEngine.DoOneInteractive(Frame topFrame) at IronPython.Hosting.PythonEngine.RunInteractive() StandardError: Object does not match target type. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Thu Jan 19 23:26:18 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 19 Jan 2006 14:26:18 -0800 Subject: [IronPython] get exit status from SystemExit exception In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E012C974E@df-foxhound-msg.exchange.corp.microsoft.com> The CLR exception doesn't expose this, instead it's packed away in the Python exception. The python exception is accessible from the Data dictionary, and then you'd have to get the dictionary from the old-style class... We do have a GetExitCode(PythonSystemExit) API on PythonEngine but it's private. As a temporary work around you can make that public and call it. I'll look into adding a ExitCode property to PythonSystemExit that you can use in the future. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paul Moore Sent: Wednesday, January 18, 2006 5:28 PM To: users at lists.ironpython.com Subject: [IronPython] get exit status from SystemExit exception Can I get that exit status somehow? I have hosted the ip engine and catch the exeption - seems like the exit code would be a nice thing to have From paparipote at hotmail.com Fri Jan 20 00:32:50 2006 From: paparipote at hotmail.com (Paparipote .) Date: Thu, 19 Jan 2006 19:32:50 -0400 Subject: [IronPython] TypeError: bad args to this method Message-ID: Hello: I am trying to connect to a SAP system using IP. A dll called ProxyIVA.dll created under .NET Framework 1.1 facilitates the connection. It works under C# without troubles in the next way: using System; using System.Web.Services; using ProxyIVA; namespace ConsoleApplication1 { class Class1 { [STAThread] static void Main(string[] args) { string cs = "ASHOST= 111.11.1.11 SYSNR=00 CLIENT=300 USER=TEST PASSWD=x1x1x1x1"; ProxyIVA.SAPProxy1 PIVA = new ProxyIVA.SAPProxy1(cs); ZHRRESNOMTable tIVA = new ZHRRESNOMTable(); int sts = 0; PIVA.Z_Hrpfpa00105("20051231","03005358", out sts, ref tIVA); foreach (ZHRRESNOM r in tIVA) Console.WriteLine("{0} {1}", r.Desc2, r.Betrg); Console.ReadLine(); } } } I try to do this in IP with the next results: >>>^C :ironpythonconsole IronPython 1.0.2194 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>>import System >>>import clr >>>aso = System.Reflection.Assembly.LoadFrom("C:/Documents and >>>Settings/egironas/My Documents/My >>>Apps/Py/IronPython-1.0-Beta1/ProxyIVA.dll") >>>aso1=System.Reflection.Assembly.LoadFrom("C:/WINDOWS/Microsoft.NET/Framework /v1.1.4322/System.Web.Services.dll") >>>clr.AddReference(aso) >>>clr.AddReference(aso1) >>>from ProxyIVA import * >>>cs = 'ASHOST= 111.11.1.11 SYSNR=00 CLIENT=300 USER=TEST PASSWD=x1x1x1x1' >>>PIVA = SAPProxy1(cs) >>>tIVA = ZHRRESNOMTable() >>>sts = 0 >>>PIVA.Z_Hrpfpa00105("20051231","03005358", sts, tIVA) Traceback (most recent call last): File , line 0, in input##11 TypeError: bad args to this method >>> I send you a text dump MSIL information of ProxyIVA.dll: ___[MOD] C:\Documents and Settings\egironas\My Documents\My Apps\Py\IronPython-1.0-Beta1\ProxyIVA.dll | M A N I F E S T |___[NSP] ProxyIVA | |___[CLS] ProxyIVA.SAPProxy1 | | | .class public auto ansi serializable beforefieldinit | | | extends [SAP.Connector]SAP.Connector.SAPClient | | | .custom instance void [System.Web.Services]System.Web.Services.WebServiceBindingAttribute::.ctor() = ( 01 00 02 00 54 0E 04 4E 61 6D 65 0D 64 75 6D 6D // ....T..Name.dumm ... | | |___[MET] method .ctor : void(string) | | |___[MET] method .ctor : void(class [System]System.ComponentModel.IContainer) | | |___[MET] method .ctor : void() | | |___[MET] method Z_Hrpfpa00105 : void(string,string,int32&,class ProxyIVA.ZHRRESNOMTable&) | | | |___[CLS] ProxyIVA.ZHRRESNOM | | | .class public auto ansi serializable beforefieldinit | | | extends [SAP.Connector]SAP.Connector.SAPStructure | | | .custom instance void [SAP.Connector]SAP.Connector.RfcStructureAttribute::.ctor() = ( 01 00 02 00 54 0E 08 41 62 61 70 4E 61 6D 65 09 // ....T..AbapName. ... | | |___[FLD] field _Betrg : private valuetype [mscorlib]System.Decimal | | |___[FLD] field _Desc2 : private string | | |___[FLD] field _Fpbeg : private string | | |___[FLD] field _Fpend : private string | | |___[FLD] field _Lgart : private string | | |___[FLD] field _Mandt : private string | | |___[FLD] field _Ocrsn : private string | | |___[FLD] field _Seqnr : private string | | |___[MET] method .ctor : void() | | |___[MET] method get_Betrg : valuetype [mscorlib]System.Decimal() | | |___[MET] method get_Desc2 : string() | | |___[MET] method get_Fpbeg : string() | | |___[MET] method get_Fpend : string() | | |___[MET] method get_Lgart : string() | | |___[MET] method get_Mandt : string() | | |___[MET] method get_Ocrsn : string() | | |___[MET] method get_Seqnr : string() | | |___[MET] method set_Betrg : void(valuetype [mscorlib]System.Decimal) | | |___[MET] method set_Desc2 : void(string) | | |___[MET] method set_Fpbeg : void(string) | | |___[MET] method set_Fpend : void(string) | | |___[MET] method set_Lgart : void(string) | | |___[MET] method set_Mandt : void(string) | | |___[MET] method set_Ocrsn : void(string) | | |___[MET] method set_Seqnr : void(string) | | |___[PTY] prop Betrg : instance valuetype [mscorlib]System.Decimal() | | |___[PTY] prop Desc2 : instance string() | | |___[PTY] prop Fpbeg : instance string() | | |___[PTY] prop Fpend : instance string() | | |___[PTY] prop Lgart : instance string() | | |___[PTY] prop Mandt : instance string() | | |___[PTY] prop Ocrsn : instance string() | | |___[PTY] prop Seqnr : instance string() | | | |___[CLS] ProxyIVA.ZHRRESNOMTable | | | .class public auto ansi serializable beforefieldinit | | | extends [SAP.Connector]SAP.Connector.SAPTable | | | .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 04 49 74 65 6D 00 00 ) // ...Item.. ... | | |___[MET] method .ctor : void() | | |___[MET] method Add : int32(class ProxyIVA.ZHRRESNOM) | | |___[MET] method Contains : bool(class ProxyIVA.ZHRRESNOM) | | |___[MET] method CopyTo : void(class ProxyIVA.ZHRRESNOM[],int32) | | |___[MET] method CreateNewRow : object() | | |___[MET] method GetElementType : class [mscorlib]System.Type() | | |___[MET] method IndexOf : int32(class ProxyIVA.ZHRRESNOM) | | |___[MET] method Insert : void(int32,class ProxyIVA.ZHRRESNOM) | | |___[MET] method Remove : void(class ProxyIVA.ZHRRESNOM) | | |___[MET] method get_Item : class ProxyIVA.ZHRRESNOM(int32) | | |___[MET] method set_Item : void(int32,class ProxyIVA.ZHRRESNOM) | | |___[PTY] prop Item : instance class ProxyIVA.ZHRRESNOM(int32) | | | What do you thing the problem is? Many thanks for your attention and help. Best regards, _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ From dinov at exchange.microsoft.com Fri Jan 20 00:53:02 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 19 Jan 2006 15:53:02 -0800 Subject: [IronPython] TypeError: bad args to this method In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E012C98AE@df-foxhound-msg.exchange.corp.microsoft.com> I believe the problem here is the out param. Try leaving the sts parameter out of the call and you should get a return value that is a tuple that contains the modified value of the ref & out param. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote . Sent: Thursday, January 19, 2006 3:33 PM To: users at lists.ironpython.com Subject: [IronPython] TypeError: bad args to this method Hello: I am trying to connect to a SAP system using IP. A dll called ProxyIVA.dll created under .NET Framework 1.1 facilitates the connection. It works under C# without troubles in the next way: using System; using System.Web.Services; using ProxyIVA; namespace ConsoleApplication1 { class Class1 { [STAThread] static void Main(string[] args) { string cs = "ASHOST= 111.11.1.11 SYSNR=00 CLIENT=300 USER=TEST PASSWD=x1x1x1x1"; ProxyIVA.SAPProxy1 PIVA = new ProxyIVA.SAPProxy1(cs); ZHRRESNOMTable tIVA = new ZHRRESNOMTable(); int sts = 0; PIVA.Z_Hrpfpa00105("20051231","03005358", out sts, ref tIVA); foreach (ZHRRESNOM r in tIVA) Console.WriteLine("{0} {1}", r.Desc2, r.Betrg); Console.ReadLine(); } } } I try to do this in IP with the next results: >>>^C :ironpythonconsole IronPython 1.0.2194 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>>import System >>>import clr >>>aso = System.Reflection.Assembly.LoadFrom("C:/Documents and >>>Settings/egironas/My Documents/My >>>Apps/Py/IronPython-1.0-Beta1/ProxyIVA.dll") >>>aso1=System.Reflection.Assembly.LoadFrom("C:/WINDOWS/Microsoft.NET/Framework /v1.1.4322/System.Web.Services.dll") >>>clr.AddReference(aso) >>>clr.AddReference(aso1) >>>from ProxyIVA import * >>>cs = 'ASHOST= 111.11.1.11 SYSNR=00 CLIENT=300 USER=TEST PASSWD=x1x1x1x1' >>>PIVA = SAPProxy1(cs) >>>tIVA = ZHRRESNOMTable() >>>sts = 0 >>>PIVA.Z_Hrpfpa00105("20051231","03005358", sts, tIVA) Traceback (most recent call last): File , line 0, in input##11 TypeError: bad args to this method >>> I send you a text dump MSIL information of ProxyIVA.dll: ___[MOD] C:\Documents and Settings\egironas\My Documents\My Apps\Py\IronPython-1.0-Beta1\ProxyIVA.dll | M A N I F E S T |___[NSP] ProxyIVA | |___[CLS] ProxyIVA.SAPProxy1 | | | .class public auto ansi serializable beforefieldinit | | | extends [SAP.Connector]SAP.Connector.SAPClient | | | .custom instance void [System.Web.Services]System.Web.Services.WebServiceBindingAttribute::.ctor() = ( 01 00 02 00 54 0E 04 4E 61 6D 65 0D 64 75 6D 6D // ....T..Name.dumm ... | | |___[MET] method .ctor : void(string) | | |___[MET] method .ctor : void(class [System]System.ComponentModel.IContainer) | | |___[MET] method .ctor : void() | | |___[MET] method Z_Hrpfpa00105 : void(string,string,int32&,class ProxyIVA.ZHRRESNOMTable&) | | | |___[CLS] ProxyIVA.ZHRRESNOM | | | .class public auto ansi serializable beforefieldinit | | | extends [SAP.Connector]SAP.Connector.SAPStructure | | | .custom instance void [SAP.Connector]SAP.Connector.RfcStructureAttribute::.ctor() = ( 01 00 02 00 54 0E 08 41 62 61 70 4E 61 6D 65 09 // ....T..AbapName. ... | | |___[FLD] field _Betrg : private valuetype [mscorlib]System.Decimal | | |___[FLD] field _Desc2 : private string | | |___[FLD] field _Fpbeg : private string | | |___[FLD] field _Fpend : private string | | |___[FLD] field _Lgart : private string | | |___[FLD] field _Mandt : private string | | |___[FLD] field _Ocrsn : private string | | |___[FLD] field _Seqnr : private string | | |___[MET] method .ctor : void() | | |___[MET] method get_Betrg : valuetype [mscorlib]System.Decimal() | | |___[MET] method get_Desc2 : string() | | |___[MET] method get_Fpbeg : string() | | |___[MET] method get_Fpend : string() | | |___[MET] method get_Lgart : string() | | |___[MET] method get_Mandt : string() | | |___[MET] method get_Ocrsn : string() | | |___[MET] method get_Seqnr : string() | | |___[MET] method set_Betrg : void(valuetype [mscorlib]System.Decimal) | | |___[MET] method set_Desc2 : void(string) | | |___[MET] method set_Fpbeg : void(string) | | |___[MET] method set_Fpend : void(string) | | |___[MET] method set_Lgart : void(string) | | |___[MET] method set_Mandt : void(string) | | |___[MET] method set_Ocrsn : void(string) | | |___[MET] method set_Seqnr : void(string) | | |___[PTY] prop Betrg : instance valuetype [mscorlib]System.Decimal() | | |___[PTY] prop Desc2 : instance string() | | |___[PTY] prop Fpbeg : instance string() | | |___[PTY] prop Fpend : instance string() | | |___[PTY] prop Lgart : instance string() | | |___[PTY] prop Mandt : instance string() | | |___[PTY] prop Ocrsn : instance string() | | |___[PTY] prop Seqnr : instance string() | | | |___[CLS] ProxyIVA.ZHRRESNOMTable | | | .class public auto ansi serializable beforefieldinit | | | extends [SAP.Connector]SAP.Connector.SAPTable | | | .custom instance void [mscorlib]System.Reflection.DefaultMemberAttribute::.ctor(string) = ( 01 00 04 49 74 65 6D 00 00 ) // ...Item.. ... | | |___[MET] method .ctor : void() | | |___[MET] method Add : int32(class ProxyIVA.ZHRRESNOM) | | |___[MET] method Contains : bool(class ProxyIVA.ZHRRESNOM) | | |___[MET] method CopyTo : void(class ProxyIVA.ZHRRESNOM[],int32) | | |___[MET] method CreateNewRow : object() | | |___[MET] method GetElementType : class [mscorlib]System.Type() | | |___[MET] method IndexOf : int32(class ProxyIVA.ZHRRESNOM) | | |___[MET] method Insert : void(int32,class ProxyIVA.ZHRRESNOM) | | |___[MET] method Remove : void(class ProxyIVA.ZHRRESNOM) | | |___[MET] method get_Item : class ProxyIVA.ZHRRESNOM(int32) | | |___[MET] method set_Item : void(int32,class ProxyIVA.ZHRRESNOM) | | |___[PTY] prop Item : instance class ProxyIVA.ZHRRESNOM(int32) | | | What do you thing the problem is? Many thanks for your attention and help. Best regards, _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From paparipote at hotmail.com Fri Jan 20 01:22:38 2006 From: paparipote at hotmail.com (Paparipote .) Date: Thu, 19 Jan 2006 20:22:38 -0400 Subject: [IronPython] TypeError: bad args to this method Message-ID: Dino: It worked according to your indication. Thanks!!! The complete code is: >>>import System >>>import clr >>>aso = System.Reflection.Assembly.LoadFrom("C:/Documents and >>>Settings/egironas/My Documents/My >>>Apps/Py/IronPython-1.0-Beta1/ProxyIVA.dll") >>>aso1=System.Reflection.Assembly.LoadFrom("C:/WINDOWS/Microsoft.NET/Framework /v1.1.4322/System.Web.Services.dll") >>>clr.AddReference(aso) >>>clr.AddReference(aso1) >>>from ProxyIVA import * >>>cs = 'ASHOST= 111.11.1.11 SYSNR=00 CLIENT=300 USER=TEST PASSWD=x1x1x1x1' >>>PIVA = SAPProxy1(cs) >>>tIVA = ZHRRESNOMTable() >>>sts = 0 >>>res = [] >>>res = PIVA.Z_Hrpfpa00105("20051231","03005358", tIVA) >>>for a in res[1]: ... print a.Desc2, a.Betrg ... Cred. Fiscal mes anterior 1167.54 Cred. Fiscal pr?ximo mes 81.90 >>> Thanks again!! _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From yu5m-oonk at asahi-net.or.jp Fri Jan 20 14:37:03 2006 From: yu5m-oonk at asahi-net.or.jp (OHNUKI Makoto) Date: Fri, 20 Jan 2006 22:37:03 +0900 Subject: [IronPython] Can't call non-python instance method with argument name In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E012C9740@df-foxhound-msg.exchange.corp.microsoft.com> References: <43CC5AFA.32086.001@leopold.j.asahi-net.or.jp> <4039D552ADAB094BB1EA670F3E96214E012C9740@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <20060120222720.8368.YU5M-OONK@asahi-net.or.jp> > Thanks for the bug report - we hadn't seen this one before. We'll get this fixed for the next beta release. Thanks a lot! It makes it annoying to call a COM method with a bunch of optional args... (such as Excel's methods.) --- On Thu, 19 Jan 2006 14:22:12 -0800 Dino Viehland wrote: > Thanks for the bug report - we hadn't seen this one before. We'll get this fixed for the next beta release. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Oonuki Makoto > Sent: Monday, January 16, 2006 6:48 PM > To: users at lists.ironpython.com > Subject: [IronPython] Can't call non-python instance method with argument name > > Hello, > > Sorry if this is a known limitation, I've checked ML archive > and the bug tracker though... > > I've got the following error with IP1.0 beta1 / .NET 2.0 (japanese). > > It seems that IP uses int 10 as the instance instead of R. > > --------------- > >ironpythonconsole -X:ExceptionDetail > >>> import System > >>> R = System.Random() > >>> R.Next(maxValue=10) > System.Reflection.TargetException: Object does not match target type. > at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target) > at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) > at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) > at IronPython.Runtime.ReflectedMethodBase.Invoke(MethodBinding binding) > at IronPython.Runtime.ReflectedMethodBase.Call(Object[] args, String[] names) > at IronPython.Runtime.Ops.Call(Object func, Object[] args, String[] names) > at input##2(Frame ) > at IronPython.Runtime.FrameCodeDelegate.Invoke(Frame frame) > at IronPython.Runtime.FrameCode.Run(Frame frame) > at IronPython.Hosting.PythonEngine.DoOneInteractive(Frame topFrame) > at IronPython.Hosting.PythonEngine.RunInteractive() > StandardError: Object does not match target type. > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Larry.Jones at aspentech.com Fri Jan 20 18:38:14 2006 From: Larry.Jones at aspentech.com (Jones, Larry) Date: Fri, 20 Jan 2006 12:38:14 -0500 Subject: [IronPython] Procedure for Posting Bugs Message-ID: <781C4D11561D1A4FA1D631415302FB83096F3B3C@houmail1.corp.aspentech.com> Today, while using IronPython to execute unit tests, I discovered what may be an error. I have submitted it using the BugTracker link on the GotDotNet.com web page; however, I'm unclear if that is how we are now posting defects. How are we notifying the team of apparent errors in IronPython? Thanks! -- Lawrence Allan Jones Senior Developer / Technical Advisor Aspen Technology, Inc. 2500 CityWest Blvd. Suite 1500 Houston, Texas 77042 USA 281-504-3324 (work) 281-504-3395 (fax) larry.jones at aspentech.com www.aspentech.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: email_2_03.gif Type: image/gif Size: 2078 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: email_2_04.gif Type: image/gif Size: 200 bytes Desc: not available URL: From Martin.Maly at microsoft.com Fri Jan 20 18:44:26 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 20 Jan 2006 09:44:26 -0800 Subject: [IronPython] Procedure for Posting Bugs In-Reply-To: <781C4D11561D1A4FA1D631415302FB83096F3B3C@houmail1.corp.aspentech.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501127DA2@df-foxhound-msg.exchange.corp.microsoft.com> Posting the bug on GotDotNet into the bug tracker is a great way to let us know. We monitor the bug tracker continuously for new issues. Another, equally valid, way is to send an email to this discussion alias. That way, the community will also become aware of the problem and we can follow-through discussing workarounds. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jones, Larry Sent: Friday, January 20, 2006 9:38 AM To: 'users at lists.ironpython.com' Subject: [IronPython] Procedure for Posting Bugs Today, while using IronPython to execute unit tests, I discovered what may be an error. I have submitted it using the BugTracker link on the GotDotNet.com web page; however, I'm unclear if that is how we are now posting defects. How are we notifying the team of apparent errors in IronPython? Thanks! -- Lawrence Allan Jones Senior Developer / Technical Advisor Aspen Technology, Inc. 2500 CityWest Blvd. Suite 1500 Houston, Texas 77042 USA 281-504-3324 (work) 281-504-3395 (fax) larry.jones at aspentech.com www.aspentech.com <@> <@> -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Fri Jan 20 19:47:57 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Fri, 20 Jan 2006 13:47:57 -0500 Subject: [IronPython] Procedure for Posting Bugs In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F501127DA2@df-foxhound-msg.e xchange.corp.microsoft.com> References: <781C4D11561D1A4FA1D631415302FB83096F3B3C@houmail1.corp.aspentech.com> Message-ID: <4.3.2.7.2.20060120134551.05a3bea8@mail.comcast.net> As someone who reads this group but doesn't look at the GDN bug tracker, I'd prefer if bug reports were posted here. Others might have already found a workaround, or have a suggestion for one; whether others clamor for a fix might influence what gets done. At 12:44 PM 1/20/2006, Martin Maly wrote >Posting the bug on GotDotNet into the bug tracker is a great way to let us know. We monitor the bug tracker continuously for new issues. Another, equally valid, way is to send an email to this discussion alias. That way, the community will also become aware of the problem and we can follow-through discussing workarounds. > >Martin > >---------- >From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jones, Larry >Sent: Friday, January 20, 2006 9:38 AM >Subject: [IronPython] Procedure for Posting Bugs > >Today, while using IronPython to execute unit tests, I discovered what may be an error. > >I have submitted it using the BugTracker link on the GotDotNet.com web page; however, I'm unclear if that is how we are now posting defects. > >How are we notifying the team of apparent errors in IronPython? > >Thanks! >-- >Lawrence Allan Jones >Senior Developer / Technical Advisor >Aspen Technology, Inc. J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From Larry.Jones at aspentech.com Fri Jan 20 20:35:47 2006 From: Larry.Jones at aspentech.com (Jones, Larry) Date: Fri, 20 Jan 2006 14:35:47 -0500 Subject: [IronPython] Procedure for Posting Bugs Message-ID: <781C4D11561D1A4FA1D631415302FB83096F3B40@houmail1.corp.aspentech.com> This morning, I discovered that importing the unittest module from the Python 2.4 libraries results in unexpected behavior. My test code is: import unittest class MyTest(unittest.TestCase): def testFirst(self): self.failUnless(True) def testSecond(self): self.failIf(False) if __name__ == '__main__': unittest.main() The result of executing this script from the command line via the IronPythonConsole is: $ /usr/local/bin/ironpython/IronPythonConsole.exe unittesterror.py Traceback (most recent call last): File c:\usr\home\jonesl\Employee\Current\ProductDir\ResearchAndDevelopment\als_se curity\proto_azn\unittesterror.py, line 14, i n Initialize File , line 0, in __init__$f78 File c:\Python24\Lib\unittest.py, line 758, in __init__$f78 File c:\Python24\Lib\unittest.py, line 787, in parseArgs$f80 File c:\Python24\Lib\unittest.py, line 507, in loadTestsFromModule$f55 File c:\Python24\Lib\unittest.py, line 495, in loadTestsFromTestCase$f54 File c:\Python24\Lib\unittest.py, line 570, in getTestCaseNames$f58 File , line 0, in Sort File , line 0, in QuickSort File , line 0, in GetPivotValue Traceback (most recent call last): File , line 0, in GetPivotValue Exception: Failed to compare two elements in the array. The result of executing this same script from Python is: $ python unittesterror.py .. ---------------------------------------------------------------------- Ran 2 tests in 0.016s OK After posting the bug, I discovered that by directly invoking the TextTestRunner directly instead of calling unittest.main(), IronPython executes the tests correctly. Thanks! -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Friday, January 20, 2006 11:44 AM To: Discussion of IronPython Subject: Re: [IronPython] Procedure for Posting Bugs Posting the bug on GotDotNet into the bug tracker is a great way to let us know. We monitor the bug tracker continuously for new issues. Another, equally valid, way is to send an email to this discussion alias. That way, the community will also become aware of the problem and we can follow-through discussing workarounds. Martin _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jones, Larry Sent: Friday, January 20, 2006 9:38 AM To: 'users at lists.ironpython.com' Subject: [IronPython] Procedure for Posting Bugs Today, while using IronPython to execute unit tests, I discovered what may be an error. I have submitted it using the BugTracker link on the GotDotNet.com web page; however, I'm unclear if that is how we are now posting defects. How are we notifying the team of apparent errors in IronPython? Thanks! -- Lawrence Allan Jones Senior Developer / Technical Advisor Aspen Technology, Inc. 2500 CityWest Blvd. Suite 1500 Houston, Texas 77042 USA 281-504-3324 (work) 281-504-3395 (fax) larry.jones at aspentech.com www.aspentech.com This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email, and any attachments thereto, is strictly prohibited. If you receive this email in error please immediately notify the sender and permanently delete the original copy and any copy of any e-mail, and any printout thereof. -------------- next part -------------- An HTML attachment was scrubbed... URL: From DevinG at 3sharp.com Fri Jan 20 23:08:11 2006 From: DevinG at 3sharp.com (Devin Ganger) Date: Fri, 20 Jan 2006 14:08:11 -0800 Subject: [IronPython] Procedure for Posting Bugs Message-ID: <190178C01A8E02418A6CA9FB57AF3DD5542920@RED-EXCH01.redmond.3sharp.com> Is there any way to have the bug tracker automatically post new bug reports here with a [BUG] tag in the subject (for filtering) -- that way folks can DTRT by posting to the bug tracker, but those who want to see the reports get them in their mailbox? -- Devin L. Ganger Email: deving at 3sharp.com 3Sharp LLC Phone: 425.882.1032 x 109 15311 NE 90th Street Cell: 425.239.2575 Redmond, WA 98052 Fax: 425.702.8455 (e)Mail Insecurity: http://blogs.3sharp.com/blog/deving/ ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Friday, January 20, 2006 10:48 AM To: Discussion of IronPython Subject: Re: [IronPython] Procedure for Posting Bugs As someone who reads this group but doesn't look at the GDN bug tracker, I'd prefer if bug reports were posted here. Others might have already found a workaround, or have a suggestion for one; whether others clamor for a fix might influence what gets done. At 12:44 PM 1/20/2006, Martin Maly wrote Posting the bug on GotDotNet into the bug tracker is a great way to let us know. We monitor the bug tracker continuously for new issues. Another, equally valid, way is to send an email to this discussion alias. That way, the community will also become aware of the problem and we can follow-through discussing workarounds. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jones, Larry Sent: Friday, January 20, 2006 9:38 AM Subject: [IronPython] Procedure for Posting Bugs Today, while using IronPython to execute unit tests, I discovered what may be an error. I have submitted it using the BugTracker link on the GotDotNet.com web page; however, I'm unclear if that is how we are now posting defects. How are we notifying the team of apparent errors in IronPython? Thanks! -- Lawrence Allan Jones Senior Developer / Technical Advisor Aspen Technology, Inc. J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From miuler at gmail.com Sat Jan 21 00:17:27 2006 From: miuler at gmail.com (Hector Miuler Malpica Gallegos) Date: Fri, 20 Jan 2006 18:17:27 -0500 Subject: [IronPython] import __main__ (ImportError:) In-Reply-To: <1137436187.8844.8.camel@localhost.localdomain> References: <1137436187.8844.8.camel@localhost.localdomain> Message-ID: Hello friends, proving the compatibility of python with IronPython I have these errors, will be corrected in a future? ==================================================== $ ipython In [1]: class miuler: ...: def __init__(self): ...: print self ...: print type(self) ...: In [2]: jojo = miuler() <__main__.miuler instance at 0xb7b2b4ec> In [3]: ==================================================== ==================================================== $ IronPythonConsole.exe IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> class miuler: ... def __init__(self): ... print self ... print type(self) Traceback (most recent call last): SyntaxError: invalid syntax at :3 >>> class miuler: ... def __init__(self): ... print self ... print type(self) ... >>> jojo = miuler() ?<__main__.miuler instance at 0x000000000000002B> Traceback (most recent call last): File , line 0, in __init__ Exception: Object reference not set to an instance of an object >>> ==================================================== 2006/1/16, Hector Miuler Malpica Gallegos : > > Hello friends, I have problems when trying to execute script I throw in > python: > > miuler at miuler:/usr/lib/python2.4$ python > Python 2.4.2 (#2, Nov 20 2005, 17:04:48) > [GCC 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> __name__ > '__main__' > >>> import __main__ > >>> type (__main__) > > >>> > > > miuler at miuler:~$ IronPythonConsole.exe > IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> __name__ > '__main__' > >>> import __main__ > Traceback (most recent call last): > ImportError: No module named __main__ > >>> __name__ > '__main__' > >>> type (__main__) > Traceback (most recent call last): > NameError: name '__main__' is not defined > >>> > > > PS IPython also has east error. -- _\|/_ (O-O) --oOO-(_)-OOo---------------------------------------- Hector Miuler Malpica Gallegos Universidad Nacional del Callao - Peru Escuela de Ingenieria Electronica usuario registrado #308608 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Larry.Jones at aspentech.com Tue Jan 24 16:35:09 2006 From: Larry.Jones at aspentech.com (Jones, Larry) Date: Tue, 24 Jan 2006 09:35:09 -0600 Subject: [IronPython] Unit Test Failures Do Not Include String Arguments Passed to Test s Message-ID: <781C4D11561D1A4FA1D631415302FB83096F3B4E@houmail1.corp.aspentech.com> The following script import unittest class MyTest(unittest.TestCase): def testFirst(self): self.failUnless(False, 'first') def testSecond(self): self.failIf(False, 'second') def suite(): theSuite = unittest.makeSuite(MyTest, 'test') return theSuite; if __name__ == '__main__': unittest.TextTestRunner().run(suite()) produces the following output in Python 2.4 $ python unittesterror.py F. ====================================================================== FAIL: testFirst (__main__.MyTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "unittesterror.py", line 7, in testFirst self.failUnless(False, 'first') AssertionError: first ---------------------------------------------------------------------- Ran 2 tests in 0.000s FAILED (failures=1) (In particular, it contains the text 'first' supported to the assertion.) Executing under IronPython, the output is: $ /usr/local/bin/ironpython/IronPythonConsole.exe unittesterror.py F. ====================================================================== FAIL: testFirst (__main__.MyTest) ---------------------------------------------------------------------- : IronPython.Runtime.PythonAssertionError: AssertionError at IronPython.Runtime.Ops.Raise(Object type, Object value, Object traceback) at unittest.failUnless$f32(Object self, Object expr, Object msg) in c:\Python24\Lib\unittest.py:line 309 at IronPython.Runtime.Function3.Call(Object arg0, Object arg1, Object arg2) at IronPython.Runtime.Ops.Call(Object func, Object arg0, Object arg1, Object arg2) at IronPython.Runtime.Method.Call(Object arg0, Object arg1) at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object func, Object arg0, Object arg1) at __main__.testFirst$f0(Object self) in c:\usr\home\jonesl\Employee\Current\ProductDir\ResearchAndDevelopment\als_se curity\p roto_azn\unittesterror.py:line 7 at IronPython.Runtime.Function1.Call(Object arg0) at IronPython.Runtime.Ops.Call(Object func, Object arg0) at IronPython.Runtime.Method.Call() at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object func) at unittest.run$f26(Object self, Object result) in c:\Python24\Lib\unittest.py:line 260 ---------------------------------------------------------------------- Ran 2 tests in 0.172s FAILED (failures=1) In particular, the string argument is not present in the output. I have submitted this behavior as a bug. -- Lawrence Allan Jones Senior Developer / Technical Advisor Aspen Technology, Inc. 2500 CityWest Blvd. Suite 1500 Houston, Texas 77042 USA 281-504-3324 (work) 281-504-3395 (fax) larry.jones at aspentech.com www.aspentech.com This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email, and any attachments thereto, is strictly prohibited. If you receive this email in error please immediately notify the sender and permanently delete the original copy and any copy of any e-mail, and any printout thereof. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: email_2_03.gif Type: image/gif Size: 2078 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: email_2_04.gif Type: image/gif Size: 200 bytes Desc: not available URL: From paparipote at hotmail.com Tue Jan 24 19:27:40 2006 From: paparipote at hotmail.com (Paparipote .) Date: Tue, 24 Jan 2006 14:27:40 -0400 Subject: [IronPython] Asterix in formatting printing Message-ID: Hello: In CPython I have the next result: >>>print "%0*d" % (6, 23) 000023 In IP I have the next: >>>print "%0*d" % (6, 23) Traceback (most recent call last): File , line 0, in input##52 NotImplementedError: * for precision >>> Or in CPyhton: >>>print '"%0*s", "%-*s"' % (5, "Hola", 10, "Iron") " Hola", "Iron " >>> in IP: >>>print '"%0*s", "%-*s"' % (5, "Hola", 10, "Iron") Traceback (most recent call last): File , line 0, in input##54 NotImplementedError: * for precision >>> Best regards, _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From paparipote at hotmail.com Tue Jan 24 19:31:04 2006 From: paparipote at hotmail.com (Paparipote .) Date: Tue, 24 Jan 2006 14:31:04 -0400 Subject: [IronPython] Asterix in formatting printing Message-ID: Hello: In CPython I have the next result: >>>print "%0*d" % (6, 23) 000023 In IP I have the next: >>>print "%0*d" % (6, 23) Traceback (most recent call last): File , line 0, in input##52 NotImplementedError: * for precision >>> Or in CPyhton: >>>print '"%0*s", "%-*s"' % (5, "Hola", 10, "Iron") " Hola", "Iron " >>> in IP: >>>print '"%0*s", "%-*s"' % (5, "Hola", 10, "Iron") Traceback (most recent call last): File , line 0, in input##54 NotImplementedError: * for precision >>> Best regards, _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From dinov at exchange.microsoft.com Tue Jan 24 20:10:48 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 24 Jan 2006 11:10:48 -0800 Subject: [IronPython] Asterix in formatting printing In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E0136EE5E@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the bug report - we actually have this fixed for our next release (we've filled in the wholes for all of string formatting and we now pass all the CPython string formatting tests). Hopefully you'll see the new release real soon! -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote . Sent: Tuesday, January 24, 2006 10:28 AM To: users at lists.ironpython.com Subject: [IronPython] Asterix in formatting printing Hello: In CPython I have the next result: >>>print "%0*d" % (6, 23) 000023 In IP I have the next: >>>print "%0*d" % (6, 23) Traceback (most recent call last): File , line 0, in input##52 NotImplementedError: * for precision >>> Or in CPyhton: >>>print '"%0*s", "%-*s"' % (5, "Hola", 10, "Iron") " Hola", "Iron " >>> in IP: >>>print '"%0*s", "%-*s"' % (5, "Hola", 10, "Iron") Traceback (most recent call last): File , line 0, in input##54 NotImplementedError: * for precision >>> Best regards, _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From paparipote at hotmail.com Tue Jan 24 21:22:33 2006 From: paparipote at hotmail.com (Paparipote .) Date: Tue, 24 Jan 2006 16:22:33 -0400 Subject: [IronPython] Spanish characters with accents do not see correctly Message-ID: I have the next text file named ?ent? with the next 3 lines: HierroPit?n --> ???????????! <-- Adi?s. I execute the next script in IP >>>e=open("c:/ent", "r") >>>for i in e.readlines(): ... print i ... HierroPit?n --> ???????????! <-- Adi?s. >>>e.close() I hope you see the problem produced. Some common letters in the spanish language the ones with accent were replaced by another characters. May be unicode is the cause. To avoid this issue in C#, I use System.Text.Encoding.Default i.e.: r=new StreamReader(@"C:\ent", System.Text.Encoding.Default); or w=new StreamWriter(@"C:\ent", False, System.Text.Encoding.Default); Depending if I read and/or write data How can I solve this in IP? Best regards _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ From dinov at exchange.microsoft.com Tue Jan 24 22:39:29 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 24 Jan 2006 13:39:29 -0800 Subject: [IronPython] Spanish characters with accents do not see correctly In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E0136F078@df-foxhound-msg.exchange.corp.microsoft.com> The problem here is that Python's default encoding is ASCII. You can set the default encoding in the sys class by using the setdefaultencoding API: import sys sys.setdefaultencoding('utf8') and all file I/O will then use that encoding. The preferred way to do this is to update your site.py file to make this call. After this setdefaultencoding is removed from the sys module. To get it back you need to reload the sys module (something that Beta 1 doesn't support unfortunately). Also if your file has the UTF headers then we'll automatically recognize those and open the file in the correct format. So if you use Notepad to store the file and do a Save As and choose one of the Unicode encodings then we should be able to properly read the file w/o changing the default encoding. Hope that helps! -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote . Sent: Tuesday, January 24, 2006 12:23 PM To: users at lists.ironpython.com Subject: [IronPython] Spanish characters with accents do not see correctly I have the next text file named ?ent? with the next 3 lines: HierroPit?n --> ???????????! <-- Adi?s. I execute the next script in IP >>>e=open("c:/ent", "r") >>>for i in e.readlines(): ... print i ... HierroPit?n --> ???????????! <-- Adi?s. >>>e.close() I hope you see the problem produced. Some common letters in the spanish language the ones with accent were replaced by another characters. May be unicode is the cause. To avoid this issue in C#, I use System.Text.Encoding.Default i.e.: r=new StreamReader(@"C:\ent", System.Text.Encoding.Default); or w=new StreamWriter(@"C:\ent", False, System.Text.Encoding.Default); Depending if I read and/or write data How can I solve this in IP? Best regards _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Jan 24 22:43:21 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 24 Jan 2006 13:43:21 -0800 Subject: [IronPython] Unit Test Failures Do Not Include String Arguments Passed to Test s In-Reply-To: <781C4D11561D1A4FA1D631415302FB83096F3B4E@houmail1.corp.aspentech.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0136F087@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the bug report. This is something that may be rather difficult to fix so I don't know that we'll get to it anytime too soon but it's good to track these little differences. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jones, Larry Sent: Tuesday, January 24, 2006 7:35 AM To: 'users at lists.ironpython.com' Subject: [IronPython] Unit Test Failures Do Not Include String Arguments Passed to Test s The following script import unittest class MyTest(unittest.TestCase): def testFirst(self): self.failUnless(False, 'first') def testSecond(self): self.failIf(False, 'second') def suite(): theSuite = unittest.makeSuite(MyTest, 'test') return theSuite; if __name__ == '__main__': unittest.TextTestRunner().run(suite()) produces the following output in Python 2.4 $ python unittesterror.py F. ====================================================================== FAIL: testFirst (__main__.MyTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "unittesterror.py", line 7, in testFirst self.failUnless(False, 'first') AssertionError: first ---------------------------------------------------------------------- Ran 2 tests in 0.000s FAILED (failures=1) (In particular, it contains the text 'first' supported to the assertion.) Executing under IronPython, the output is: $ /usr/local/bin/ironpython/IronPythonConsole.exe unittesterror.py F. ====================================================================== FAIL: testFirst (__main__.MyTest) ---------------------------------------------------------------------- : IronPython.Runtime.PythonAssertionError: AssertionError at IronPython.Runtime.Ops.Raise(Object type, Object value, Object traceback) at unittest.failUnless$f32(Object self, Object expr, Object msg) in c:\Python24\Lib\unittest.py:line 309 at IronPython.Runtime.Function3.Call(Object arg0, Object arg1, Object arg2) at IronPython.Runtime.Ops.Call(Object func, Object arg0, Object arg1, Object arg2) at IronPython.Runtime.Method.Call(Object arg0, Object arg1) at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object func, Object arg0, Object arg1) at __main__.testFirst$f0(Object self) in c:\usr\home\jonesl\Employee\Current\ProductDir\ResearchAndDevelopment\als_security\p roto_azn\unittesterror.py:line 7 at IronPython.Runtime.Function1.Call(Object arg0) at IronPython.Runtime.Ops.Call(Object func, Object arg0) at IronPython.Runtime.Method.Call() at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object func) at unittest.run$f26(Object self, Object result) in c:\Python24\Lib\unittest.py:line 260 ---------------------------------------------------------------------- Ran 2 tests in 0.172s FAILED (failures=1) In particular, the string argument is not present in the output. I have submitted this behavior as a bug. -- Lawrence Allan Jones Senior Developer / Technical Advisor Aspen Technology, Inc. 2500 CityWest Blvd. Suite 1500 Houston, Texas 77042 USA 281-504-3324 (work) 281-504-3395 (fax) larry.jones at aspentech.com www.aspentech.com This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email, and any attachments thereto, is strictly prohibited. If you receive this email in error please immediately notify the sender and permanently delete the original copy and any copy of any e-mail, and any printout thereof. From Larry.Jones at aspentech.com Tue Jan 24 22:49:47 2006 From: Larry.Jones at aspentech.com (Jones, Larry) Date: Tue, 24 Jan 2006 16:49:47 -0500 Subject: [IronPython] Unit Test Failures Do Not Include String Argumen ts Passed to Test s Message-ID: <781C4D11561D1A4FA1D631415302FB83096F3B52@houmail1.corp.aspentech.com> Thanks for all your hard work. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Tuesday, January 24, 2006 3:43 PM To: Discussion of IronPython Subject: Re: [IronPython] Unit Test Failures Do Not Include String Arguments Passed to Test s Thanks for the bug report. This is something that may be rather difficult to fix so I don't know that we'll get to it anytime too soon but it's good to track these little differences. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jones, Larry Sent: Tuesday, January 24, 2006 7:35 AM To: 'users at lists.ironpython.com' Subject: [IronPython] Unit Test Failures Do Not Include String Arguments Passed to Test s The following script import unittest class MyTest(unittest.TestCase): def testFirst(self): self.failUnless(False, 'first') def testSecond(self): self.failIf(False, 'second') def suite(): theSuite = unittest.makeSuite(MyTest, 'test') return theSuite; if __name__ == '__main__': unittest.TextTestRunner().run(suite()) produces the following output in Python 2.4 $ python unittesterror.py F. ====================================================================== FAIL: testFirst (__main__.MyTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "unittesterror.py", line 7, in testFirst self.failUnless(False, 'first') AssertionError: first ---------------------------------------------------------------------- Ran 2 tests in 0.000s FAILED (failures=1) (In particular, it contains the text 'first' supported to the assertion.) Executing under IronPython, the output is: $ /usr/local/bin/ironpython/IronPythonConsole.exe unittesterror.py F. ====================================================================== FAIL: testFirst (__main__.MyTest) ---------------------------------------------------------------------- : IronPython.Runtime.PythonAssertionError: AssertionError at IronPython.Runtime.Ops.Raise(Object type, Object value, Object traceback) at unittest.failUnless$f32(Object self, Object expr, Object msg) in c:\Python24\Lib\unittest.py:line 309 at IronPython.Runtime.Function3.Call(Object arg0, Object arg1, Object arg2) at IronPython.Runtime.Ops.Call(Object func, Object arg0, Object arg1, Object arg2) at IronPython.Runtime.Method.Call(Object arg0, Object arg1) at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object func, Object arg0, Object arg1) at __main__.testFirst$f0(Object self) in c:\usr\home\jonesl\Employee\Current\ProductDir\ResearchAndDevelopment\als_se curity\p roto_azn\unittesterror.py:line 7 at IronPython.Runtime.Function1.Call(Object arg0) at IronPython.Runtime.Ops.Call(Object func, Object arg0) at IronPython.Runtime.Method.Call() at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object func) at unittest.run$f26(Object self, Object result) in c:\Python24\Lib\unittest.py:line 260 ---------------------------------------------------------------------- Ran 2 tests in 0.172s FAILED (failures=1) In particular, the string argument is not present in the output. I have submitted this behavior as a bug. -- Lawrence Allan Jones Senior Developer / Technical Advisor Aspen Technology, Inc. 2500 CityWest Blvd. Suite 1500 Houston, Texas 77042 USA 281-504-3324 (work) 281-504-3395 (fax) larry.jones at aspentech.com www.aspentech.com This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email, and any attachments thereto, is strictly prohibited. If you receive this email in error please immediately notify the sender and permanently delete the original copy and any copy of any e-mail, and any printout thereof. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From paparipote at hotmail.com Wed Jan 25 03:09:43 2006 From: paparipote at hotmail.com (Paparipote .) Date: Tue, 24 Jan 2006 22:09:43 -0400 Subject: [IronPython] Spanish characters with accents do not see correctly Message-ID: Dino: Many thanks again, it worked putting UTF headers. However, sometimes I will receive ascii data from other systems, online; or somebody will send me an ascii file to process. I need to read those "outputs" in a transparent way. May be I did not understand well your explanation but, are you planning to do something about this matter or should we find the answer in the .NET Framework libraries? Best regards. _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From dinov at exchange.microsoft.com Wed Jan 25 17:39:43 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 25 Jan 2006 08:39:43 -0800 Subject: [IronPython] Spanish characters with accents do not see correctly In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E01402E7E@df-foxhound-msg.exchange.corp.microsoft.com> The correct answer for this is to use the codecs module (or the _codecs built-in module). Unfortunately we don't have that implemented yet so for the time being you will have to use the .NET Framework (System.Text.Encoding should do the trick). I'll add codecs to our list for beta 3 - unfortunately it's just too big of a work item to get done for beta 2. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote . Sent: Tuesday, January 24, 2006 6:10 PM To: users at lists.ironpython.com Subject: [IronPython] Spanish characters with accents do not see correctly Dino: Many thanks again, it worked putting UTF headers. However, sometimes I will receive ascii data from other systems, online; or somebody will send me an ascii file to process. I need to read those "outputs" in a transparent way. May be I did not understand well your explanation but, are you planning to do something about this matter or should we find the answer in the .NET Framework libraries? Best regards. _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From catherine.devlin at gmail.com Wed Jan 25 20:04:08 2006 From: catherine.devlin at gmail.com (Catherine Devlin) Date: Wed, 25 Jan 2006 14:04:08 -0500 Subject: [IronPython] Fwd: Where to share a script / executables (again) In-Reply-To: <6523e39a0601250736g64adcceex9980452903377c2b@mail.gmail.com> References: <6523e39a0601250736g64adcceex9980452903377c2b@mail.gmail.com> Message-ID: <6523e39a0601251104o6da7ae12ibd3d421e864e362b@mail.gmail.com> Hi! I've just created my first IronPython script - a little utility for conveniently cleaning the garbage out of your PATH and related environment variables. I posted it in my blog at http://catherinedevlin.blogspot.com/2006/01/cleanpathpy-ironpython-utility.html Anyway, I'd like to share it somewhere publicly, but I really don't know where a little item like this should go. It's too long to be trivial, but at 119 lines, but too small (119 lines) to be considered a "project" for SourceForge or whatnot. And do we have a special place for sharing IronPython scripts? I don't see any IronPython projects at SourceForge... is there a reason for that? Can anyone suggest a good place to share scripts like this? Also, for the sake of the unwashed masses without IronPython, I'd like to generate an executable .exe. I can't find instructions on how to do that, though. Running my script with ironpythonconsole automatically generates an .exe, but running that just gives "... is not a valid Win32 application." (Greg Chapman asked about this on Jan. 5, too, but I didn't see him getting an answer.) Is there any more information on generating free-standing executables? Thanks very much! -- - Catherine http://catherinedevlin.blogspot.com/ From catherine.devlin at gmail.com Wed Jan 25 20:13:42 2006 From: catherine.devlin at gmail.com (Catherine Devlin) Date: Wed, 25 Jan 2006 14:13:42 -0500 Subject: [IronPython] Fwd: Where to share a script / executables (again) In-Reply-To: <6523e39a0601250736g64adcceex9980452903377c2b@mail.gmail.com> References: <6523e39a0601250736g64adcceex9980452903377c2b@mail.gmail.com> Message-ID: <6523e39a0601251113o357aa9f0m3c3fed477107cb22@mail.gmail.com> Hi! I've just created my first IronPython script - a little utility for conveniently cleaning the garbage out of your PATH and related environment variables. I posted it in my blog at http://catherinedevlin.blogspot.com/2006/01/cleanpathpy-ironpython-utility.html Anyway, I'd like to share it somewhere publicly, but I really don't know where a little item like this should go. It's too long to be trivial, but at 119 lines, but too small (119 lines) to be considered a "project" for SourceForge or whatnot. And do we have a special place for sharing IronPython scripts? I don't see any IronPython projects at SourceForge... is there a story behind that? Can anyone suggest a good place to share scripts like this? Also, for the sake of the unwashed masses without IronPython, I'd like to generate an executable .exe. I can't find instructions on how to do that, though. Running my script with ironpythonconsole automatically generates an .exe, but running that just gives "... is not a valid Win32 application." (Greg Chapman asked about this on Jan. 5, too, but I didn't see him getting an answer.) Is there any more information on generating free-standing executables? Thanks very much! -- - Catherine http://catherinedevlin.blogspot.com/ From dinov at exchange.microsoft.com Wed Jan 25 20:35:07 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 25 Jan 2006 11:35:07 -0800 Subject: [IronPython] Fwd: Where to share a script / executables (again) In-Reply-To: <6523e39a0601251113o357aa9f0m3c3fed477107cb22@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01403093@df-foxhound-msg.exchange.corp.microsoft.com> I don't have an immediate answer for you on sharing scripts but our next beta release (due real, real soon now) will support running the generated EXEs. If your test imports any modules written in Python you'll still need to have those around and on your sys.path, but otherwise this will work. Also, IronPython does also include a compiler that can generate a set of scripts into a single stand alone EXE, but at this time we haven't exposed this functionality via the command line yet (and therefore you'd need to write your own front end for it). You can of course access this functionality from Python code with: from IronPython.Hosting import PythonCompiler which is how we currently test it. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Catherine Devlin Sent: Wednesday, January 25, 2006 11:14 AM To: users at lists.ironpython.com Subject: [IronPython] Fwd: Where to share a script / executables (again) Hi! I've just created my first IronPython script - a little utility for conveniently cleaning the garbage out of your PATH and related environment variables. I posted it in my blog at http://catherinedevlin.blogspot.com/2006/01/cleanpathpy-ironpython-utility.html Anyway, I'd like to share it somewhere publicly, but I really don't know where a little item like this should go. It's too long to be trivial, but at 119 lines, but too small (119 lines) to be considered a "project" for SourceForge or whatnot. And do we have a special place for sharing IronPython scripts? I don't see any IronPython projects at SourceForge... is there a story behind that? Can anyone suggest a good place to share scripts like this? Also, for the sake of the unwashed masses without IronPython, I'd like to generate an executable .exe. I can't find instructions on how to do that, though. Running my script with ironpythonconsole automatically generates an .exe, but running that just gives "... is not a valid Win32 application." (Greg Chapman asked about this on Jan. 5, too, but I didn't see him getting an answer.) Is there any more information on generating free-standing executables? Thanks very much! -- - Catherine http://catherinedevlin.blogspot.com/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jonathansamuel at yahoo.com Sat Jan 21 01:25:38 2006 From: jonathansamuel at yahoo.com (Jonathan Mark) Date: Fri, 20 Jan 2006 16:25:38 -0800 (PST) Subject: [IronPython] IronPython 1.0 Beta Docs are wrong Message-ID: <20060121002538.99214.qmail@web32512.mail.mud.yahoo.com> I installed .NET 2.0 Beta, which is all that is available via download right now. I downloaded IronPython. Its Readme says "After unpacking the distribution of IronPyhon, you can complete the installation by adding the included 'bin' directory to your PATH." There is no 'bin' directory in IronPython 1.0 beta. The Readme continues: "To test your installation, you should launch the interactive interpreter as shown below: C:\IronPython\bin>IronPythonConsole IronPython 1.0 Beta on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> 2+2 4" However, if I run IronPythonConsole I get a blank popup that says '.NET Framework Initialization Error' What am I doing wrong? Should I not be using the .NET 2.0 Beta? This beta is the only version of .NET 2.0 that is available online. Jonathan Mark GoodbyeJim.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From Lihong_Chen at Maxtor.com Fri Jan 20 10:11:11 2006 From: Lihong_Chen at Maxtor.com (Chen, Tom Li Hong) Date: Fri, 20 Jan 2006 17:11:11 +0800 Subject: [IronPython] FW: how to debug pthon script in IronPython Message-ID: <81D58019740F4B43B2840ACD407C70FC026D88@tswexc03.corp.mxtr.net> Hey, There is a module which is not a built_in module and its name is pdb.py in CPython. Make using of this module, CPython can debug python script. It support step into and step over debug for python script. Now I want to import this module into IronPython to debug python script. I copy python24/lib folder which include many scripts to work directory of IronPython. So In IronPython I can import pdb script (module) through command: import pdb. But I can't debug python script with pdb module in IronPython. I am eager to how to debug python script in IronPython! What can I do? Please give me some advice. -------------- next part -------------- An HTML attachment was scrubbed... URL: From asimj at exchange.microsoft.com Sat Jan 21 03:23:01 2006 From: asimj at exchange.microsoft.com (Asim Jalis) Date: Fri, 20 Jan 2006 18:23:01 -0800 Subject: [IronPython] Using IronPython To Run Bat Files Message-ID: <1421F7433DA4144597E8578016CEE5EFD23A55@df-foxhound-msg.exchange.corp.microsoft.com> Hi, I want to use IronPython to replace some Perl scripts that we have that we run as bat files. It's possible to embed Perl in bat files using syntax such as this: @echo off perl.exe -w -x %~f0 %* goto :EOF #! -*- perl script start -*- print "Hello World\n"; Does IronPython support something like a -x option that automatically strips off the initial bat part of a file and then runs the rest of it as a Python script. If there is nothing like this I can roll out my own. However, the issue I have right now is that every time I run IronPythonConsole.exe on a foo.py file, it generates foo.exe and foo.pdb. Is it possible to turn off this file generation? Thanks. Asim -------------- next part -------------- An HTML attachment was scrubbed... URL: From DevinG at 3sharp.com Wed Jan 25 23:00:41 2006 From: DevinG at 3sharp.com (Devin Ganger) Date: Wed, 25 Jan 2006 14:00:41 -0800 Subject: [IronPython] IronPython 1.0 Beta Docs are wrong Message-ID: <190178C01A8E02418A6CA9FB57AF3DD55B554D@RED-EXCH01.redmond.3sharp.com> Jonathan Mark wrote: > What am I doing wrong? Should I not be using the .NET > 2.0 Beta? This beta is the only version of .NET 2.0 > that is available online. As an aside, you can still download 1.1. For more details, see: http://msdn.microsoft.com/netframework/downloads/framework1_1/ -- Devin L. Ganger Email: deving at 3sharp.com 3Sharp LLC Phone: 425.882.1032 x 109 15311 NE 90th Street Cell: 425.239.2575 Redmond, WA 98052 Fax: 425.702.8455 (e)Mail Insecurity: http://blogs.3sharp.com/blog/deving/ From Martin.Maly at microsoft.com Wed Jan 25 23:30:47 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 25 Jan 2006 14:30:47 -0800 Subject: [IronPython] FW: how to debug pthon script in IronPython In-Reply-To: <81D58019740F4B43B2840ACD407C70FC026D88@tswexc03.corp.mxtr.net> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F50128EAC9@df-foxhound-msg.exchange.corp.microsoft.com> There is overview of how to debug python scripts in IronPython in the tutorial (Tutorial 4). That should get you started. The short answer is that all you need is launch IronPythonConsole with your script as the command line parameter under debugger and put breakpoint into your script. The tutorial will go into more details. Hope this helps Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Chen, Tom Li Hong Sent: Friday, January 20, 2006 1:11 AM To: users at lists.ironpython.com; Ma, Wen Zhao Subject: [IronPython] FW: how to debug pthon script in IronPython Hey, There is a module which is not a built_in module and its name is pdb.py in CPython. Make using of this module, CPython can debug python script. It support step into and step over debug for python script. Now I want to import this module into IronPython to debug python script. I copy python24/lib folder which include many scripts to work directory of IronPython. So In IronPython I can import pdb script (module) through command: import pdb. But I can't debug python script with pdb module in IronPython. I am eager to how to debug python script in IronPython! What can I do? Please give me some advice. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Wed Jan 25 23:36:35 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 25 Jan 2006 14:36:35 -0800 Subject: [IronPython] Using IronPython To Run Bat Files In-Reply-To: <1421F7433DA4144597E8578016CEE5EFD23A55@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F50128EAD8@df-foxhound-msg.exchange.corp.microsoft.com> IronPython doesn't support the 'embedding in the bat files' option that you described. IronPython generates the files for debugging purposes, given that we are still in Beta. However as we approach final release, this will change. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Asim Jalis Sent: Friday, January 20, 2006 6:23 PM To: users at lists.ironpython.com Subject: [IronPython] Using IronPython To Run Bat Files Hi, I want to use IronPython to replace some Perl scripts that we have that we run as bat files. It's possible to embed Perl in bat files using syntax such as this: @echo off perl.exe -w -x %~f0 %* goto :EOF #! -*- perl script start -*- print "Hello World\n"; Does IronPython support something like a -x option that automatically strips off the initial bat part of a file and then runs the rest of it as a Python script. If there is nothing like this I can roll out my own. However, the issue I have right now is that every time I run IronPythonConsole.exe on a foo.py file, it generates foo.exe and foo.pdb. Is it possible to turn off this file generation? Thanks. Asim -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Wed Jan 25 23:28:13 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 25 Jan 2006 14:28:13 -0800 Subject: [IronPython] IronPython 1.0 Beta Docs are wrong In-Reply-To: <20060121002538.99214.qmail@web32512.mail.mud.yahoo.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F50128EAC3@df-foxhound-msg.exchange.corp.microsoft.com> The .NET Framework 2.0 has been released already. You should be able to download it here: http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&DisplayLang=en Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jonathan Mark Sent: Friday, January 20, 2006 4:26 PM To: users at lists.ironpython.com Subject: [IronPython] IronPython 1.0 Beta Docs are wrong I installed .NET 2.0 Beta, which is all that is available via download right now. I downloaded IronPython. Its Readme says "After unpacking the distribution of IronPyhon, you can complete the installation by adding the included 'bin' directory to your PATH." There is no 'bin' directory in IronPython 1.0 beta. The Readme continues: "To test your installation, you should launch the interactive interpreter as shown below: C:\IronPython\bin>IronPythonConsole IronPython 1.0 Beta on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> 2+2 4" However, if I run IronPythonConsole I get a blank popup that says '.NET Framework Initialization Error' What am I doing wrong? Should I not be using the .NET 2.0 Beta? This beta is the only version of .NET 2.0 that is available online. Jonathan Mark GoodbyeJim.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From rayfd_2000 at yahoo.com Thu Jan 26 03:23:38 2006 From: rayfd_2000 at yahoo.com (Ray Djajadinata) Date: Wed, 25 Jan 2006 18:23:38 -0800 (PST) Subject: [IronPython] users Digest, Vol 18, Issue 44 In-Reply-To: Message-ID: <20060126022338.61058.qmail@web36806.mail.mud.yahoo.com> Eh? .NET Framework 2.0 has been released for some time. Check this out: http://www.microsoft.com/downloads/details.aspx?FamilyID=fe6f2099-b7b4-4f47-a244-c96d69c35dec&DisplayLang=en http://msdn.microsoft.com/netframework/downloads/updates/default.aspx HTH, Ray From: Jonathan Mark Date: Fri, 20 Jan 2006 16:25:38 -0800 (PST) Subject: [IronPython] IronPython 1.0 Beta Docs are wrong What am I doing wrong? Should I not be using the .NET 2.0 Beta? This beta is the only version of .NET 2.0 that is available online. Jonathan Mark GoodbyeJim.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Thu Jan 26 01:17:44 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 25 Jan 2006 16:17:44 -0800 Subject: [IronPython] IronPython 1.0 Beta 2 Released Message-ID: <5C0A6F919D675745BB1DBA7412DB68F50128EBD4@df-foxhound-msg.exchange.corp.microsoft.com> Hello IronPython Community, We have just released IronPython 1.0 Beta 2. The focus of this release was fixing bugs that you found and reported (big thanks!), cleanup and re-factoring of the code base and we also made significant progress towards cleaning up FxCop warnings. You can download the release from: http://www.microsoft.com/downloads/details.aspx?FamilyId=910F423F-BBD2-4E52-BAB6-AA21592EDC3B&displaylang=en We responded to the major bugs you discovered with the interactive console in the beta 1 release by dramatically improving our test coverage for this scenario. We now run our test suite both in a normal mode and in a mode that simulates the interactive console. This should prevent future regressions that only appear at the console. Finally we also continue to improve compatibility with CPython. IronPython now passes all of test_types, test_format, and test_time in addition to the the 28 standard regressions tests that we passed without modifications in beta 1. We'd like to thank everyone in the community for your bug reports and suggestions that helped make this a better release: Brandon Furtwangler, Catalin Lungu, David Richter, Erin Renshaw, Greg Chapman, Hector Miuler Malpica Gallegos, J. Merrill, jdehooge, Jeff Griffiths, Jonathan Jacobs, Nicholas Jacobson, Oonuki Makoto, paparipote, Paul Viola, Sanghyeon Seo, Steven Drucker, Sumit Basu and Szymon Kobalczyk Thanks and keep in touch, The IronPython Team More complete list of changes and bug fixes: ============================================ FxCop cleanup ? a large amount of the code base has been made FxCop clean, a large amount of work still remains Improved internal API surface by making more things private that should be Perf Improvments for nsieve Bug fix: pow was missing Bug fix: eval(?1, 2, 3, ?) wasn?t returning a tuple Bug fix: compile(?x = ?, ?, ?eval?) not returning syntax error Bug fix: error in site.py doesn?t get reported Generators no longer use exceptions for flow control Error reporting cleanup Bug fix: Failure to load a referenced assembly will now throw an exception % string formatting is complete & passes all Python tests Closure implementation vastly improved re module more robust to None inputs strings can now be multiplied by bools Bug fix: OldClass that defines __getattr__ now works properly SystemException now properly maps to StandardException, can now catch Python exceptions using CLR name Bug fix: type and None now both have __class__ attributes Added auto-conversions to IDictionary Bug fix: exec handles bad input better Bug fix: string formatter allows %d to be used with float values Generators now use function environments eval(expression) now raises a SyntaxError for statements All of time module implemented except day of year / week of year custom formatting Bugfix: exec x in y doesn?t work properly Bugfix: del this_name_is_undefined raises different exceptions at console vs imports Aliased reference support in clr module Bugfix: Can?t import top-level class from .NET assembly Code generator updates: Self-hosting on IronPython, generated code moved into their own files Bugfix: exec(code, dict) is broken Super console now inserts spaces when there?s no input CustomDict, Module, Environment cleanup Bugfix: Closures don?t initialize to Uninitialized Bugfix: Floating point conversions didn?t handle subclasses of float Bugfix: Comparison broken for subclasses of float New fast path for calling overloads w/ different types but same number of arguments Bugfix: For comparison via IPythonComparable, it wasn't true that a < b <==> b > a Bugfix: cannot reload sys module Compile / Execute PythonEngine now allows access to _ Bugfix: clr.References formatting improved Bugfix: No conversion from System.Collections.Generic.List`1[System.Type] to its self Bugfix: IndexError thrown when trying to subclass twice from a CLR interface Bugfix: os.path functions give wrong result on non-Windows platforms Bugfix: func_code should include the line number of Python functions Binder binds all names, including globals Bugfix: Cannot execute generated EXEs Improved property handling to match CPython Bugfix: Can?t call CLS instance method w/ keyword arguments Bugfix: __r???__ method doesn?t get called if we can?t bind to __???__ operator Bugfix: Binder binds incorrectly when global statement is in outer scope Bugfix: caller context is now flowed to eval Binder now binds all names before code gen Pre-populating locals before code gen Bugfix: changes to local variables are not affected in the locals() dictionary locals() now uses environments list.sort() is now stable and optimized to minimize comparisons re module bug fix to now clear multi-line / dotall options. Bufix: Oct and dir were missing PythonName attribute A module?s __dict__ field is now always a Python Dict (or subclass), not a CLS dict All tests now pass in Console mode Dynamic methods used more to prevent leaks Bugfix: Function f(*args) def'd in console, with two locals, raises a SystemError when accessing second local Bugfix: Defining a function g which returns a function h (defined inside the body of g) causes a null reference exception at top-level in the console Bugfix: Class defined in console shows unusual behaviour Bugfix: IronPython kills CLR Bugfix: Generators broken in the console Bugfix: Python Engine: calling multiple python methods From sanxiyn at gmail.com Thu Jan 26 11:54:48 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 26 Jan 2006 19:54:48 +0900 Subject: [IronPython] md5 for IronPython Message-ID: <5b0248170601260254o308d1878g@mail.gmail.com> md5 module is implemented as a C extension module in CPython. As this is currently not included in IronPython, I wrote a tiny wrapper around System.Security.Cryptography. Here it is in case you want it too. http://sparcs.kaist.ac.kr/~tinuviel/devel/fepy/md5.py It's under 30 lines! It should be trivial to adapt this to other hash algorithms. Seo Sanghyeon From info at geatec.com Thu Jan 26 17:09:36 2006 From: info at geatec.com (J. de Hooge) Date: Thu, 26 Jan 2006 17:09:36 +0100 Subject: [IronPython] IP 1.0 Beta 2 float to int conversion Message-ID: <000001c62292$ea2a7b20$6402a8c0@GEADELL> Hi, Thanks for the new release and all the work invested! I've just stepped up from IP 0.9.5 to IP 1.0 Beta 2, and I noticed the following: In 0.9.5 the following runs fine, where self.widget is a Forms.SplitContainer (type: Int32 property) and the r.h.s. is a float, e.g. 100.0: self.widget.SplitterDistance = self.state * self.getMaxSplitterDistance () In 1.0 Beta it will stall with the following message: No conversion from 100 to System.Int32 Stricktly taken, the IP 1.0 is correct, but I found the auto-conversion convenient. Has the conversion behaviour been tightened deliberately? Kind regards Jacques de Hooge info at geatec.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shawn.Farkas at microsoft.com Thu Jan 26 18:07:36 2006 From: Shawn.Farkas at microsoft.com (Shawn Farkas) Date: Thu, 26 Jan 2006 09:07:36 -0800 Subject: [IronPython] md5 for IronPython In-Reply-To: <5b0248170601260254o308d1878g@mail.gmail.com> Message-ID: If you wanted to easily extend it to other algorithms, then instead of using MD5.Create() in your __init__, you could instead do HashAlgorithm.Create("MD5"). That allows you to swap in any hash algorithm you'd like (and that the framework supports) just by swapping the string. -Shawn -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Thursday, January 26, 2006 2:55 AM To: users at lists.ironpython.com Subject: [IronPython] md5 for IronPython md5 module is implemented as a C extension module in CPython. As this is currently not included in IronPython, I wrote a tiny wrapper around System.Security.Cryptography. Here it is in case you want it too. http://sparcs.kaist.ac.kr/~tinuviel/devel/fepy/md5.py It's under 30 lines! It should be trivial to adapt this to other hash algorithms. Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kfarmer at thuban.org Thu Jan 26 18:37:46 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 26 Jan 2006 09:37:46 -0800 Subject: [IronPython] md5 for IronPython Message-ID: Unless I'm lacking sleep and miss something (likely), you could make an overload that took an enum, such as the pre-existing ones in the framework. ----- Keith J. Farmer // kfarmer at thuban.org -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Shawn Farkas Sent: Thursday, 26 January 2006 09:08 If you wanted to easily extend it to other algorithms, then instead of using MD5.Create() in your __init__, you could instead do HashAlgorithm.Create("MD5"). That allows you to swap in any hash algorithm you'd like (and that the framework supports) just by swapping the string. From Shawn.Farkas at microsoft.com Thu Jan 26 18:43:31 2006 From: Shawn.Farkas at microsoft.com (Shawn Farkas) Date: Thu, 26 Jan 2006 09:43:31 -0800 Subject: [IronPython] md5 for IronPython In-Reply-To: Message-ID: The reason we use a string is that it's actually a fully pluggable framework. For instance, someone in the NSA could have a top-secret hash algorithm that we didn't put into the framework. They could implement it themselves, register it in machine.config, and then do HashAlgorithm.Create("SuperSecretNSAHash") and it would work. -Shawn -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Thursday, January 26, 2006 9:38 AM To: Discussion of IronPython Subject: Re: [IronPython] md5 for IronPython Unless I'm lacking sleep and miss something (likely), you could make an overload that took an enum, such as the pre-existing ones in the framework. ----- Keith J. Farmer // kfarmer at thuban.org -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Shawn Farkas Sent: Thursday, 26 January 2006 09:08 If you wanted to easily extend it to other algorithms, then instead of using MD5.Create() in your __init__, you could instead do HashAlgorithm.Create("MD5"). That allows you to swap in any hash algorithm you'd like (and that the framework supports) just by swapping the string. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Thu Jan 26 18:54:37 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 26 Jan 2006 09:54:37 -0800 Subject: [IronPython] IP 1.0 Beta 2 float to int conversion In-Reply-To: <000001c62292$ea2a7b20$6402a8c0@GEADELL> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01403788@df-foxhound-msg.exchange.corp.microsoft.com> We have made some changes in this space but I just haven't found the change that would have affected this yet... One thing I'm curious about - is getMaxSpliiterDistance C# code or Python code? The reason I ask if I'm wondering if it's returning a float or a double (we represent Python float's w/ doubles, so if it came from a literal it'll be a double). ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. de Hooge Sent: Thursday, January 26, 2006 8:10 AM To: users at lists.ironpython.com Subject: [IronPython] IP 1.0 Beta 2 float to int conversion Hi, Thanks for the new release and all the work invested! I've just stepped up from IP 0.9.5 to IP 1.0 Beta 2, and I noticed the following: In 0.9.5 the following runs fine, where self.widget is a Forms.SplitContainer (type: Int32 property) and the r.h.s. is a float, e.g. 100.0: self.widget.SplitterDistance = self.state * self.getMaxSplitterDistance () In 1.0 Beta it will stall with the following message: No conversion from 100 to System.Int32 Stricktly taken, the IP 1.0 is correct, but I found the auto-conversion convenient. Has the conversion behaviour been tightened deliberately? Kind regards Jacques de Hooge info at geatec.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Thu Jan 26 19:53:52 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 26 Jan 2006 10:53:52 -0800 Subject: [IronPython] md5 for IronPython References: Message-ID: Which is why I suggested an overload. Enums protect against spelling mistakes that strings, while flexible, promote. With an overload you can use either, preferring the enum for the compile-time assist (and as an indication that perhaps the user wants to use the framework implementation of SHA, for example). ________________________________ From: users-bounces at lists.ironpython.com on behalf of Shawn Farkas Sent: Thu 1/26/2006 9:43 AM To: Discussion of IronPython Subject: Re: [IronPython] md5 for IronPython The reason we use a string is that it's actually a fully pluggable framework. For instance, someone in the NSA could have a top-secret hash algorithm that we didn't put into the framework. They could implement it themselves, register it in machine.config, and then do HashAlgorithm.Create("SuperSecretNSAHash") and it would work. -Shawn -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Thursday, January 26, 2006 9:38 AM To: Discussion of IronPython Subject: Re: [IronPython] md5 for IronPython Unless I'm lacking sleep and miss something (likely), you could make an overload that took an enum, such as the pre-existing ones in the framework. ----- Keith J. Farmer // kfarmer at thuban.org -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Shawn Farkas Sent: Thursday, 26 January 2006 09:08 If you wanted to easily extend it to other algorithms, then instead of using MD5.Create() in your __init__, you could instead do HashAlgorithm.Create("MD5"). That allows you to swap in any hash algorithm you'd like (and that the framework supports) just by swapping the string. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 4812 bytes Desc: not available URL: From sanxiyn at gmail.com Fri Jan 27 04:24:23 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 27 Jan 2006 12:24:23 +0900 Subject: [IronPython] IronPython 1.0 Beta 2 on Mono Message-ID: <5b0248170601261924q797c1395p@mail.gmail.com> For the first time, I think, current Mono release can run this new IronPython release. Nice! I am using Mono 1.1.13.1 from Debian unstable. However, some modules that worked on Beta 1 won't work with this IronPython/Mono combination. This is not IronPython's fault. I discovered this while trying to run some unittests. >>> import unittest Missing member IsDaylightSavingTime in type DateTime, assembly /usr/lib/mono/2.0/mscorlib.dll In other words, anything importing time probably won't work right. Then it's natural to try to compile from source with workarounds. Unfortunately, Beta 2 now uses partial classes which Mono's compiler can't compile yet. This is Mono bug #77027. There's a patch on the bug, but I haven't tried it yet. As usual, the status would improve shortly. But this is how it is currently. Just to let you know. :-) Seo Sanghyeon From info at geatec.com Fri Jan 27 09:47:51 2006 From: info at geatec.com (J. de Hooge) Date: Fri, 27 Jan 2006 09:47:51 +0100 Subject: [IronPython] IP 1.0 Beta 2 float to int conversion In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01403788@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <000001c6231e$5b8e47c0$6402a8c0@GEADELL> Dino, Function getMaxSplitterDistance is a Python function, defined in two derived classes. It returns an integer. See code below. Variable state is a float between 0 and 1. But the same thing happens in the following simpler situation: If I code literally: self.widget.SplitterDistance = 100.0 It's ok on IP 0.9.5 but not on IP 1.0 Beta 2, whereas self.widget.SplitterDistance = 100 is ok on both. Jacques --- Minimum (nonsense) code for reproduction of this behaviour: from sys import * LoadAssemblyByName("System.Windows.Forms") from System.Windows import Forms splitContainer = Forms.SplitContainer () print 1 splitContainer.SplitterDistance = 100 print 2 splitContainer.SplitterDistance = 100.0 print 3 --- Output on IP 0.9.5: 1 2 3 --- Output on IP 1.0 Beta 2: 1 2 Traceback (most recent call last): File C:\activ_dell\prog\fun\src\funTry.py, line 10, in Initialize TypeError: No conversion from 100 to System.Int32 --- Original code that revealed the change: class SplitViewBase: # . Other members def createWidget (self): self.widget = Forms.SplitContainer () self.widget.Dock = Forms.DockStyle.Fill def setState (sender, arguments): self.state = (1.0 * self.widget.SplitterDistance) / self.getMaxSplitterDistance () def getStateAndAllowSetState (sender, arguments): if self.widget.Visible: if hasattr (self, 'state'): try: self.widget.SplitterDistance = int (self.state * self.getMaxSplitterDistance ()) except: pass self.widget.SplitterMoved += setState self.widget.VisibleChanged += getStateAndAllowSetState self.widget.Panel1.Controls.Add (self.childView1 .createWidget ()) self.widget.Panel2.Controls.Add (self.childView2 .createWidget ()) return self.widget class HSplitView (SplitViewBase): # . Other members def getMaxSplitterDistance (self): return self.widget.Width # . Other members class VSplitView (SplitViewBase): # . Other members def getMaxSplitterDistance (self): return self.widget.Height # . Other members -----Oorspronkelijk bericht----- Van: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Namens Dino Viehland Verzonden: Thursday, January 26, 2006 6:55 PM Aan: Discussion of IronPython Onderwerp: Re: [IronPython] IP 1.0 Beta 2 float to int conversion We have made some changes in this space but I just haven't found the change that would have affected this yet. One thing I'm curious about - is getMaxSpliiterDistance C# code or Python code? The reason I ask if I'm wondering if it's returning a float or a double (we represent Python float's w/ doubles, so if it came from a literal it'll be a double). _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. de Hooge Sent: Thursday, January 26, 2006 8:10 AM To: users at lists.ironpython.com Subject: [IronPython] IP 1.0 Beta 2 float to int conversion Hi, Thanks for the new release and all the work invested! I've just stepped up from IP 0.9.5 to IP 1.0 Beta 2, and I noticed the following: In 0.9.5 the following runs fine, where self.widget is a Forms.SplitContainer (type: Int32 property) and the r.h.s. is a float, e.g. 100.0: self.widget.SplitterDistance = self.state * self.getMaxSplitterDistance () In 1.0 Beta it will stall with the following message: No conversion from 100 to System.Int32 Stricktly taken, the IP 1.0 is correct, but I found the auto-conversion convenient. Has the conversion behaviour been tightened deliberately? Kind regards Jacques de Hooge info at geatec.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From micktwomey at gmail.com Fri Jan 27 14:14:53 2006 From: micktwomey at gmail.com (Michael Twomey) Date: Fri, 27 Jan 2006 13:14:53 +0000 Subject: [IronPython] Problems with exec Message-ID: <50a522ca0601270514x621e0ca6k@mail.gmail.com> Hi, I've started work on an ironpython implementation of the _socket module so I can use standard python sockets. I was making good progress until I hit a problem with socket.py's use of exec. In the socket._socketobject class exec is used to create wrappers for various methods in the socket class in _socket. When the code is run you get an attributeerror because the exec statement hasn't set the attributes on the class. This example demonstrates the problem: class MyRealObj(object): """The real object""" def foo(self): return "foo" class MyObj(object): """The public wrapper""" def __init__(self): self.realobj = MyRealObj() #reproducing socket.py's exec statement _s = ("def %s(self, *args): return self.realobj.%s(*args)\n\n" "%s.__doc__ = MyRealObj.%s.__doc__\n") for _m in ["foo"]: exec _s % (_m, _m, _m, _m) del _m, _s o = MyObj() print o.foo() Looking at it closer it appears that the foo method has been placed into the module instead of the class, the socket module winds up with the methods instead of the socket class. I suspect it's a case of dealing with the locals a bit differently inside a class definition. I'll have a go at fixing this but I'm still finding my way around the ironpython code (I'm up to ops.cs and statements.cs). cheers, Michael From catherine.devlin at gmail.com Fri Jan 27 17:23:48 2006 From: catherine.devlin at gmail.com (Catherine Devlin) Date: Fri, 27 Jan 2006 11:23:48 -0500 Subject: [IronPython] Fwd: Where to share a script / executables (again) In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01403093@df-foxhound-msg.exchange.corp.microsoft.com> References: <6523e39a0601251113o357aa9f0m3c3fed477107cb22@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E01403093@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <6523e39a0601270823l45f73e19sc6242c1569c42e6c@mail.gmail.com> Hi, Dino! Thank you! I got the Beta 2, remembered (after a fumble) to copy IronPython.dll into the directory with my source, ran IronPythonConsole cleanPath.py, and got a perfectly working executable. Hooray! As for where to share it, I took a look at the GotDotNet "User Samples" area. I tried to post there, but under "languages", they have no checkbox for IronPython. I submitted this as feedback to GotDotNet, and they replied that they plan to add IronPython as an option soon. Another hooray! Though, since they didn't define "soon",. I do wish I knew a place to post in the meantime. On 1/25/06, Dino Viehland wrote: > I don't have an immediate answer for you on sharing scripts but our next beta release (due real, real soon now) will support running the generated EXEs. If your test imports any modules written in Python you'll still need to have those around and on your sys.path, but otherwise this will work. -- - Catherine http://catherinedevlin.blogspot.com/ From Martin.Maly at microsoft.com Fri Jan 27 18:08:21 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 27 Jan 2006 09:08:21 -0800 Subject: [IronPython] Problems with exec In-Reply-To: <50a522ca0601270514x621e0ca6k@mail.gmail.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501337035@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the report, Michael, this is certainly something for us to look into for the next release. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Twomey Sent: Friday, January 27, 2006 5:15 AM To: users at lists.ironpython.com Subject: [IronPython] Problems with exec Hi, I've started work on an ironpython implementation of the _socket module so I can use standard python sockets. I was making good progress until I hit a problem with socket.py's use of exec. In the socket._socketobject class exec is used to create wrappers for various methods in the socket class in _socket. When the code is run you get an attributeerror because the exec statement hasn't set the attributes on the class. This example demonstrates the problem: class MyRealObj(object): """The real object""" def foo(self): return "foo" class MyObj(object): """The public wrapper""" def __init__(self): self.realobj = MyRealObj() #reproducing socket.py's exec statement _s = ("def %s(self, *args): return self.realobj.%s(*args)\n\n" "%s.__doc__ = MyRealObj.%s.__doc__\n") for _m in ["foo"]: exec _s % (_m, _m, _m, _m) del _m, _s o = MyObj() print o.foo() Looking at it closer it appears that the foo method has been placed into the module instead of the class, the socket module winds up with the methods instead of the socket class. I suspect it's a case of dealing with the locals a bit differently inside a class definition. I'll have a go at fixing this but I'm still finding my way around the ironpython code (I'm up to ops.cs and statements.cs). cheers, Michael _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Larry.Jones at aspentech.com Fri Jan 27 21:24:54 2006 From: Larry.Jones at aspentech.com (Jones, Larry) Date: Fri, 27 Jan 2006 14:24:54 -0600 Subject: [IronPython] Fwd: Where to share a script / executables (agai n) Message-ID: <781C4D11561D1A4FA1D631415302FB83096F3B5F@houmail1.corp.aspentech.com> Would posting this script in the ActiveState "recipes" area be appropriate? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Catherine Devlin Sent: Friday, January 27, 2006 10:24 AM To: Discussion of IronPython Subject: Re: [IronPython] Fwd: Where to share a script / executables (again) Hi, Dino! Thank you! I got the Beta 2, remembered (after a fumble) to copy IronPython.dll into the directory with my source, ran IronPythonConsole cleanPath.py, and got a perfectly working executable. Hooray! As for where to share it, I took a look at the GotDotNet "User Samples" area. I tried to post there, but under "languages", they have no checkbox for IronPython. I submitted this as feedback to GotDotNet, and they replied that they plan to add IronPython as an option soon. Another hooray! Though, since they didn't define "soon",. I do wish I knew a place to post in the meantime. On 1/25/06, Dino Viehland wrote: > I don't have an immediate answer for you on sharing scripts but our > next beta release (due real, real soon now) will support running the > generated EXEs. If your test imports any modules written in Python > you'll still need to have those around and on your sys.path, but > otherwise this will work. -- - Catherine http://catherinedevlin.blogspot.com/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com This e-mail and any attachments are intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified any dissemination, distribution or copying of this email, and any attachments thereto, is strictly prohibited. If you receive this email in error please immediately notify the sender and permanently delete the original copy and any copy of any e-mail, and any printout thereof. From catherine.devlin at gmail.com Fri Jan 27 21:55:44 2006 From: catherine.devlin at gmail.com (Catherine Devlin) Date: Fri, 27 Jan 2006 15:55:44 -0500 Subject: [IronPython] Fwd: Where to share a script / executables (agai n) In-Reply-To: <781C4D11561D1A4FA1D631415302FB83096F3B5F@houmail1.corp.aspentech.com> References: <781C4D11561D1A4FA1D631415302FB83096F3B5F@houmail1.corp.aspentech.com> Message-ID: <6523e39a0601271255n2d540975obe78874d1fa6bc4@mail.gmail.com> On 1/27/06, Jones, Larry wrote: > Would posting this script in the ActiveState "recipes" area be appropriate? > That's a good question. I've never submitted to the Cookbook and am hazy about what they're looking for. I notice that the Python Cookbook site currently has a category for Jython, but not for IronPython. I searched the Cookbook for "IronPython" and found exactly one recipe. For now, I created a "User Sample" at GotDotNet containing source and .exe - http://gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=20DB65A0-A895-429E-9455-A02BF7330FA2. (say THAT five times fast) The fact that the executable can be stored there is a definite advantage - if we can get executables circulating beyond the Python-using community, they might generate curiosity and corrupt impressionable youth. Anyway, I had to leave the "language" field at GotDotNet blank. I'll update that once IronPython is included as a choice. I mentioned IronPython in the Description, but oddly enough, my item doesn't show up in User Sample search results for "IronPython" - maybe having a NULL in the Language field trips up their search. So there's no way to know whether other IronPython scripts have already been submitted there. There didn't seem to be anything in the upload agreement at GotDotNet to forbid sharing it elsewhere. -- - Catherine http://catherinedevlin.blogspot.com/ From ivan.chollet at lynanda.com Sat Jan 28 14:39:11 2006 From: ivan.chollet at lynanda.com (ivan chollet) Date: Sat, 28 Jan 2006 14:39:11 +0100 Subject: [IronPython] IDE Message-ID: <20060128133859.332376CC68@smtp2-g19.free.fr> Hi fellows Python scripters, As I had nice feedback for the IPython IDE, I'm proud to announce you that I've put the source code on my webpage. I share it under a no-license scheme or the sqlite-like license if you prefer. You can find it at http://www.lynanda.com/Members/ichollet/ivan-chollet-s-blog-pages/ironpython -ide-source-code Actually, I'd like to know if some people would be interested in helping me to develop the IDE in little bit further. According to some messages on this IronPython mailing list, a lot of people would like to have a Python debugger, like the one in VS.NET. (This won't be a trivial job, and it would maybe need some coordination with the IronPython development team. In fact I've put the emphasis on separating the engine code and the IDE code, so that the same IDE code can be ported across IronPython version, but I won't be able to do that if I should program an IronPython debugger) I think that the debugging facilities are crucial for the popularity of a language and a development environment. Best regards to all, Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: From fred.dixon at gmail.com Sun Jan 29 04:37:29 2006 From: fred.dixon at gmail.com (Fred Dixon) Date: Sat, 28 Jan 2006 22:37:29 -0500 Subject: [IronPython] IDE In-Reply-To: <20060128133859.332376CC68@smtp2-g19.free.fr> References: <20060128133859.332376CC68@smtp2-g19.free.fr> Message-ID: On 1/28/06, ivan chollet wrote: > > > > Hi fellows Python scripters, > > > > As I had nice feedback for the IPython IDE, I'm proud to announce you that > I've put the source code on my webpage. I share it under a no-license scheme > or the sqlite-like license if you prefer. > > You can find it at > http://www.lynanda.com/Members/ichollet/ivan-chollet-s-blog-pages/ironpython-ide-source-code > > > > Actually, I'd like to know if some people would be interested in helping me > to develop the IDE in little bit further. According to some messages on this > IronPython mailing list, a lot of people would like to have a Python > debugger, like the one in VS.NET. > actually i like the active state debugger for python. never used eric though From ivan.chollet at lynanda.com Sun Jan 29 10:58:49 2006 From: ivan.chollet at lynanda.com (ivan chollet) Date: Sun, 29 Jan 2006 10:58:49 +0100 Subject: [IronPython] IDE In-Reply-To: Message-ID: <20060129095837.623A34442B@smtp3-g19.free.fr> Clearly, Komodo and Eric are nice GUIs with decent debugging platforms. However I doubt that any of these editors will support IronPython in any way in the short term. As a matter of fact, a lot of ideas should be borrowed from them to build an open editor for the IronPython framework. Though, I think that this task (building a debugging platform) will be more difficult for IronPython than with simpler languages such php or Python. I mean, IronPython is a very rich language (it integrates all the .NET framework facilities...). What I can do right now is a simple debugger with breakpoints and on-the-fly variable exploration features. Code modification while debugging should be also quite trivial to add, given the interpreted nature of the .NET languages. Multi-threading, remote debugging are more difficult to implement. Ivan -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fred Dixon Sent: dimanche 29 janvier 2006 04:37 To: Discussion of IronPython Subject: Re: [IronPython] IDE On 1/28/06, ivan chollet wrote: > > > > Hi fellows Python scripters, > > > > As I had nice feedback for the IPython IDE, I'm proud to announce you that > I've put the source code on my webpage. I share it under a no-license scheme > or the sqlite-like license if you prefer. > > You can find it at > http://www.lynanda.com/Members/ichollet/ivan-chollet-s-blog-pages/ironpython -ide-source-code > > > > Actually, I'd like to know if some people would be interested in helping me > to develop the IDE in little bit further. According to some messages on this > IronPython mailing list, a lot of people would like to have a Python > debugger, like the one in VS.NET. > actually i like the active state debugger for python. never used eric though _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dnguyen16 at houston.rr.com Sun Jan 29 20:44:34 2006 From: dnguyen16 at houston.rr.com (Daniel Nguyen) Date: Sun, 29 Jan 2006 13:44:34 -0600 Subject: [IronPython] IDE In-Reply-To: <20060128133859.332376CC68@smtp2-g19.free.fr> Message-ID: <002401c6250c$93879790$6400a8c0@darkhorse> Hi Ivan, My skill may seem as questionable to some developers, but I'd like to help develop this IDE. So, if you don't mind for someone like me to pitch in, please let me know what I need to do to get start. Thanks, Daniel -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of ivan chollet Sent: Saturday, January 28, 2006 7:39 AM To: 'Discussion of IronPython' Subject: [IronPython] IDE Hi fellows Python scripters, As I had nice feedback for the IPython IDE, I'm proud to announce you that I've put the source code on my webpage. I share it under a no-license scheme or the sqlite-like license if you prefer. You can find it at http://www.lynanda.com/Members/ichollet/ivan-chollet-s-blog-pages/ironpython -ide-source-code Actually, I'd like to know if some people would be interested in helping me to develop the IDE in little bit further. According to some messages on this IronPython mailing list, a lot of people would like to have a Python debugger, like the one in VS.NET. (This won't be a trivial job, and it would maybe need some coordination with the IronPython development team. In fact I've put the emphasis on separating the engine code and the IDE code, so that the same IDE code can be ported across IronPython version, but I won't be able to do that if I should program an IronPython debugger) I think that the debugging facilities are crucial for the popularity of a language and a development environment. Best regards to all, Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: From paparipote at hotmail.com Mon Jan 30 02:35:58 2006 From: paparipote at hotmail.com (Paparipote .) Date: Sun, 29 Jan 2006 21:35:58 -0400 Subject: [IronPython] Function key F7 of Command Prompt. Message-ID: Hi: When a call executable ironpythonconsole I can use the USEFUL function key F7 which is part of the "Command prompt" and shows the list of commands I typed for selection (if previously I typed at least one); it then facilitates the use of "down arrow" key. When a call executable ironpythonconsole -X:TabCompletion unfortunaltely the function key F7 does not work. Is there a way to fix it? Regards. _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ From ken.manheimer at gmail.com Mon Jan 30 04:06:01 2006 From: ken.manheimer at gmail.com (Ken Manheimer) Date: Sun, 29 Jan 2006 22:06:01 -0500 Subject: [IronPython] IDE In-Reply-To: <20060129095837.623A34442B@smtp3-g19.free.fr> References: <20060129095837.623A34442B@smtp3-g19.free.fr> Message-ID: <2cd46e7f0601291906g3a7d3a89k4d472eebb22bed06@mail.gmail.com> On 1/29/06, ivan chollet wrote: > Clearly, Komodo and Eric are nice GUIs with decent debugging platforms. > However I doubt that any of these editors will support IronPython in any way > in the short term. > As a matter of fact, a lot of ideas should be borrowed from them to build an > open editor for the IronPython framework. > > Though, I think that this task (building a debugging platform) will be more > difficult for IronPython than with simpler languages such php or Python. I > mean, IronPython is a very rich language (it integrates all the .NET > framework facilities...). > > What I can do right now is a simple debugger with breakpoints and on-the-fly > variable exploration features. Code modification while debugging should be > also quite trivial to add, given the interpreted nature of the .NET > languages. Multi-threading, remote debugging are more difficult to > implement. that sounds like pdb, which is part of the python standard library. it depends on a lower-level library, bdb, which in turn depends on some interpreter cues which i don't offhand recall. i would aim for ensuring those cues are implemented, and then build on pdb. (i implemented a python debugging sensitivity for emacs, so that it would pop up source files on the current line as you stepped through a program using pdb. that feature got incorporated into python-mode for emacs, so giving a kind of screen-oriented debugger that scrolls the program code as you proceed. not everyone's an emacs user, but with this addition it goes a long way towards a decent debugging environment.) ken ken.manheimer at gmail.com From clicklist at gmail.com Mon Jan 30 04:19:35 2006 From: clicklist at gmail.com (Fabio) Date: Mon, 30 Jan 2006 01:19:35 -0200 Subject: [IronPython] Compiling in assemblies Message-ID: <192d28970601291919l3b8047a7x30cf8b5b32bc366f@mail.gmail.com> When the IronPython library end the beta phase, we will can create assemblies? exe, dll, etc... Regards Fabio -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Mon Jan 30 17:57:01 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 30 Jan 2006 08:57:01 -0800 Subject: [IronPython] Compiling in assemblies In-Reply-To: <192d28970601291919l3b8047a7x30cf8b5b32bc366f@mail.gmail.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501337804@df-foxhound-msg.exchange.corp.microsoft.com> IronPython has, in the Hosting namespace, a class PythonCompiler which allows that already. However, while the assemblies generated are true .NET assemblies, they are not easily used from other .NET languages yet - it is not an easy problem to solve. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fabio Sent: Sunday, January 29, 2006 7:20 PM To: IronPython Subject: [IronPython] Compiling in assemblies When the IronPython library end the beta phase, we will can create assemblies? exe, dll, etc... Regards Fabio -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Mon Jan 30 17:58:23 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 30 Jan 2006 08:58:23 -0800 Subject: [IronPython] Function key F7 of Command Prompt. In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501337807@df-foxhound-msg.exchange.corp.microsoft.com> The -X:TabCompletion command line switch intercepts all console input in order to handle Tab, F6, arrows etc. The special keys that are available by the standard windows console window won't therefore work, unfortunately. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote . Sent: Sunday, January 29, 2006 5:36 PM To: users at lists.ironpython.com Subject: [IronPython] Function key F7 of Command Prompt. Hi: When a call executable ironpythonconsole I can use the USEFUL function key F7 which is part of the "Command prompt" and shows the list of commands I typed for selection (if previously I typed at least one); it then facilitates the use of "down arrow" key. When a call executable ironpythonconsole -X:TabCompletion unfortunaltely the function key F7 does not work. Is there a way to fix it? Regards. _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From stan at phidani.be Mon Jan 30 19:34:41 2006 From: stan at phidani.be (Stanislas Pinte) Date: Mon, 30 Jan 2006 19:34:41 +0100 Subject: [IronPython] Simpy working under IronPython1.0beta2 Message-ID: <1138646081.43de5c41159df@webmail.raincode.com> Hello, I have the pleasure to say that a (quasi unmodified) version of simpy passed all its unit tests running IronPython: [SimPy-1.6.1]> ../IronPython-1.0-Beta2/IronPythonConsole.exe SimPy/testSimPy.py .................................................... ---------------------------------------------------------------------- Ran 53 tests in 0.781s OK Here is my change list: - commented out testPlot in MonitorTest.py, that imports Tkinter module - commented out all #from __future__ import generators statements (added IP bug http://www.gotdotnet.com/workspaces/bugtracker/bugdetails.aspx?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742&bugid=72593d8d-a5d2-4b69-a814-ca0091dc58ea) --> I will start to test a real application soon. From sanxiyn at gmail.com Tue Jan 31 00:59:03 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 31 Jan 2006 08:59:03 +0900 Subject: [IronPython] Simpy working under IronPython1.0beta2 In-Reply-To: <1138646081.43de5c41159df@webmail.raincode.com> References: <1138646081.43de5c41159df@webmail.raincode.com> Message-ID: <5b0248170601301559u5b387864g@mail.gmail.com> 2006/1/31, Stanislas Pinte : > Hello, > > I have the pleasure to say that a (quasi unmodified) version of simpy passed > all its unit tests running IronPython: Wow. > - commented out all #from __future__ import generators statements Doesn't simply copying __future__.py from CPython solve this issue? Seo Sanghyeon From stan at phidani.be Tue Jan 31 09:32:45 2006 From: stan at phidani.be (Stanislas Pinte) Date: Tue, 31 Jan 2006 09:32:45 +0100 Subject: [IronPython] Simpy working under IronPython1.0beta2 In-Reply-To: <5b0248170601301559u5b387864g@mail.gmail.com> References: <1138646081.43de5c41159df@webmail.raincode.com> <5b0248170601301559u5b387864g@mail.gmail.com> Message-ID: <1138696365.43df20ad17df6@webmail.raincode.com> Selon Sanghyeon Seo : > 2006/1/31, Stanislas Pinte : > > Hello, > > > > I have the pleasure to say that a (quasi unmodified) version of simpy passed > > all its unit tests running IronPython: > > Wow. > > > - commented out all #from __future__ import generators statements > > Doesn't simply copying __future__.py from CPython solve this issue? Indeed. My apologies. I'll close the IP bug. Stan. > > Seo Sanghyeon > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From stan at phidani.be Tue Jan 31 09:42:51 2006 From: stan at phidani.be (Stanislas Pinte) Date: Tue, 31 Jan 2006 09:42:51 +0100 Subject: [IronPython] [Simpy-users] Simpy working under IronPython1.0beta2 In-Reply-To: <200601310501.k0V517Gk036167@smtp-vbr5.xs4all.nl> References: <200601310501.k0V517Gk036167@smtp-vbr5.xs4all.nl> Message-ID: <1138696971.43df230be3fb9@webmail.raincode.com> Selon Klaus Muller : > Stan, > Great news! > > How did you provide required modules such as e.g. "random" and "bisect"? just copying them and other required deps from PYTHON24/Libs/ aside of the IPConsole binary. There must be a better way to do it however...(like setting the PYTHONPATH to PYTHON24/Libs/) haven't tried it though. Stan. > > Klaus M?ller > > > > -----Original Message----- > > From: simpy-users-admin at lists.sourceforge.net > > [mailto:simpy-users-admin at lists.sourceforge.net] On Behalf Of > > Stanislas Pinte > > Sent: Monday, January 30, 2006 7:35 PM > > To: simpy-users at lists.sourceforge.net > > Cc: users at lists.ironpython.com > > Subject: [Simpy-users] Simpy working under IronPython1.0beta2 > > > > Hello, > > > > I have the pleasure to say that a (quasi unmodified) version > > of simpy passed all its unit tests running IronPython: > > > > [SimPy-1.6.1]> ../IronPython-1.0-Beta2/IronPythonConsole.exe > > SimPy/testSimPy.py > > .................................................... > > ---------------------------------------------------------------------- > > Ran 53 tests in 0.781s > > > > OK > > > > Here is my change list: > > > > - commented out testPlot in MonitorTest.py, that imports > > Tkinter module > > - commented out all #from __future__ import generators statements > > > > (added IP bug > > http://www.gotdotnet.com/workspaces/bugtracker/bugdetails.aspx > > ?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742&bugid=72593d8d-a5d2-4 > > b69-a814-ca0091dc58ea) > > > > --> I will start to test a real application soon. > > > > > > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do you grep > > through log files for problems? Stop! Download the new AJAX > > search engine that makes searching your log files as easy as > > surfing the web. DOWNLOAD SPLUNK! > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486& > > dat=121642 > > _______________________________________________ > > Simpy-users mailing list > > Simpy-users at lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/simpy-users > > > From sanxiyn at gmail.com Tue Jan 31 11:31:54 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 31 Jan 2006 19:31:54 +0900 Subject: [IronPython] Slicing an array Message-ID: <5b0248170601310231y2be06b4aq@mail.gmail.com> E:\IronPython-1.0-Beta2>ip IronPython 1.0.2216 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import System >>> buffer = System.Array.CreateInstance(System.Byte, 10) >>> buffer[:5] Traceback (most recent call last): File , line 0, in input##2 NotImplementedError: The method or operation is not implemented. >>> Is this planned to be implemented? If so, when? Will IronPython have something like http://www.jython.org/docs/jarray.html ? Seo Sanghyeon From Martin.Maly at microsoft.com Mon Jan 30 19:45:34 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 30 Jan 2006 10:45:34 -0800 Subject: [IronPython] Simpy working under IronPython1.0beta2 In-Reply-To: <1138646081.43de5c41159df@webmail.raincode.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F50133793E@df-foxhound-msg.exchange.corp.microsoft.com> Thanks, this is good news! As for the "from __future__ import generators" ... While IronPython does recognize the statement on syntactical level, it is then the execution of the statement that fails because IronPython distribution doesn't contain the __future__.py file. In this case, IronPython needs presence of the standard Python libraries directory on its sys.path. With the following in my site.py: import sys sys.path.append("C:\\Python24\\Lib") I can run following script: from __future__ import generators print generators without error and with output: _Feature((2, 2, 0, 'alpha', 1), (2, 3, 0, 'final', 0), 4096) Hope this helps Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Stanislas Pinte Sent: Monday, January 30, 2006 10:35 AM To: simpy-users at lists.sourceforge.net Cc: users at lists.ironpython.com Subject: [IronPython] Simpy working under IronPython1.0beta2 Hello, I have the pleasure to say that a (quasi unmodified) version of simpy passed all its unit tests running IronPython: [SimPy-1.6.1]> ../IronPython-1.0-Beta2/IronPythonConsole.exe SimPy/testSimPy.py .................................................... ---------------------------------------------------------------------- Ran 53 tests in 0.781s OK Here is my change list: - commented out testPlot in MonitorTest.py, that imports Tkinter module - commented out all #from __future__ import generators statements (added IP bug http://www.gotdotnet.com/workspaces/bugtracker/bugdetails.aspx?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742&bugid=72593d8d-a5d2-4b69-a814-ca0091dc58ea) --> I will start to test a real application soon. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jtk at yahoo.com Tue Jan 31 21:06:56 2006 From: jtk at yahoo.com (Jeff Kowalczyk) Date: Tue, 31 Jan 2006 15:06:56 -0500 Subject: [IronPython] IronPython-1.0beta2 on mono-1.1.12 str split() not implemented default arg Message-ID: IronPython-1.0beta2 on mono-1.1.12 raises a NotImplementedError when calling .split() on a str object with no arguments. cpython uses a default argument (whitespace) and succeeds. $ mono IronPythonConsole.exe IronPython 1.0.2216 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import sys ; sys.path.append('/usr/lib/python2.4') >>> s = 'does ironpython accept a default argument to string split method' >>> s.split() Traceback (most recent call last): File mscorlib, line unknown, in Split File mscorlib, line unknown, in Split File mscorlib, line unknown, in Split NotImplementedError: The requested feature is not implemented. >>> s.split(' ') ['does', 'ironpython', 'accept', 'a', 'default', 'argument', 'to', 'string', 'split', 'method'] >>> Python 2.4.2 (#1, Sep 28 2005, 17:54:11) [GCC 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> s = 'does cpython accept a default argument to string split method' >>> s.split() ['does', 'cpython', 'accept', 'a', 'default', 'argument', 'to', 'string', 'split', 'method'] >>> From vargaz at gmail.com Tue Jan 31 21:37:14 2006 From: vargaz at gmail.com (Zoltan Varga) Date: Tue, 31 Jan 2006 21:37:14 +0100 Subject: [IronPython] IronPython-1.0beta2 on mono-1.1.12 str split() not implemented default arg In-Reply-To: References: Message-ID: <295e750a0601311237y6292e8e3sfaf05a75aaebc744@mail.gmail.com> Hi, This has been fixed in mono SVN. Zoltan On 1/31/06, Jeff Kowalczyk wrote: > IronPython-1.0beta2 on mono-1.1.12 raises a NotImplementedError when > calling .split() on a str object with no arguments. cpython uses a default > argument (whitespace) and succeeds. > > $ mono IronPythonConsole.exe > IronPython 1.0.2216 (Beta) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import sys ; sys.path.append('/usr/lib/python2.4') > >>> s = 'does ironpython accept a default argument to string split method' > >>> s.split() > Traceback (most recent call last): > File mscorlib, line unknown, in Split > File mscorlib, line unknown, in Split > File mscorlib, line unknown, in Split > NotImplementedError: The requested feature is not implemented. > >>> s.split(' ') > ['does', 'ironpython', 'accept', 'a', 'default', 'argument', 'to', 'string', 'split', 'method'] > >>> > > Python 2.4.2 (#1, Sep 28 2005, 17:54:11) > [GCC 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> s = 'does cpython accept a default argument to string split method' > >>> s.split() > ['does', 'cpython', 'accept', 'a', 'default', 'argument', 'to', 'string', 'split', 'method'] > >>> > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From vargaz at gmail.com Tue Jan 31 21:37:14 2006 From: vargaz at gmail.com (Zoltan Varga) Date: Tue, 31 Jan 2006 21:37:14 +0100 Subject: [IronPython] IronPython-1.0beta2 on mono-1.1.12 str split() not implemented default arg In-Reply-To: References: Message-ID: <295e750a0601311237y6292e8e3sfaf05a75aaebc744@mail.gmail.com> Hi, This has been fixed in mono SVN. Zoltan On 1/31/06, Jeff Kowalczyk wrote: > IronPython-1.0beta2 on mono-1.1.12 raises a NotImplementedError when > calling .split() on a str object with no arguments. cpython uses a default > argument (whitespace) and succeeds. > > $ mono IronPythonConsole.exe > IronPython 1.0.2216 (Beta) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import sys ; sys.path.append('/usr/lib/python2.4') > >>> s = 'does ironpython accept a default argument to string split method' > >>> s.split() > Traceback (most recent call last): > File mscorlib, line unknown, in Split > File mscorlib, line unknown, in Split > File mscorlib, line unknown, in Split > NotImplementedError: The requested feature is not implemented. > >>> s.split(' ') > ['does', 'ironpython', 'accept', 'a', 'default', 'argument', 'to', 'string', 'split', 'method'] > >>> > > Python 2.4.2 (#1, Sep 28 2005, 17:54:11) > [GCC 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> s = 'does cpython accept a default argument to string split method' > >>> s.split() > ['does', 'cpython', 'accept', 'a', 'default', 'argument', 'to', 'string', 'split', 'method'] > >>> > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From glee at pharsight.com Sun Jan 29 19:50:56 2006 From: glee at pharsight.com (Greg Lee) Date: Sun, 29 Jan 2006 18:50:56 -0000 Subject: [IronPython] Error during unittest initialization Message-ID: <08AAC77C2656414E91980F8EBB1E7F01037EFEF9@electra.corp.pharsight.com> Using IronPython 1.0.2216 (Beta) on .NET 2.0.50727.42 to run this: import unittest class TestConfigparser(unittest.TestCase): def testtokenize(self): pass def testline(self): pass if __name__ == "__main__": unittest.main() Produces: Traceback (most recent call last): File c:\box\test\testdmxmetadataeditor\foo.py, line 11, in Initialize File unittest, line unknown, in __init__$f196 File c:\python24\lib\unittest.py, line 758, in __init__$f196 File c:\python24\lib\unittest.py, line 787, in parseArgs$f198 File c:\python24\lib\unittest.py, line 507, in loadTestsFromModule$f173 File c:\python24\lib\unittest.py, line 495, in loadTestsFromTestCase$f172 File c:\python24\lib\unittest.py, line 570, in getTestCaseNames$f176 TypeError: cmp() takes exactly 2 argument (3 given) Python library is from python2.4. No error occurs if only one test is include, i.e. testline is deleted from the TestCase. -------------- next part -------------- An HTML attachment was scrubbed... URL: From glee at pharsight.com Tue Jan 31 21:40:04 2006 From: glee at pharsight.com (Greg Lee) Date: Tue, 31 Jan 2006 12:40:04 -0800 Subject: [IronPython] IronPython console runs out of memory Message-ID: <08AAC77C2656414E91980F8EBB1E7F0104EA2530@electra.corp.pharsight.com> This one-liner causes IronPython console to run out of memory (2.05GB page file) and freeze Windows XP: from xml.dom import minidom This is the installation: Microsoft Windows XP [Version 5.1.2600] IronPython 1.0.2216 (Beta) on .NET 2.0.50727.42 python 2.4.2 pyxml 0.8.4 pywin32 205 py2exe 0.6.3 IRONPYTHONPATH = c:\python24\lib From nikolaus.j.wagner at gmx.at Sat Jan 28 22:44:52 2006 From: nikolaus.j.wagner at gmx.at (Nikolaus Wagner) Date: Sat, 28 Jan 2006 21:44:52 -0000 Subject: [IronPython] Version 1.0 downloadable? Message-ID: <43DBE633.3030500@gmx.at> Hi! Where can I download the latest version of Ironpython? http://www.ironpython.com/ only has a nearly 2 year old version. Thanks, Nikolaus Wagner From kgmuller at xs4all.nl Tue Jan 31 06:00:51 2006 From: kgmuller at xs4all.nl (Klaus Muller) Date: Tue, 31 Jan 2006 06:00:51 +0100 Subject: [IronPython] [Simpy-users] Simpy working under IronPython1.0beta2 In-Reply-To: <1138646081.43de5c41159df@webmail.raincode.com> Message-ID: <200601310501.k0V517Gk036167@smtp-vbr5.xs4all.nl> Stan, Great news! How did you provide required modules such as e.g. "random" and "bisect"? Klaus M?ller > -----Original Message----- > From: simpy-users-admin at lists.sourceforge.net > [mailto:simpy-users-admin at lists.sourceforge.net] On Behalf Of > Stanislas Pinte > Sent: Monday, January 30, 2006 7:35 PM > To: simpy-users at lists.sourceforge.net > Cc: users at lists.ironpython.com > Subject: [Simpy-users] Simpy working under IronPython1.0beta2 > > Hello, > > I have the pleasure to say that a (quasi unmodified) version > of simpy passed all its unit tests running IronPython: > > [SimPy-1.6.1]> ../IronPython-1.0-Beta2/IronPythonConsole.exe > SimPy/testSimPy.py > .................................................... > ---------------------------------------------------------------------- > Ran 53 tests in 0.781s > > OK > > Here is my change list: > > - commented out testPlot in MonitorTest.py, that imports > Tkinter module > - commented out all #from __future__ import generators statements > > (added IP bug > http://www.gotdotnet.com/workspaces/bugtracker/bugdetails.aspx > ?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742&bugid=72593d8d-a5d2-4 > b69-a814-ca0091dc58ea) > > --> I will start to test a real application soon. > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep > through log files for problems? Stop! Download the new AJAX > search engine that makes searching your log files as easy as > surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486& > dat=121642 > _______________________________________________ > Simpy-users mailing list > Simpy-users at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/simpy-users > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3936 bytes Desc: not available URL: From kgmuller at xs4all.nl Tue Jan 31 16:36:44 2006 From: kgmuller at xs4all.nl (Klaus Muller) Date: Tue, 31 Jan 2006 16:36:44 +0100 Subject: [IronPython] [Simpy-users] Simpy working under IronPython1.0beta2 In-Reply-To: <1138696971.43df230be3fb9@webmail.raincode.com> Message-ID: <200601311537.k0VFb11Q088353@smtp-vbr17.xs4all.nl> Stan, all: This is incredible! I executed Simulation.py, SimulationTrace.py, SimulationRT.py and SimulationStep.py under IronPython -- they worked like a dream! I will now go on to actual application development and comparative timing studies. If Microsoft actually supports IronPython under VisualStudio, this is going to be one heck of a powerful simulation development environment. Klaus M?ller PS: Any ideas what we can use as a free plotting package with IronPython, instead of the Tkinter-based one currently in Simpy? > -----Original Message----- > From: simpy-users-admin at lists.sourceforge.net > [mailto:simpy-users-admin at lists.sourceforge.net] On Behalf Of > Stanislas Pinte > Sent: Tuesday, January 31, 2006 9:43 AM > To: Klaus Muller > Cc: simpy-users at lists.sourceforge.net; users at lists.ironpython.com > Subject: RE: [Simpy-users] Simpy working under IronPython1.0beta2 > > Selon Klaus Muller : > > > Stan, > > Great news! > > > > How did you provide required modules such as e.g. "random" > and "bisect"? > > just copying them and other required deps from PYTHON24/Libs/ > aside of the IPConsole binary. > > There must be a better way to do it however...(like setting > the PYTHONPATH to PYTHON24/Libs/) haven't tried it though. > > Stan. > > > > > Klaus M?ller > > > > > > > -----Original Message----- > > > From: simpy-users-admin at lists.sourceforge.net > > > [mailto:simpy-users-admin at lists.sourceforge.net] On Behalf Of > > > Stanislas Pinte > > > Sent: Monday, January 30, 2006 7:35 PM > > > To: simpy-users at lists.sourceforge.net > > > Cc: users at lists.ironpython.com > > > Subject: [Simpy-users] Simpy working under IronPython1.0beta2 > > > > > > Hello, > > > > > > I have the pleasure to say that a (quasi unmodified) version of > > > simpy passed all its unit tests running IronPython: > > > > > > [SimPy-1.6.1]> ../IronPython-1.0-Beta2/IronPythonConsole.exe > > > SimPy/testSimPy.py > > > .................................................... > > > > -------------------------------------------------------------------- > > > -- > > > Ran 53 tests in 0.781s > > > > > > OK > > > > > > Here is my change list: > > > > > > - commented out testPlot in MonitorTest.py, that imports Tkinter > > > module > > > - commented out all #from __future__ import generators statements > > > > > > (added IP bug > > > http://www.gotdotnet.com/workspaces/bugtracker/bugdetails.aspx > > > ?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742&bugid=72593d8d-a5d2-4 > > > b69-a814-ca0091dc58ea) > > > > > > --> I will start to test a real application soon. > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by: Splunk Inc. Do you > grep through > > > log files for problems? Stop! Download the new AJAX > search engine > > > that makes searching your log files as easy as surfing the web. > > > DOWNLOAD SPLUNK! > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486& > > > dat=121642 > > > _______________________________________________ > > > Simpy-users mailing list > > > Simpy-users at lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/simpy-users > > > > > > > > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep > through log files for problems? Stop! Download the new AJAX > search engine that makes searching your log files as easy as > surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486& > dat=121642 > _______________________________________________ > Simpy-users mailing list > Simpy-users at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/simpy-users > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3936 bytes Desc: not available URL: