From Daniel.Piessens at RedPrairie.com Tue Nov 1 00:21:41 2005 From: Daniel.Piessens at RedPrairie.com (Piessens, Daniel) Date: Mon, 31 Oct 2005 17:21:41 -0600 Subject: [IronPython] Create a .dll from a Script Message-ID: <87ED099388B4424D9D5A29F8843BBD850200D004@RPEX.DOM1.REDPRAIRIE.COM> Hello, My team and I have come across a Python Library Toolkit that we could really use in a .NET application that we are creating. The issue is that the Python Library is far to extensive to re-write in .NET and IronPython seemed like a good choice for converting the python code into a managed assembly. Is this possible, and if so what's the best way to do it. I know that you can create an .exe but it's kind of hard to find where the code is compiling the python script. Thanks, Dan Piessens -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Tue Nov 1 02:24:53 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Mon, 31 Oct 2005 17:24:53 -0800 Subject: [IronPython] Need help in learning. Message-ID: Of course, it precludes searching by object, if the object's type is string. ;) I'd have stuck to msdn(Type), myself, but that doesn't detract from any intrinsic coolness.. ----- Keith J. Farmer kfarmer at thuban.org ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Peli de Halleux (PELI) Sent: Monday, 31 October 2005 13:36 To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Slick. ________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Shawn Farkas Sent: Monday, October 31, 2005 12:27 PM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Pretty easily done with a quick script: import sys sys.LoadAssemblyByName("System") from System import String from System.Diagnostics import Process def msdn(query): if query.GetType() == String.Empty.GetType(): Process.Start("http://search.microsoft.com/search/results.aspx?View=msdn &st=b&c=4&s=1&swc=4&qu=" + query) else: msdn(query.GetType().FullName) Will launch the MSDN help page in the user's default browser. I'm not sure if there's a nicer way to determine if the parameter is a string or not, and this also relies on the fact that the browser will normalize the query string (if it contains a space for instance) ... but will break if you query contains the & character. However, for debugging purposes, if you throw that in your site.py you're all set :-) -Shawn ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Peli de Halleux (PELI) Sent: Monday, October 31, 2005 11:48 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Following up the improving the experience for new .Net users, IronPython could provide specialized commands to search msdn and pop up a internet window. For example something like msdn "System.Security.Cryptography.SignedXml.ComputeSignature" // search based on literal msdn foo // search based on the object type ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Shawn Farkas Sent: Monday, October 31, 2005 11:11 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Sure -- you just have to go to the MSDN docs for the class you're using. For instance, if you want to use the System.Security.Cryptography.SignedXml.ComputeSignature() method, you would go to the MSDN documentation for "SignedXml Class" (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/ html/frlrfsystemsecuritycryptographyxmlsignedxmlclasstopic.asp) and then at the bottom of the page, in the requirements section is: Assembly: System.Security (in System.Security.dll) -Shawn -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mayfield, Weatherby Sent: Monday, October 31, 2005 11:06 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. I am in a similar boat with regard to knowing some Python but very little .NET. I'm very intrigued by the ability to access the .NET framework from Python, but I know so little about .NET I'm not even sure what question(s) to ask. >From what I have seen in the examples and archives, it looks like there are two basic ways to get at the .NET code: LoadAssemblyByName and LoadAssemblyFromFile. My problem is that I don't know how to correlate between the assembly names or file names and the .NET APIs I read about. Is there somewhere I can look on MSDN or in a manual or in Visual Studio that will tell me if I want to access 'X' .NET feature then the assembly name is 'Y' or the file name is 'Z'? I think I must be searching for the wrong terms or something. Thanks, Web Mayfield -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of S.Rajesh Sent: Thursday, October 13, 2005 5:47 AM To: users at lists.ironpython.com Subject: [IronPython] Need help in learning. Hi, I am familiar with python but not with .NET. I also do not know other programming languages like VB or C# so it is not that easy to follow tutorials. What should be my first step to learn to use ironpython? Thank You. _______________________________________________ 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 kfarmer at thuban.org Tue Nov 1 02:39:35 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Mon, 31 Oct 2005 17:39:35 -0800 Subject: [IronPython] Create a .dll from a Script Message-ID: When run under Win32, IronPython generates an exe which should be importable as an assembly (does it do so when run from Mono? In any case, Mono should still be able to import it, or soon will now that Whidbey has released.). If you use Reflector (http://www.aisto.com/roeder/dotnet/), you can examine the namespaces contained within the assembly. I don't know how much this will help, but it'd be a start. ----- Keith J. Farmer kfarmer at thuban.org ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Piessens, Daniel Sent: Monday, 31 October 2005 15:22 To: users at lists.ironpython.com Subject: [IronPython] Create a .dll from a Script Hello, My team and I have come across a Python Library Toolkit that we could really use in a .NET application that we are creating. The issue is that the Python Library is far to extensive to re-write in .NET and IronPython seemed like a good choice for converting the python code into a managed assembly. Is this possible, and if so what's the best way to do it. I know that you can create an .exe but it's kind of hard to find where the code is compiling the python script. Thanks, Dan Piessens -------------- next part -------------- An HTML attachment was scrubbed... URL: From ml.cyresse at gmail.com Tue Nov 1 07:09:54 2005 From: ml.cyresse at gmail.com (Liam Clarke) Date: Tue, 1 Nov 2005 19:09:54 +1300 Subject: [IronPython] importing os module In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F5295555@df-foxhound-msg.exchange.corp.microsoft.com> References: <001401c5d138$2ce81c30$0138fea9@goku> <5C0A6F919D675745BB1DBA7412DB68F5295555@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: Now, my question on os is, what does IronPython have against pipe() ? Does IronPython not play with C at all? Regards, Liam Clarke On 11/1/05, Martin Maly wrote: > > You can set sys.path to point to CPython's Lib directory which includes os > module: > > >>> import sys > >>> sys.path.append("C:\\Python24\Lib") > >>> import os > >>> os.name > 'nt' > > You can even put the first 2 lines into your site.py (located in > IronPython's Bin\lib directory) > > Martin > > ________________________________ > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of > Papanii Okai > Sent: Friday, October 14, 2005 8:26 PM > To: users at lists.ironpython.com > Subject: [IronPython] importing os module > > > > > > Hi Guys, > > I was testing out Iron Python and I was trying to test out the OS > module but I got the error .. > > > > TraceBack (most recent call last) > > At > > ImportError: No module named os.. > > > > Obviously it doesn't exist. Thus is there any means to get around this? > > > > Thank you > > --Papanii > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From jhalleux at exchange.microsoft.com Tue Nov 1 16:21:20 2005 From: jhalleux at exchange.microsoft.com (Peli de Halleux (PELI)) Date: Tue, 1 Nov 2005 07:21:20 -0800 Subject: [IronPython] RTM build? Message-ID: Is there an ETA for a IronPython build against RTM? Thanks, Peli -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Tue Nov 1 15:53:26 2005 From: jvm_cop at spamcop.net (J. Merrill) Date: Tue, 01 Nov 2005 10:53:26 -0400 Subject: [IronPython] Need help in learning. In-Reply-To: References: Message-ID: <4.3.2.7.2.20051101105245.053d7688@mail.comcast.net> That script searches the release docn for .Net (1.x). IP relies on .Net 2, so I think the .Start line should be Process.Start("http://lab.msdn.microsoft.com/searchbeta/Default.aspx?" + query) Otherwise, some results will be missing or perhaps incomplete (or, rarely, incorrect). At 04:27 PM 10/31/2005, Shawn Farkas wrote >Pretty easily done with a quick script: > > > >import sys > >sys.LoadAssemblyByName("System") > >from System import String > >from System.Diagnostics import Process > > > >def msdn(query): > > if query.GetType() == String.Empty.GetType(): > > Process.Start("http://search.microsoft.com/search/results.aspx?View=msdn&st=b&c=4&s=1&swc=4&qu=" + query) > > else: > > msdn(query.GetType().FullName) > > > >Will launch the MSDN help page in the user s default browser. I m not sure if there s a nicer way to determine if the parameter is a string or not, and this also relies on the fact that the browser will normalize the query string (if it contains a space for instance) & but will break if you query contains the & character. However, for debugging purposes, if you throw that in your site.py you re all set J > > > >-Shawn > > > >---------- >From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Peli de Halleux (PELI) >Sent: Monday, October 31, 2005 11:48 AM >To: Discussion of IronPython >Subject: Re: [IronPython] Need help in learning. > > > >Following up the improving the experience for new .Net users, IronPython could provide specialized commands to search msdn and pop up a internet window. For example something like > > msdn "System.Security.Cryptography.SignedXml.ComputeSignature" // search based on literal > > msdn foo // search based on the object type > >[snip] J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Tue Nov 1 16:06:31 2005 From: jvm_cop at spamcop.net (J. Merrill) Date: Tue, 01 Nov 2005 11:06:31 -0400 Subject: [IronPython] importing os module In-Reply-To: References: <5C0A6F919D675745BB1DBA7412DB68F5295555@df-foxhound-msg.exchange.corp.microsoft.com> <001401c5d138$2ce81c30$0138fea9@goku> <5C0A6F919D675745BB1DBA7412DB68F5295555@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <4.3.2.7.2.20051101110453.051ac7f0@mail.comcast.net> IP does indeed "not play with C at all". The plan, I believe, is to re-create some common C-based Python libraries (with C# or in Python) to ease the porting. At 02:09 AM 11/1/2005, Liam Clarke wrote >Now, my question on os is, what does IronPython have against pipe() ? >Does IronPython not play with C at all? > >Regards, > >Liam Clarke > > >On 11/1/05, Martin Maly wrote: >> >> You can set sys.path to point to CPython's Lib directory which includes os >> module: >> >> >>> import sys >> >>> sys.path.append("C:\\Python24\Lib") >> >>> import os >> >>> os.name >> 'nt' >> >> You can even put the first 2 lines into your site.py (located in >> IronPython's Bin\lib directory) >> >> Martin >[snip] J. Merrill / Analytical Software Corp From gogins at pipeline.com Tue Nov 1 17:08:23 2005 From: gogins at pipeline.com (Michael Gogins) Date: Tue, 1 Nov 2005 11:08:23 -0500 (GMT-05:00) Subject: [IronPython] importing os module Message-ID: <14524135.1130861303970.JavaMail.root@mswamui-swiss.atl.sa.earthlink.net> Why does it not play with C? Surely this would be immensely helpful. Regards, MIke -----Original Message----- From: "J. Merrill" Sent: Nov 1, 2005 10:06 AM To: Discussion of IronPython Subject: Re: [IronPython] importing os module IP does indeed "not play with C at all". The plan, I believe, is to re-create some common C-based Python libraries (with C# or in Python) to ease the porting. At 02:09 AM 11/1/2005, Liam Clarke wrote >Now, my question on os is, what does IronPython have against pipe() ? >Does IronPython not play with C at all? > >Regards, > >Liam Clarke > > >On 11/1/05, Martin Maly wrote: >> >> You can set sys.path to point to CPython's Lib directory which includes os >> module: >> >> >>> import sys >> >>> sys.path.append("C:\\Python24\Lib") >> >>> import os >> >>> os.name >> 'nt' >> >> You can even put the first 2 lines into your site.py (located in >> IronPython's Bin\lib directory) >> >> Martin >[snip] J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Shawn.Farkas at microsoft.com Tue Nov 1 17:14:13 2005 From: Shawn.Farkas at microsoft.com (Shawn Farkas) Date: Tue, 1 Nov 2005 08:14:13 -0800 Subject: [IronPython] Need help in learning. In-Reply-To: Message-ID: Yep - you'll have to memorize the String operations without help of the method :-) ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Monday, October 31, 2005 5:25 PM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Of course, it precludes searching by object, if the object's type is string. ;) I'd have stuck to msdn(Type), myself, but that doesn't detract from any intrinsic coolness.. ----- Keith J. Farmer kfarmer at thuban.org ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Peli de Halleux (PELI) Sent: Monday, 31 October 2005 13:36 To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Slick. ________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Shawn Farkas Sent: Monday, October 31, 2005 12:27 PM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Pretty easily done with a quick script: import sys sys.LoadAssemblyByName("System") from System import String from System.Diagnostics import Process def msdn(query): if query.GetType() == String.Empty.GetType(): Process.Start("http://search.microsoft.com/search/results.aspx?View=msdn&st=b&c=4&s=1&swc=4&qu=" + query) else: msdn(query.GetType().FullName) Will launch the MSDN help page in the user's default browser. I'm not sure if there's a nicer way to determine if the parameter is a string or not, and this also relies on the fact that the browser will normalize the query string (if it contains a space for instance) ... but will break if you query contains the & character. However, for debugging purposes, if you throw that in your site.py you're all set J -Shawn ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Peli de Halleux (PELI) Sent: Monday, October 31, 2005 11:48 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Following up the improving the experience for new .Net users, IronPython could provide specialized commands to search msdn and pop up a internet window. For example something like msdn "System.Security.Cryptography.SignedXml.ComputeSignature" // search based on literal msdn foo // search based on the object type ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Shawn Farkas Sent: Monday, October 31, 2005 11:11 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Sure -- you just have to go to the MSDN docs for the class you're using. For instance, if you want to use the System.Security.Cryptography.SignedXml.ComputeSignature() method, you would go to the MSDN documentation for "SignedXml Class" (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemsecuritycryptographyxmlsignedxmlclasstopic.asp) and then at the bottom of the page, in the requirements section is: Assembly: System.Security (in System.Security.dll) -Shawn -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mayfield, Weatherby Sent: Monday, October 31, 2005 11:06 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. I am in a similar boat with regard to knowing some Python but very little .NET. I'm very intrigued by the ability to access the .NET framework from Python, but I know so little about .NET I'm not even sure what question(s) to ask. >From what I have seen in the examples and archives, it looks like there are two basic ways to get at the .NET code: LoadAssemblyByName and LoadAssemblyFromFile. My problem is that I don't know how to correlate between the assembly names or file names and the .NET APIs I read about. Is there somewhere I can look on MSDN or in a manual or in Visual Studio that will tell me if I want to access 'X' .NET feature then the assembly name is 'Y' or the file name is 'Z'? I think I must be searching for the wrong terms or something. Thanks, Web Mayfield -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of S.Rajesh Sent: Thursday, October 13, 2005 5:47 AM To: users at lists.ironpython.com Subject: [IronPython] Need help in learning. Hi, I am familiar with python but not with .NET. I also do not know other programming languages like VB or C# so it is not that easy to follow tutorials. What should be my first step to learn to use ironpython? Thank You. _______________________________________________ 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 Shawn.Farkas at microsoft.com Tue Nov 1 17:16:32 2005 From: Shawn.Farkas at microsoft.com (Shawn Farkas) Date: Tue, 1 Nov 2005 08:16:32 -0800 Subject: [IronPython] Need help in learning. In-Reply-To: <4.3.2.7.2.20051101105245.053d7688@mail.comcast.net> Message-ID: True enough, however the MSDN docs should start to move over to the main MSDN site relatively soon now, since 2.0 has officially shipped. Msdn2.microsoft.com is their staging server to get pre-release stuff setup before it ships. -Shawn ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Tuesday, November 01, 2005 6:53 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. That script searches the release docn for .Net (1.x). IP relies on .Net 2, so I think the .Start line should be Process.Start("http://lab.msdn.microsoft.com/searchbeta/Default.aspx?" + query) Otherwise, some results will be missing or perhaps incomplete (or, rarely, incorrect). At 04:27 PM 10/31/2005, Shawn Farkas wrote Pretty easily done with a quick script: import sys sys.LoadAssemblyByName("System") from System import String from System.Diagnostics import Process def msdn(query): if query.GetType() == String.Empty.GetType(): Process.Start("http://search.microsoft.com/search/results.aspx?View=msdn&st=b&c=4&s=1&swc=4&qu=" + query) else: msdn(query.GetType().FullName) Will launch the MSDN help page in the user s default browser. I m not sure if there s a nicer way to determine if the parameter is a string or not, and this also relies on the fact that the browser will normalize the query string (if it contains a space for instance) & but will break if you query contains the & character. However, for debugging purposes, if you throw that in your site.py you re all set J -Shawn ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Peli de Halleux (PELI) Sent: Monday, October 31, 2005 11:48 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. Following up the improving the experience for new .Net users, IronPython could provide specialized commands to search msdn and pop up a internet window. For example something like msdn "System.Security.Cryptography.SignedXml.ComputeSignature" // search based on literal msdn foo // search based on the object type [snip] J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Tue Nov 1 19:00:54 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Tue, 1 Nov 2005 10:00:54 -0800 Subject: [IronPython] RTM build? Message-ID: The source recompiles fine on my system... ----- Keith J. Farmer kfarmer at thuban.org ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Peli de Halleux (PELI) Sent: Tuesday, 01 November 2005 07:21 To: users at lists.ironpython.com Subject: [IronPython] RTM build? Is there an ETA for a IronPython build against RTM? Thanks, Peli -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Tue Nov 1 19:24:27 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 1 Nov 2005 10:24:27 -0800 Subject: [IronPython] RTM build? In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5295B2A@df-foxhound-msg.exchange.corp.microsoft.com> The next upcoming release of IronPython will be built using the .Net 2.0 final release. Stay tuned! Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Tuesday, November 01, 2005 10:01 AM To: Discussion of IronPython Subject: Re: [IronPython] RTM build? The source recompiles fine on my system... ----- Keith J. Farmer kfarmer at thuban.org ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Peli de Halleux (PELI) Sent: Tuesday, 01 November 2005 07:21 To: users at lists.ironpython.com Subject: [IronPython] RTM build? Is there an ETA for a IronPython build against RTM? Thanks, Peli -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Tue Nov 1 21:24:09 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 1 Nov 2005 12:24:09 -0800 Subject: [IronPython] importing os module In-Reply-To: <14524135.1130861303970.JavaMail.root@mswamui-swiss.atl.sa.earthlink.net> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5295C69@df-foxhound-msg.exchange.corp.microsoft.com> It is one of our open design issues to work out in the (hopefully near) future. It would definitely be useful to be able to use C-based Python modules with IronPython in some way. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Gogins Sent: Tuesday, November 01, 2005 8:08 AM To: Discussion of IronPython Subject: Re: [IronPython] importing os module Why does it not play with C? Surely this would be immensely helpful. Regards, MIke -----Original Message----- From: "J. Merrill" Sent: Nov 1, 2005 10:06 AM To: Discussion of IronPython Subject: Re: [IronPython] importing os module IP does indeed "not play with C at all". The plan, I believe, is to re-create some common C-based Python libraries (with C# or in Python) to ease the porting. At 02:09 AM 11/1/2005, Liam Clarke wrote >Now, my question on os is, what does IronPython have against pipe() ? >Does IronPython not play with C at all? > >Regards, > >Liam Clarke > > >On 11/1/05, Martin Maly wrote: >> >> You can set sys.path to point to CPython's Lib directory which >> includes os >> module: >> >> >>> import sys >> >>> sys.path.append("C:\\Python24\Lib") >> >>> import os >> >>> os.name >> 'nt' >> >> You can even put the first 2 lines into your site.py (located in >> IronPython's Bin\lib directory) >> >> Martin >[snip] J. Merrill / Analytical Software Corp _______________________________________________ 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 jvm_cop at spamcop.net Tue Nov 1 21:02:03 2005 From: jvm_cop at spamcop.net (J. Merrill) Date: Tue, 01 Nov 2005 16:02:03 -0400 Subject: [IronPython] importing os module In-Reply-To: <14524135.1130861303970.JavaMail.root@mswamui-swiss.atl.sa. earthlink.net> Message-ID: <4.3.2.7.2.20051101155713.05402c20@mail.comcast.net> Others know more than I do, but writing a CPython module in C interacts very significantly with mechanisms that are internal to the Python interpreter, and needs to be involved with the reference-counting mechanism that's the basis of CPython's garbage collector (when IronPython uses the .Net collector and doesn't use reference counting). Also, a CPython C-coded module manipulates data structures that actually ARE the internal data structures of the interpreter. The IronPython interpreter shares none of those structures. There are also the usual .Net-notions that C is inherently unsafe and it would be much better if you could build IronPython apps in "100% managed code" (not yet possible IINM). Hopefully if I've said something wrong, someone who knows more will holler. At 12:08 PM 11/1/2005, Michael Gogins wrote >Why does it not play with C? Surely this would be immensely helpful. > >Regards, >MIke > >-----Original Message----- >From: "J. Merrill" >Sent: Nov 1, 2005 10:06 AM >To: Discussion of IronPython >Subject: Re: [IronPython] importing os module > >IP does indeed "not play with C at all". The plan, I believe, is to re-create some common C-based Python libraries (with C# or in Python) to ease the porting. > >At 02:09 AM 11/1/2005, Liam Clarke wrote >>Now, my question on os is, what does IronPython have against pipe() ? >>Does IronPython not play with C at all? >> >>Regards, >> >>Liam Clarke >> >> >>On 11/1/05, Martin Maly wrote: >>> >>> You can set sys.path to point to CPython's Lib directory which includes os >>> module: >>> >>> >>> import sys >>> >>> sys.path.append("C:\\Python24\Lib") >>> >>> import os >>> >>> os.name >>> 'nt' >>> >>> You can even put the first 2 lines into your site.py (located in >>> IronPython's Bin\lib directory) >>> >>> Martin >>[snip] J. Merrill / Analytical Software Corp From jvm_cop at spamcop.net Tue Nov 1 21:04:33 2005 From: jvm_cop at spamcop.net (J. Merrill) Date: Tue, 01 Nov 2005 16:04:33 -0400 Subject: [IronPython] Need help in learning. In-Reply-To: References: <4.3.2.7.2.20051101105245.053d7688@mail.comcast.net> Message-ID: <4.3.2.7.2.20051101160352.0512e740@mail.comcast.net> I didn't know that .Net 2 shipped -- I thought it wouldn't do so until VS2005 shipped, which isn't for a few days (or am I wrong about that?). At 12:16 PM 11/1/2005, Shawn Farkas wrote >True enough, however the MSDN docs should start to move over to the main MSDN site relatively soon now, since 2.0 has officially shipped. Msdn2.microsoft.com is their staging server to get pre-release stuff setup before it ships. J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shawn.Farkas at microsoft.com Tue Nov 1 22:21:06 2005 From: Shawn.Farkas at microsoft.com (Shawn Farkas) Date: Tue, 1 Nov 2005 13:21:06 -0800 Subject: [IronPython] Need help in learning. In-Reply-To: <4.3.2.7.2.20051101160352.0512e740@mail.comcast.net> Message-ID: MSDN subscribers can download VS 2005 as of October 27th, and that's the same day that the final build of the CLR went up for download. November 7th is the release date for non-MSDN subscribers. You can get the SDK and redist here: http://msdn.microsoft.com/netframework/downloads/updates/default.aspx -Shawn ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Tuesday, November 01, 2005 12:05 PM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. I didn't know that .Net 2 shipped -- I thought it wouldn't do so until VS2005 shipped, which isn't for a few days (or am I wrong about that?). At 12:16 PM 11/1/2005, Shawn Farkas wrote True enough, however the MSDN docs should start to move over to the main MSDN site relatively soon now, since 2.0 has officially shipped. Msdn2.microsoft.com is their staging server to get pre-release stuff setup before it ships. J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian at zope.com Tue Nov 1 22:27:10 2005 From: brian at zope.com (Brian Lloyd) Date: Tue, 1 Nov 2005 16:27:10 -0500 Subject: [IronPython] importing os module In-Reply-To: <4.3.2.7.2.20051101155713.05402c20@mail.comcast.net> Message-ID: <20051101212706.2BE693B8016@smtp.zope.com> > Others know more than I do, but writing a CPython module in C > interacts very significantly with mechanisms that are > internal to the Python interpreter, and needs to be involved > with the reference-counting mechanism that's the basis of > CPython's garbage collector (when IronPython uses the .Net > collector and doesn't use reference counting). Also, a > CPython C-coded module manipulates data structures that > actually ARE the internal data structures of the interpreter. > The IronPython interpreter shares none of those structures. Right - the fact that CPython encourages/forces you to work with structs, pointers, etc. directly is the real problem. If there were a truly 'abstract' interface for C extensions it would be much easier to contemplate a CLR (or other VM) abstraction layer. I bet the PyPy folks wish that were true as well ;) Brian Lloyd brian at zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com From Martin.Maly at microsoft.com Wed Nov 2 02:37:57 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 1 Nov 2005 17:37:57 -0800 Subject: [IronPython] Need help in learning. In-Reply-To: <4.3.2.7.2.20051101160352.0512e740@mail.comcast.net> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5295F2D@df-foxhound-msg.exchange.corp.microsoft.com> .NET Framework 2.0 did ship. It is available for download on microsoft download website: http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&DisplayLang=en Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Tuesday, November 01, 2005 12:05 PM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. I didn't know that .Net 2 shipped -- I thought it wouldn't do so until VS2005 shipped, which isn't for a few days (or am I wrong about that?). At 12:16 PM 11/1/2005, Shawn Farkas wrote True enough, however the MSDN docs should start to move over to the main MSDN site relatively soon now, since 2.0 has officially shipped. Msdn2.microsoft.com is their staging server to get pre-release stuff setup before it ships. J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From lattam at mac.com Wed Nov 2 05:59:07 2005 From: lattam at mac.com (Michael Latta) Date: Tue, 1 Nov 2005 20:59:07 -0800 Subject: [IronPython] How to do debugging for embedded usage In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F5295F2D@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <200511020459.jA24xjuW014565@mac.com> When I am using IronPython within my application (for scripting/extension) how do I support debugging? Is there an event in the engine when a break point is hit? How do I specify to the engine that there is a break point? I presume I need to provide an editor and such myself, as well as a UI for examining the run-time state? I presume I can use the stack walker for examining the stack? Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From ml.cyresse at gmail.com Wed Nov 2 08:50:28 2005 From: ml.cyresse at gmail.com (Liam Clarke) Date: Wed, 2 Nov 2005 20:50:28 +1300 Subject: [IronPython] importing os module In-Reply-To: <20051101212706.2BE693B8016@smtp.zope.com> References: <4.3.2.7.2.20051101155713.05402c20@mail.comcast.net> <20051101212706.2BE693B8016@smtp.zope.com> Message-ID: Ah pity. Anyone know of a .NET variant on the various popens()? I understand that CPython nt module uses the Win32 API to create pipes, but most .NET code I can find requires both processes to be running on the CLR and to manually connect to the pipe, which limits the versatility somewhat. I'm not sure how the CPython does it, as I'm not very good with C. Unless... just a question for anyone who might know the answer, are System.Console.In and Out per process, or shared across? i.e. Will redirecting In in one process redirect in another? Regards, Liam Clarke On 11/2/05, Brian Lloyd wrote: > > Others know more than I do, but writing a CPython module in C > > interacts very significantly with mechanisms that are > > internal to the Python interpreter, and needs to be involved > > with the reference-counting mechanism that's the basis of > > CPython's garbage collector (when IronPython uses the .Net > > collector and doesn't use reference counting). Also, a > > CPython C-coded module manipulates data structures that > > actually ARE the internal data structures of the interpreter. > > The IronPython interpreter shares none of those structures. > > Right - the fact that CPython encourages/forces you to work with > structs, pointers, etc. directly is the real problem. If there > were a truly 'abstract' interface for C extensions it would be > much easier to contemplate a CLR (or other VM) abstraction layer. > > I bet the PyPy folks wish that were true as well ;) > > > Brian Lloyd brian at zope.com > V.P. Engineering 540.361.1716 > Zope Corporation http://www.zope.com > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From Martin.Maly at microsoft.com Wed Nov 2 15:58:30 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 2 Nov 2005 06:58:30 -0800 Subject: [IronPython] How to do debugging for embedded usage In-Reply-To: <200511020459.jA24xjuW014565@mac.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5295FF7@df-foxhound-msg.exchange.corp.microsoft.com> It largely depends on how your Python scripts are written. If you use following format: engine.Execute("print "Hello") debugging is hard because IronPython has no source code to map debugging info to. On the other hand, if you have your scripts stored in the files and execute them via: engine.RunFile(fileName); then IronPython generates debug info and debugging is straightforward - attach debugger to your app and place breakpoint into the Python source file and things mostly work as you'd expect. There are some rough edges to be polished, but debugging this way is quite good already. Hope this helps Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Latta Sent: Tuesday, November 01, 2005 8:59 PM To: 'Discussion of IronPython' Subject: [IronPython] How to do debugging for embedded usage When I am using IronPython within my application (for scripting/extension) how do I support debugging? Is there an event in the engine when a break point is hit? How do I specify to the engine that there is a break point? I presume I need to provide an editor and such myself, as well as a UI for examining the run-time state? I presume I can use the stack walker for examining the stack? Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From alireza0 at gmail.com Wed Nov 2 17:41:33 2005 From: alireza0 at gmail.com (Alireza Moayerzadeh) Date: Wed, 2 Nov 2005 11:41:33 -0500 Subject: [IronPython] Working on bugs Message-ID: <60d327e90511020841u225e283em7e2147f1a9587694@mail.gmail.com> Hi all, I am new to GotDotNet workspaces. Is there any document on how to select bugs and how to submit fixes to the workspace? Thanks -- Alireza From lattam at mac.com Wed Nov 2 18:10:18 2005 From: lattam at mac.com (Michael Latta) Date: Wed, 2 Nov 2005 09:10:18 -0800 Subject: [IronPython] How to do debugging for embedded usage In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F5295FF7@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <200511021710.jA2HAnNo028930@mac.com> Is there any chance of supporting debugging for the first case? I would rather persist the script sources with the document/repository rather than as files, though I could cache them on disk if needed. Is there an in-process debugging interface I can use to support an embedded debugger rather than requiring VS be installed for the end-user scripting case? For full fledge plug-ins VS would be good, but for true end-users something more targeted would be better. Michael _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Wednesday, November 02, 2005 6:59 AM To: Discussion of IronPython Subject: Re: [IronPython] How to do debugging for embedded usage It largely depends on how your Python scripts are written. If you use following format: engine.Execute("print "Hello") debugging is hard because IronPython has no source code to map debugging info to. On the other hand, if you have your scripts stored in the files and execute them via: engine.RunFile(fileName); then IronPython generates debug info and debugging is straightforward - attach debugger to your app and place breakpoint into the Python source file and things mostly work as you'd expect. There are some rough edges to be polished, but debugging this way is quite good already. Hope this helps Martin _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Latta Sent: Tuesday, November 01, 2005 8:59 PM To: 'Discussion of IronPython' Subject: [IronPython] How to do debugging for embedded usage When I am using IronPython within my application (for scripting/extension) how do I support debugging? Is there an event in the engine when a break point is hit? How do I specify to the engine that there is a break point? I presume I need to provide an editor and such myself, as well as a UI for examining the run-time state? I presume I can use the stack walker for examining the stack? Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From jddoty at gmail.com Wed Nov 2 23:13:18 2005 From: jddoty at gmail.com (John Doty) Date: Wed, 2 Nov 2005 14:13:18 -0800 Subject: [IronPython] Problem with keyword parameters for built-in types Message-ID: I'm sorry if this is a known limitation, but the following doesn't work with IronPython 0.9.3: class MyClass: def __init__(self, testValue): self.testValue = testValue def _getValue(self): return self.testValue value = property(_getValue, doc="This is documentation") obj = MyClass("Hello!") print obj.value It generates the following exception: Traceback (most recent call last): at __main__.Initialize() in C:\IronPython\test.py:line 1 at __main__.MyClass$maker0() in C:\IronPython\test.py:line 7 TypeError: can't set arbitrary attributes on built-in type property I just thought I'd point it out. thanks, john -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Thu Nov 3 05:20:09 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 2 Nov 2005 20:20:09 -0800 Subject: [IronPython] Working on bugs In-Reply-To: <60d327e90511020841u225e283em7e2147f1a9587694@mail.gmail.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5334A63@df-foxhound-msg.exchange.corp.microsoft.com> We are actually not currently accepting code contributions or patches into the IronPython core. What is ultimately much more valuable to us is a self-contained simple repro of the bug or report of the feature missing. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Alireza Moayerzadeh Sent: Wednesday, November 02, 2005 8:42 AM To: Discussion of IronPython Subject: [IronPython] Working on bugs Hi all, I am new to GotDotNet workspaces. Is there any document on how to select bugs and how to submit fixes to the workspace? Thanks -- Alireza _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From husfloen at gmail.com Thu Nov 3 07:22:30 2005 From: husfloen at gmail.com (Patrik Husfloen) Date: Thu, 3 Nov 2005 07:22:30 +0100 Subject: [IronPython] Console for WinForms In-Reply-To: References: Message-ID: <4bcbf07d0511022222u2b4d70d0l1f234b8d115a79b@mail.gmail.com> Haven't tried it from IP but this [1] is the closest I've found. /Patrik [1] http://www.codeproject.com/csharp/CommandBar.asp On 10/31/05, Peli de Halleux (PELI) wrote: > > Is there a plan to add a WinForms console control in the IronPython? I > stumboled on this problem last week and it is suprisingly hard to get a > winform control to act as a console app! > From ml.cyresse at gmail.com Thu Nov 3 11:25:17 2005 From: ml.cyresse at gmail.com (Liam Clarke) Date: Thu, 3 Nov 2005 23:25:17 +1300 Subject: [IronPython] Alternative to ironpythonconsole.exe Message-ID: ...But, it requires CPython and wxPython for the time being. It's essentially a GUI front-end around a pipe to IronPythonConsole, it's just prettier than a dos box. A screenshot is here. http://silence.decivex.net/imgs/maws.png I intend to redo it entirely in IronPython and WFP once I figure out how, unless an official one comes out, in which case, I use that, but in the meantime, once I've sat and had a think about how to replicate popen4 in .NET or approach it differently, I'm going to beaver on, and hopefully get some autocompletion happening with that Reflection stuff. If anyone has Python 2.4 & wxPython 2.6 installed and would like the above to make poking IPython nicer looking, just let me know. (Oh, and I thought that the .PYC icon was a good colour for an iron python...) Regards, Liam Clarke From kfarmer at thuban.org Thu Nov 3 11:33:49 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 3 Nov 2005 02:33:49 -0800 Subject: [IronPython] Alternative to ironpythonconsole.exe Message-ID: Try System.Diagnostics.Process ? http://www.csharphelp.com/archives/archive210.html ----- 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 Liam Clarke in the meantime, once I've sat and had a think about how to replicate popen4 in .NET or approach it differently, I'm going to beaver on, and From kfarmer at thuban.org Thu Nov 3 13:38:03 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 3 Nov 2005 04:38:03 -0800 Subject: [IronPython] Alternative to ironpythonconsole.exe Message-ID: Liam -- Email me if you're interested in a real quick shell I just wrote up. It's about 120 lines of user code at the moment, and doesn't do any colors or history, but it should give you a start. ----- Keith J. Farmer // kfarmer at thuban.org From Martin.Maly at microsoft.com Thu Nov 3 22:54:56 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 3 Nov 2005 13:54:56 -0800 Subject: [IronPython] IronPython 0.9.4 released Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5334DC1@df-foxhound-msg.exchange.corp.microsoft.com> Hello IronPython community, we have just released IronPython 0.9.4. The biggest change is implementation of static compilation (IronPython.Hosting.Compiler), a component that compiles multiple sources into the single executable. As a response to requests we have been getting recently, we are also including an IronPython tutorial with the 0.9.4 release. Check out the Tutorial directory! Since the .NET Frameworks 2.0 has released and is publicly available for download, IronPython is now built and depends on the final release of .NET Frameworks 2.0. More improvements include: * __del__ is supported on old style classes. * time.time() is fixed to report time correctly * few smaller parser fixes (try and print statement parsing) * various module kinds (built-in, python module and "sys") now have the same type * ReflectOptimizer doesn't handle System.Single fix * string fixes - we added missing methods and fixed those that didn't work as expected. We also enabled some more regression tests to run. Test_string runs without changes and few with variety of changes to allow us to run the test while we add missing features and fix bugs: test_str, test_set, test_exceptions, test_grammar. There are many of you who contributed to this release and we thank you: Nicholas Jacobson, Anthony Tarlano, Michael Shilman, Chris Trimble, Ray Djajadinata You can download the 0.9.4 release from: http://www.microsoft.com/downloads/details.aspx?FamilyID=ba268a8e-0d79-4245-b14b-9a89395654da&displaylang=en Thanks and keep in touch The IronPython team -------------- next part -------------- An HTML attachment was scrubbed... URL: From jddoty at gmail.com Thu Nov 3 23:15:07 2005 From: jddoty at gmail.com (John Doty) Date: Thu, 3 Nov 2005 14:15:07 -0800 Subject: [IronPython] Problem with keyword parameters for built-in types Message-ID: I'm sorry if this is a known limitation, but the following doesn't work with IronPython 0.9.3: class MyClass: def __init__(self, testValue): self.testValue = testValue def _getValue(self): return self.testValue value = property(_getValue, doc="This is documentation") obj = MyClass("Hello!") print obj.value It generates the following exception: Traceback (most recent call last): at __main__.Initialize() in C:\IronPython\test.py:line 1 at __main__.MyClass$maker0() in C:\IronPython\test.py:line 7 TypeError: can't set arbitrary attributes on built-in type property I just thought I'd point it out. (In addition, running this in IronPythonConsole.exe 0.9.4 gives me an unhandled exception, as opposed to the nice exception-with-stack-trace that I used to get, and expect from CPython development. Is this on purpose?) thanks, john -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Fri Nov 4 00:18:00 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 3 Nov 2005 15:18:00 -0800 Subject: [IronPython] IronPython 0.9.4 released References: <5C0A6F919D675745BB1DBA7412DB68F5334DC1@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: Does the static compilation include support for producing .NET libraries (as opposed to a sequence of snippets), or is that still being worked on? ________________________________ From: users-bounces at lists.ironpython.com on behalf of Martin Maly Sent: Thu 11/3/2005 1:54 PM To: 'Discussion of IronPython' Subject: [IronPython] IronPython 0.9.4 released Hello IronPython community, we have just released IronPython 0.9.4. The biggest change is implementation of static compilation (IronPython.Hosting.Compiler), a component that compiles multiple sources into the single executable. -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3687 bytes Desc: not available URL: From breaman at gmail.com Fri Nov 4 06:15:39 2005 From: breaman at gmail.com (Michael Stokesbary) Date: Thu, 3 Nov 2005 21:15:39 -0800 Subject: [IronPython] Interactive WinFX design with IronPython Message-ID: <882b055f0511032115h63a0472eq8bf1ab72ab63eb36@mail.gmail.com> Hey all - I was just wondering if anyone got the chance to see Jim's PDC 05 presentation dealing with the .NET CLR and dynamic languages. In the presentation, he was able to interactively create a WinFX window and add components to it on the fly. I have tried doing this myself only to run in to issues. I do the following: w = System.Windows.Window() w.Show() And after doing this, the window does appear, but it seems to be in a blocking state. Then as I add components to it, nothing gets rendered. In Jim's presentation, he was able to call w.Show(), then add a button, then resize the window and just modify it on the fly. Has anyone else been able to do something like this? I am using IronPython 0.9.4 on the .NET framework version 2.0.50215.322 and the September release of WinFX. Yes, I can create the whole window and add all the components and then call ShowDialog() and all works fine (the command prompt is blocked, but at least I can interact with the window). If I just call .Show(), the command prompt is still active, but the window is useless. Any ideas? Stokes -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Fri Nov 4 06:19:48 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 3 Nov 2005 21:19:48 -0800 Subject: [IronPython] Interactive WinFX design with IronPython In-Reply-To: <882b055f0511032115h63a0472eq8bf1ab72ab63eb36@mail.gmail.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F533507D@df-foxhound-msg.exchange.corp.microsoft.com> The reason for this is that the console thread is waiting for console input and does not pump messages (necessary to redraw the windows). Check out the tutorial we shipped with IronPython 0.9.4. There is file "avalon.py" in the tutorial directory. in your console do: from avalon import * The avalon.py sets up the console to run message pump and things will work. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stokesbary Sent: Thursday, November 03, 2005 9:16 PM To: users at lists.ironpython.com Subject: [IronPython] Interactive WinFX design with IronPython Hey all - I was just wondering if anyone got the chance to see Jim's PDC 05 presentation dealing with the .NET CLR and dynamic languages. In the presentation, he was able to interactively create a WinFX window and add components to it on the fly. I have tried doing this myself only to run in to issues. I do the following: w = System.Windows.Window() w.Show() And after doing this, the window does appear, but it seems to be in a blocking state. Then as I add components to it, nothing gets rendered. In Jim's presentation, he was able to call w.Show(), then add a button, then resize the window and just modify it on the fly. Has anyone else been able to do something like this? I am using IronPython 0.9.4 on the .NET framework version 2.0.50215.322 and the September release of WinFX. Yes, I can create the whole window and add all the components and then call ShowDialog() and all works fine (the command prompt is blocked, but at least I can interact with the window). If I just call .Show(), the command prompt is still active, but the window is useless. Any ideas? Stokes -------------- next part -------------- An HTML attachment was scrubbed... URL: From ml.cyresse at gmail.com Fri Nov 4 06:20:17 2005 From: ml.cyresse at gmail.com (Liam Clarke) Date: Fri, 4 Nov 2005 18:20:17 +1300 Subject: [IronPython] Alternative to ironpythonconsole.exe In-Reply-To: References: Message-ID: Hi, Thanks so much for that Keith. I'd have never have thought of subclassing Process. And yes, please, any examples would be fantastic. Regards, Liam Clarke On 11/4/05, Keith J. Farmer wrote: > Liam -- > Email me if you're interested in a real quick shell I just wrote up. > It's about 120 lines of user code at the moment, and doesn't do any > colors or history, but it should give you a start. > ----- > Keith J. Farmer // kfarmer at thuban.org > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From ml.cyresse at gmail.com Fri Nov 4 06:37:45 2005 From: ml.cyresse at gmail.com (Liam Clarke) Date: Fri, 4 Nov 2005 18:37:45 +1300 Subject: [IronPython] Alternative to ironpythonconsole.exe In-Reply-To: References: Message-ID: Oh deary me... I looked at that sample code you linked to. He's not even subclassing, it's all standard .NET objects! On 11/4/05, Liam Clarke wrote: > Hi, > > Thanks so much for that Keith. I'd have never have thought of > subclassing Process. > And yes, please, any examples would be fantastic. > > Regards, > > Liam Clarke > > On 11/4/05, Keith J. Farmer wrote: > > Liam -- > > Email me if you're interested in a real quick shell I just wrote up. > > It's about 120 lines of user code at the moment, and doesn't do any > > colors or history, but it should give you a start. > > ----- > > Keith J. Farmer // kfarmer at thuban.org > > > > _______________________________________________ > > users mailing list > > users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From breaman at gmail.com Fri Nov 4 07:01:16 2005 From: breaman at gmail.com (Michael Stokesbary) Date: Thu, 3 Nov 2005 22:01:16 -0800 Subject: [IronPython] Interactive WinFX design with IronPython In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F533507D@df-foxhound-msg.exchange.corp.microsoft.com> References: <882b055f0511032115h63a0472eq8bf1ab72ab63eb36@mail.gmail.com> <5C0A6F919D675745BB1DBA7412DB68F533507D@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <882b055f0511032201v43435edm190e8696fe26c5fe@mail.gmail.com> Thank you Martin. That explains the "from avalon import *" part of his demo as well :) Stokes On 11/3/05, Martin Maly wrote: > > The reason for this is that the console thread is waiting for console > input and does not pump messages (necessary to redraw the windows). > Check out the tutorial we shipped with IronPython 0.9.4. There is file " > avalon.py" in the tutorial directory. in your console do: > from avalon import * > The avalon.py sets up the console to run message pump and things will > work. > Martin > > ------------------------------ > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Michael Stokesbary > *Sent:* Thursday, November 03, 2005 9:16 PM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] Interactive WinFX design with IronPython > > Hey all - > I was just wondering if anyone got the chance to see Jim's PDC 05 > presentation dealing with the .NET CLR and dynamic languages. In the > presentation, he was able to interactively create a WinFX window and add > components to it on the fly. I have tried doing this myself only to run in > to issues. I do the following: > w = System.Windows.Window() > w.Show() > And after doing this, the window does appear, but it seems to be in a > blocking state. Then as I add components to it, nothing gets rendered. In > Jim's presentation, he was able to call w.Show(), then add a button, then > resize the window and just modify it on the fly. Has anyone else been able > to do something like this? I am using IronPython 0.9.4 on the .NET > framework version 2.0.50215.322 and the September release of WinFX. Yes, I > can create the whole window and add all the components and then call > ShowDialog() and all works fine (the command prompt is blocked, but at least > I can interact with the window). If I just call .Show(), the command prompt > is still active, but the window is useless. > Any ideas? > Stokes > > _______________________________________________ > 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 kfarmer at thuban.org Fri Nov 4 07:42:56 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Thu, 3 Nov 2005 22:42:56 -0800 Subject: [IronPython] Alternative to ironpythonconsole.exe Message-ID: http://www.thuban.org/projects Liam: I tried sending the zip to you directly, but gmail doesn't seem to like that. Besides, since others have asked, I'll just post it on the old, decrepit Zope site. ----- Keith J. Farmer // kfarmer at thuban.org From alcarx at gmail.com Fri Nov 4 12:18:23 2005 From: alcarx at gmail.com (Angelo Xu) Date: Fri, 4 Nov 2005 19:18:23 +0800 Subject: [IronPython] How to do debugging for embedded usage In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F5295FF7@df-foxhound-msg.exchange.corp.microsoft.com> References: <200511020459.jA24xjuW014565@mac.com> <5C0A6F919D675745BB1DBA7412DB68F5295FF7@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: why engine.ExecuteFile(fileName) can't be debuged 2005/11/2, Martin Maly : > > It largely depends on how your Python scripts are written. If you use > following format: > engine.Execute("print "Hello") > debugging is hard because IronPython has no source code to map debugging > info to. > On the other hand, if you have your scripts stored in the files and > execute them via: > engine.RunFile(fileName); > then IronPython generates debug info and debugging is straightforward - > attach debugger to your app and place breakpoint into the Python source file > and things mostly work as you'd expect. There are some rough edges to be > polished, but debugging this way is quite good already. > Hope this helps > Martin > > ------------------------------ > *From:* users-bounces at lists.ironpython.com [mailto:users-bounces at lists. > ironpython.com] *On Behalf Of *Michael Latta > *Sent:* Tuesday, November 01, 2005 8:59 PM > *To:* 'Discussion of IronPython' > *Subject:* [IronPython] How to do debugging for embedded usage > > When I am using IronPython within my application (for > scripting/extension) how do I support debugging? Is there an event in the > engine when a break point is hit? How do I specify to the engine that there > is a break point? I presume I need to provide an editor and such myself, as > well as a UI for examining the run-time state? I presume I can use the stack > walker for examining the stack? > Michael > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > -- The shift of focus (to patterns) will have a profound and enduring effect on the way we write programs. --Ward Cunningham and Ralph Johnson -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Fri Nov 4 16:08:53 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 4 Nov 2005 07:08:53 -0800 Subject: [IronPython] How to do debugging for embedded usage In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F53350E3@df-foxhound-msg.exchange.corp.microsoft.com> Because it it generated as a code snippet into the snippet assembly which doesn't have association with the source file and therefore the debugger cannot make the connection between the code and the source file. I'm going to look into whether this could get changed/fixed. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Angelo Xu Sent: Friday, November 04, 2005 3:18 AM To: Discussion of IronPython Subject: Re: [IronPython] How to do debugging for embedded usage why engine.ExecuteFile(fileName) can't be debuged 2005/11/2, Martin Maly : It largely depends on how your Python scripts are written. If you use following format: engine.Execute("print "Hello") debugging is hard because IronPython has no source code to map debugging info to. On the other hand, if you have your scripts stored in the files and execute them via: engine.RunFile(fileName); then IronPython generates debug info and debugging is straightforward - attach debugger to your app and place breakpoint into the Python source file and things mostly work as you'd expect. There are some rough edges to be polished, but debugging this way is quite good already. Hope this helps Martin ________________________________ From: users-bounces at lists. ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Latta Sent: Tuesday, November 01, 2005 8:59 PM To: 'Discussion of IronPython' Subject: [IronPython] How to do debugging for embedded usage When I am using IronPython within my application (for scripting/extension) how do I support debugging? Is there an event in the engine when a break point is hit? How do I specify to the engine that there is a break point? I presume I need to provide an editor and such myself, as well as a UI for examining the run-time state? I presume I can use the stack walker for examining the stack? Michael _______________________________________________ users mailing list users at lists. ironpython.com http://lists. ironpython.com/listinfo.cgi/users-ironpython.com -- The shift of focus (to patterns) will have a profound and enduring effect on the way we write programs. --Ward Cunningham and Ralph Johnson -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Fri Nov 4 18:38:03 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 4 Nov 2005 09:38:03 -0800 Subject: [IronPython] Need Help To Start Learning. In-Reply-To: <47a726d60510130546p7a326827g70b258b02a59991f@mail.gmail.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5335175@df-foxhound-msg.exchange.corp.microsoft.com> In 0.9.4 release of IronPython (yesterday) we include fairly extensive tutorial that would be an awesome place for you to start playing with. Check out the Tutorial directory in the IronPython distribution. I hope you find it useful. And, of course, we are interested in hearing any feedback that you may have. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Rajesh Sathyamoorthy Sent: Thursday, October 13, 2005 5:46 AM To: users at lists.ironpython.com Subject: [IronPython] Need Help To Start Learning. Hi, I am familiar with python but not with .NET. I also do not know any other programming language like C# and VB so following tutorials can be difficult. What steps should I take to start learning how to use ironpython? Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.kobalczyk at softwaremind.pl Fri Nov 4 19:12:59 2005 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Fri, 04 Nov 2005 19:12:59 +0100 Subject: [IronPython] Is this memory leak ? Message-ID: <436BA4AB.3030706@softwaremind.pl> Hi, We just noticed a serious memory leak in our server application. It happens after we execute some code that uses extensively dynamic scripting with IronPython. After one run the allocation grows from 70MB to more then 500MB. I've investigated the memory heap using WinDbg and all paths lead to the IronPython.Objects.Frame. All the variables that I passed to the PythonEngine are kept in the dictionary inside these Frames. These Frames in turn are kept in some static object[] array. In attached project I run in a loop some trivial script using engine Execute method. You can attach to it using WinDbg and check that after the loop completes there are 100 instances of Frame. Here is one sample from the gcroot command: 0:003> !gcroot 00b37918 Note: Roots found on stacks may be false positives. Run "!help gcroot" for more info. Scan Thread 0 OSTHread 13dc Scan Thread 2 OSTHread 17fc DOMAIN(00153570):HANDLE(Pinned):9313e4:Root:01ab4480(System.Object[])->00b37918(IronPython.Objects.Frame) I also tried this with the evaluate method and the effect was the same. Only with (my favorite) FastEval option the memory is not allocated. So this could mean this leak occurs during code generation. I hope this is something that can be fixed quickly as we need to deploy this solution to production. Note: I still work on .NET Beta 2 and IronPython 0.9.3. I also run the test on the 0.9.4 version but results were the same. Thanks in Advance, Szymon Kobalczyk. PS: I post this mail again cause previously it had to large attachment and was held for approval by moderator. -------------- next part -------------- A non-text attachment was scrubbed... Name: IronPythonMemory.zip Type: application/x-zip-compressed Size: 3006 bytes Desc: not available URL: From s.kobalczyk at softwaremind.pl Fri Nov 4 14:52:25 2005 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Fri, 04 Nov 2005 14:52:25 +0100 Subject: [IronPython] Is this memory leak ? Message-ID: <436B6799.8000908@softwaremind.pl> Hi, We just noticed a serious memory leak in our server application. It happens after we execute some code that uses extensively dynamic scripting with IronPython. After one run the allocation grows from 70MB to more then 500MB. I've investigated the memory heap using WinDbg and all paths lead to the IronPython.Objects.Frame. All the variables that I passed to the PythonEngine are kept in the dictionary inside these Frames. These Frames in turn are kept in some static object[] array. In attached project I run in a loop some trivial script using engine Execute method. You can attach to it using WinDbg and check that after the loop completes there are 100 instances of Frame. Here is one sample from the gcroot command: 0:003> !gcroot 00b37918 Note: Roots found on stacks may be false positives. Run "!help gcroot" for more info. Scan Thread 0 OSTHread 13dc Scan Thread 2 OSTHread 17fc DOMAIN(00153570):HANDLE(Pinned):9313e4:Root:01ab4480(System.Object[])->00b37918(IronPython.Objects.Frame) I also tried this with the evaluate method and the effect was the same. Only with (my favorite) FastEval option the memory is not allocated. So this could mean this leak occurs during code generation. I hope this is something that can be fixed quickly as we need to deploy this solution to production. Note: I still work on .NET Beta 2 and IronPython 0.9.3. I also run the test on the 0.9.4 version but results were the same. Thanks in Advance, Szymon Kobalczyk. -------------- next part -------------- A non-text attachment was scrubbed... Name: IronPythonMemory.zip Type: application/x-zip-compressed Size: 168866 bytes Desc: not available URL: From jvm_cop at spamcop.net Fri Nov 4 20:41:04 2005 From: jvm_cop at spamcop.net (J. Merrill) Date: Fri, 04 Nov 2005 15:41:04 -0400 Subject: [IronPython] Need help in learning. In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F5295F2D@df-foxhound-msg.exc hange.corp.microsoft.com> References: <4.3.2.7.2.20051101160352.0512e740@mail.comcast.net> Message-ID: <4.3.2.7.2.20051104153829.01632bf0@mail.comcast.net> I'm a bit confused (not for the first time). That download page now says on it "Date published: 11/3/2005" -- but you sent this on 11/1. Has it been patched already!?! At 09:37 PM 11/1/2005, Martin Maly wrote >.NET Framework 2.0 did ship. It is available for download on microsoft download website: >http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&DisplayLang=en > >Martin J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Fri Nov 4 22:04:11 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 4 Nov 2005 13:04:11 -0800 Subject: [IronPython] Need help in learning. In-Reply-To: <4.3.2.7.2.20051104153829.01632bf0@mail.comcast.net> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F533532E@df-foxhound-msg.exchange.corp.microsoft.com> Good question. When I wrote the email 11/1 I actually browsed to the address below and it was all up and running. The underlying .NET runtime is the same. Instead, I would guess that it was the download page that got slightly modified. Either way, the .NET 2.0 is out there for public download and IronPython that we shipped yesterday is built using that very runtime. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Friday, November 04, 2005 11:41 AM To: Discussion of IronPython Subject: Re: [IronPython] Need help in learning. I'm a bit confused (not for the first time). That download page now says on it "Date published: 11/3/2005" -- but you sent this on 11/1. Has it been patched already!?! At 09:37 PM 11/1/2005, Martin Maly wrote .NET Framework 2.0 did ship. It is available for download on microsoft download website: http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&DisplayLang=en Martin J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.kobalczyk at softwaremind.pl Fri Nov 4 23:17:51 2005 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Fri, 04 Nov 2005 23:17:51 +0100 Subject: [IronPython] Alternative to ironpythonconsole.exe In-Reply-To: References: Message-ID: <436BDE0F.1000204@softwaremind.pl> Hello all, Attached is my attempt to create console for IronPython in WinForms. It uses the RunInteractive() method on PythonEngine and provides itself as an IConsole. Hence, this one runs in a single process. The RunInteractive executes it's own loop and I had to run it in background thread so it doesn't block the UI. The requests for input and output messages are marshaled between these two threads. Unfortunately I wasn't able to redirect standard console output to my windows so you want see any results that are normally shown on the console. So what's the point then? Well, it shows some way to run and provide input to the engine and I hope someone already has a solution to redirect outputs. Oh, and it supports history ;-) Szymon Kobalczyk. -------------- next part -------------- A non-text attachment was scrubbed... Name: IronPythonConsole.zip Type: application/x-zip-compressed Size: 13597 bytes Desc: not available URL: From Martin.Maly at microsoft.com Fri Nov 4 23:19:02 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 4 Nov 2005 14:19:02 -0800 Subject: [IronPython] Is this memory leak ? In-Reply-To: <436BA4AB.3030706@softwaremind.pl> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F53353CC@df-foxhound-msg.exchange.corp.microsoft.com> Unfortunately, this is a known issue that we have on our to-do list. The code generated by eval is not generated using lightweight codegen and as such it is not garbage collected. As the result, you see the memory effects you are describing. We will definitely fix this by our 1.0 release, most likely even before Beta and I'll try to find some time to look at this even before then depending on my time. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Szymon Kobalczyk Sent: Friday, November 04, 2005 10:13 AM To: users at lists.ironpython.com Subject: [IronPython] Is this memory leak ? Hi, We just noticed a serious memory leak in our server application. It happens after we execute some code that uses extensively dynamic scripting with IronPython. After one run the allocation grows from 70MB to more then 500MB. I've investigated the memory heap using WinDbg and all paths lead to the IronPython.Objects.Frame. All the variables that I passed to the PythonEngine are kept in the dictionary inside these Frames. These Frames in turn are kept in some static object[] array. In attached project I run in a loop some trivial script using engine Execute method. You can attach to it using WinDbg and check that after the loop completes there are 100 instances of Frame. Here is one sample from the gcroot command: 0:003> !gcroot 00b37918 Note: Roots found on stacks may be false positives. Run "!help gcroot" for more info. Scan Thread 0 OSTHread 13dc Scan Thread 2 OSTHread 17fc DOMAIN(00153570):HANDLE(Pinned):9313e4:Root:01ab4480(System.Object[])->00b37918(IronPython.Objects.Frame) I also tried this with the evaluate method and the effect was the same. Only with (my favorite) FastEval option the memory is not allocated. So this could mean this leak occurs during code generation. I hope this is something that can be fixed quickly as we need to deploy this solution to production. Note: I still work on .NET Beta 2 and IronPython 0.9.3. I also run the test on the 0.9.4 version but results were the same. Thanks in Advance, Szymon Kobalczyk. PS: I post this mail again cause previously it had to large attachment and was held for approval by moderator. From s.kobalczyk at softwaremind.pl Fri Nov 4 23:29:39 2005 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Fri, 04 Nov 2005 23:29:39 +0100 Subject: [IronPython] Is this memory leak ? In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F53353CC@df-foxhound-msg.exchange.corp.microsoft.com> References: <5C0A6F919D675745BB1DBA7412DB68F53353CC@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <436BE0D3.4070603@softwaremind.pl> But do you have any workaround or maybe some recommendations how to handle this. You say that eval doesn't use LCG, so is there any other way to use IP that would use it? Or maybe there is a way to compile the script snipets only once and reuse them as most of the time they stay unchanged? Any help would be mostly appreciated as now we highly depend on this code. Szymon Martin Maly wrote: >Unfortunately, this is a known issue that we have on our to-do list. >The code generated by eval is not generated using lightweight codegen and as such it is not garbage collected. As the result, you see the memory effects you are describing. >We will definitely fix this by our 1.0 release, most likely even before Beta and I'll try to find some time to look at this even before then depending on my time. > >Martin > >-----Original Message----- >From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Szymon Kobalczyk >Sent: Friday, November 04, 2005 10:13 AM >To: users at lists.ironpython.com >Subject: [IronPython] Is this memory leak ? > >Hi, > >We just noticed a serious memory leak in our server application. It happens after we execute some code that uses extensively dynamic scripting with IronPython. After one run the allocation grows from 70MB to more then 500MB. > >I've investigated the memory heap using WinDbg and all paths lead to the IronPython.Objects.Frame. All the variables that I passed to the PythonEngine are kept in the dictionary inside these Frames. These Frames in turn are kept in some static object[] array. > >In attached project I run in a loop some trivial script using engine Execute method. You can attach to it using WinDbg and check that after the loop completes there are 100 instances of Frame. Here is one sample from the gcroot command: > >0:003> !gcroot 00b37918 >Note: Roots found on stacks may be false positives. Run "!help gcroot" for more info. >Scan Thread 0 OSTHread 13dc >Scan Thread 2 OSTHread 17fc >DOMAIN(00153570):HANDLE(Pinned):9313e4:Root:01ab4480(System.Object[])->00b37918(IronPython.Objects.Frame) > >I also tried this with the evaluate method and the effect was the same. >Only with (my favorite) FastEval option the memory is not allocated. So this could mean this leak occurs during code generation. > >I hope this is something that can be fixed quickly as we need to deploy this solution to production. > >Note: I still work on .NET Beta 2 and IronPython 0.9.3. I also run the test on the 0.9.4 version but results were the same. > >Thanks in Advance, >Szymon Kobalczyk. > > >PS: I post this mail again cause previously it had to large attachment and was held for approval by moderator. > > > > -- Software Mind *Software Mind Sp z oo* Bociana 22A 31-231 Krak?w Poland Tel. (+48-12) 6145490 Fax: (+48-12) 6145170 s.kobalczyk at softwaremind.pl www.softwaremind.pl *Szymon Kobalczyk* Software Developer This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. From Martin.Maly at microsoft.com Fri Nov 4 23:35:26 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 4 Nov 2005 14:35:26 -0800 Subject: [IronPython] Is this memory leak ? In-Reply-To: <436BE0D3.4070603@softwaremind.pl> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F53353F1@df-foxhound-msg.exchange.corp.microsoft.com> Yes, you can precompile the code snippets. For example, the code below doesn't 'leak'. Depending how dynamic your scripting is, this may not help always, but hopefully some: x = compile("2+2", "", "eval") for i in xrange(123456789): eval(x) Martin -----Original Message----- From: Szymon Kobalczyk [mailto:s.kobalczyk at softwaremind.pl] Sent: Friday, November 04, 2005 2:30 PM To: Martin Maly; users at lists.ironpython.com Subject: Re: [IronPython] Is this memory leak ? But do you have any workaround or maybe some recommendations how to handle this. You say that eval doesn't use LCG, so is there any other way to use IP that would use it? Or maybe there is a way to compile the script snipets only once and reuse them as most of the time they stay unchanged? Any help would be mostly appreciated as now we highly depend on this code. Szymon Martin Maly wrote: >Unfortunately, this is a known issue that we have on our to-do list. >The code generated by eval is not generated using lightweight codegen and as such it is not garbage collected. As the result, you see the memory effects you are describing. >We will definitely fix this by our 1.0 release, most likely even before Beta and I'll try to find some time to look at this even before then depending on my time. > >Martin > >-----Original Message----- >From: users-bounces at lists.ironpython.com >[mailto:users-bounces at lists.ironpython.com] On Behalf Of Szymon >Kobalczyk >Sent: Friday, November 04, 2005 10:13 AM >To: users at lists.ironpython.com >Subject: [IronPython] Is this memory leak ? > >Hi, > >We just noticed a serious memory leak in our server application. It happens after we execute some code that uses extensively dynamic scripting with IronPython. After one run the allocation grows from 70MB to more then 500MB. > >I've investigated the memory heap using WinDbg and all paths lead to the IronPython.Objects.Frame. All the variables that I passed to the PythonEngine are kept in the dictionary inside these Frames. These Frames in turn are kept in some static object[] array. > >In attached project I run in a loop some trivial script using engine Execute method. You can attach to it using WinDbg and check that after the loop completes there are 100 instances of Frame. Here is one sample from the gcroot command: > >0:003> !gcroot 00b37918 >Note: Roots found on stacks may be false positives. Run "!help gcroot" for more info. >Scan Thread 0 OSTHread 13dc >Scan Thread 2 OSTHread 17fc >DOMAIN(00153570):HANDLE(Pinned):9313e4:Root:01ab4480(System.Object[])-> >00b37918(IronPython.Objects.Frame) > >I also tried this with the evaluate method and the effect was the same. >Only with (my favorite) FastEval option the memory is not allocated. So this could mean this leak occurs during code generation. > >I hope this is something that can be fixed quickly as we need to deploy this solution to production. > >Note: I still work on .NET Beta 2 and IronPython 0.9.3. I also run the test on the 0.9.4 version but results were the same. > >Thanks in Advance, >Szymon Kobalczyk. > > >PS: I post this mail again cause previously it had to large attachment and was held for approval by moderator. > > > > -- Software Mind *Software Mind Sp z oo* Bociana 22A 31-231 Krak?w Poland Tel. (+48-12) 6145490 Fax: (+48-12) 6145170 s.kobalczyk at softwaremind.pl www.softwaremind.pl *Szymon Kobalczyk* Software Developer This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, retention, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. Also, email is susceptible to data corruption, interception, tampering, unauthorized amendment and viruses. We only send and receive emails on the basis that we are not liable for any such corruption, interception, tampering, amendment or viruses or any consequence thereof. From s.kobalczyk at softwaremind.pl Fri Nov 4 23:47:37 2005 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Fri, 04 Nov 2005 23:47:37 +0100 Subject: [IronPython] Is this memory leak ? In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F53353F1@df-foxhound-msg.exchange.corp.microsoft.com> References: <5C0A6F919D675745BB1DBA7412DB68F53353F1@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <436BE509.6040801@softwaremind.pl> I need to be able to at least compile the snippet from the C# code and then reuse it multiple times. I noticed that the PythonEngine.Execute() method does something along these lines: public void Execute(string text) { Parser p = Parser.fromString(text); Stmt s = p.parseFileInput(); FrameCode code = OutputGenerator.GenerateSnippet(s, "input", true); code.Run(new Frame(_module)); } If I can somehow hold this FrameCode object and the execute it over and over on the same module would it help? Szymon. Martin Maly wrote: >Yes, you can precompile the code snippets. For example, the code below doesn't 'leak'. Depending how dynamic your scripting is, this may not help always, but hopefully some: > >x = compile("2+2", "", "eval") >for i in xrange(123456789): > eval(x) > >Martin > >-----Original Message----- >From: Szymon Kobalczyk [mailto:s.kobalczyk at softwaremind.pl] >Sent: Friday, November 04, 2005 2:30 PM >To: Martin Maly; users at lists.ironpython.com >Subject: Re: [IronPython] Is this memory leak ? > >But do you have any workaround or maybe some recommendations how to handle this. You say that eval doesn't use LCG, so is there any other way to use IP that would use it? Or maybe there is a way to compile the script snipets only once and reuse them as most of the time they stay unchanged? > >Any help would be mostly appreciated as now we highly depend on this code. > >Szymon > >Martin Maly wrote: > > > >>Unfortunately, this is a known issue that we have on our to-do list. >>The code generated by eval is not generated using lightweight codegen and as such it is not garbage collected. As the result, you see the memory effects you are describing. >>We will definitely fix this by our 1.0 release, most likely even before Beta and I'll try to find some time to look at this even before then depending on my time. >> >>Martin >> >>-----Original Message----- >>From: users-bounces at lists.ironpython.com >>[mailto:users-bounces at lists.ironpython.com] On Behalf Of Szymon >>Kobalczyk >>Sent: Friday, November 04, 2005 10:13 AM >>To: users at lists.ironpython.com >>Subject: [IronPython] Is this memory leak ? >> >>Hi, >> >>We just noticed a serious memory leak in our server application. It happens after we execute some code that uses extensively dynamic scripting with IronPython. After one run the allocation grows from 70MB to more then 500MB. >> >>I've investigated the memory heap using WinDbg and all paths lead to the IronPython.Objects.Frame. All the variables that I passed to the PythonEngine are kept in the dictionary inside these Frames. These Frames in turn are kept in some static object[] array. >> >>In attached project I run in a loop some trivial script using engine Execute method. You can attach to it using WinDbg and check that after the loop completes there are 100 instances of Frame. Here is one sample from the gcroot command: >> >>0:003> !gcroot 00b37918 >>Note: Roots found on stacks may be false positives. Run "!help gcroot" for more info. >>Scan Thread 0 OSTHread 13dc >>Scan Thread 2 OSTHread 17fc >>DOMAIN(00153570):HANDLE(Pinned):9313e4:Root:01ab4480(System.Object[])-> >>00b37918(IronPython.Objects.Frame) >> >>I also tried this with the evaluate method and the effect was the same. >>Only with (my favorite) FastEval option the memory is not allocated. So this could mean this leak occurs during code generation. >> >>I hope this is something that can be fixed quickly as we need to deploy this solution to production. >> >>Note: I still work on .NET Beta 2 and IronPython 0.9.3. I also run the test on the 0.9.4 version but results were the same. >> >>Thanks in Advance, >>Szymon Kobalczyk. >> >> >>PS: I post this mail again cause previously it had to large attachment and was held for approval by moderator. >> >> >> >> >> >> > > > > From Martin.Maly at microsoft.com Fri Nov 4 23:51:24 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 4 Nov 2005 14:51:24 -0800 Subject: [IronPython] How to do debugging for embedded usage In-Reply-To: <200511021710.jA2HAnNo028930@mac.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5335417@df-foxhound-msg.exchange.corp.microsoft.com> Debugging in the first case style is something that's on our radar but we may not get to it for a while. We don't have the in-process debugging interface or support for "pdb" yet. For now, we support Visual Studio or CLR debuggers (cordbg, DbgCLR.exe, ...) Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Latta Sent: Wednesday, November 02, 2005 9:10 AM To: 'Discussion of IronPython' Subject: Re: [IronPython] How to do debugging for embedded usage Is there any chance of supporting debugging for the first case? I would rather persist the script sources with the document/repository rather than as files, though I could cache them on disk if needed. Is there an in-process debugging interface I can use to support an embedded debugger rather than requiring VS be installed for the end-user scripting case? For full fledge plug-ins VS would be good, but for true end-users something more targeted would be better. Michael ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Wednesday, November 02, 2005 6:59 AM To: Discussion of IronPython Subject: Re: [IronPython] How to do debugging for embedded usage It largely depends on how your Python scripts are written. If you use following format: engine.Execute("print "Hello") debugging is hard because IronPython has no source code to map debugging info to. On the other hand, if you have your scripts stored in the files and execute them via: engine.RunFile(fileName); then IronPython generates debug info and debugging is straightforward - attach debugger to your app and place breakpoint into the Python source file and things mostly work as you'd expect. There are some rough edges to be polished, but debugging this way is quite good already. Hope this helps Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Latta Sent: Tuesday, November 01, 2005 8:59 PM To: 'Discussion of IronPython' Subject: [IronPython] How to do debugging for embedded usage When I am using IronPython within my application (for scripting/extension) how do I support debugging? Is there an event in the engine when a break point is hit? How do I specify to the engine that there is a break point? I presume I need to provide an editor and such myself, as well as a UI for examining the run-time state? I presume I can use the stack walker for examining the stack? Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.kobalczyk at softwaremind.pl Fri Nov 4 23:57:00 2005 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Fri, 04 Nov 2005 23:57:00 +0100 Subject: [IronPython] Is this memory leak ? In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F53353F1@df-foxhound-msg.exchange.corp.microsoft.com> References: <5C0A6F919D675745BB1DBA7412DB68F53353F1@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <436BE73C.6050409@softwaremind.pl> Sorry to bother you again. >x = compile("2+2", "", "eval") >for i in xrange(123456789): > eval(x) > > > In this code, what object is assigned to the x var? Can I just store it by calling PythonEngine.Evaluate once than invoke multiple times passing it as variable: PythonEngine engine = new PythonEngine(); object x = engine.Evaluate("compile('2+2', '', 'eval')"); and somewhere else PythonEngine engine2 = new PythonEngine(); engine2.SerVariable("x", x); object result = engine.Evaluate("eval(x)"); Besides, my scripts are not always simple expressions. Sometimes there are multiple statements and thats why I mostly use PythonEngine.Execute method. Would the compile function also handle such case? (I guess the kind argument would should be 'exec' then) Szymon. From jimhug at exchange.microsoft.com Sat Nov 5 01:26:07 2005 From: jimhug at exchange.microsoft.com (Jim Hugunin) Date: Fri, 4 Nov 2005 16:26:07 -0800 Subject: [IronPython] Problem with keyword parameters for built-in types In-Reply-To: Message-ID: Thanks for the bug report. We'll add it to the list to fix. I assume that you know that you can do this as a work-around: property(_getValue, None, None, "This is doc") The unhandled exception change is my fault. I made the change because it makes debugging IronPython applications within visual studio much nicer since you can break at the point at which an unhandled exception is thrown. I didn't believe this would be a problem for folks since my personal development style very rarely directly runs scripts. I'm either working within the interactive console using import, reload and execfile or I'm working inside of VS. This also came up as I was adding some support for simple static compilation and I think this is the right behavior for Python code compiled to a single .exe. However, I think your right that this is a mistake for simple cases of "IronPythonConsole foo.py" and we should revert to the old behavior for 0.9.5 while adding a flag to enable the new behavior inside of a debugger like VS. Thanks for the two bugs - Jim ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of John Doty Sent: Thursday, November 03, 2005 2:15 PM To: Discussion of IronPython Subject: [IronPython] Problem with keyword parameters for built-in types I'm sorry if this is a known limitation, but the following doesn't work with IronPython 0.9.3: class MyClass: def __init__(self, testValue): self.testValue = testValue def _getValue(self): return self.testValue value = property(_getValue, doc="This is documentation") obj = MyClass("Hello!") print obj.value It generates the following exception: Traceback (most recent call last): at __main__.Initialize() in C:\IronPython\test.py:line 1 at __main__.MyClass$maker0() in C:\IronPython\test.py:line 7 TypeError: can't set arbitrary attributes on built-in type property I just thought I'd point it out. (In addition, running this in IronPythonConsole.exe 0.9.4 gives me an unhandled exception, as opposed to the nice exception-with-stack-trace that I used to get, and expect from CPython development. Is this on purpose?) thanks, john -------------- next part -------------- An HTML attachment was scrubbed... URL: From jimhug at exchange.microsoft.com Sat Nov 5 01:31:23 2005 From: jimhug at exchange.microsoft.com (Jim Hugunin) Date: Fri, 4 Nov 2005 16:31:23 -0800 Subject: [IronPython] IronPython 0.9.4 released In-Reply-To: Message-ID: Hi Keith, I think that we overstated the announcement of static compilation a little bit. There is a new class that does support some static compilation, but it's far from complete. We only expose the class and no msbuild or command-line way of invoking the compiler so you'll need to write a Python (or C# or VB or ...) script to drive a build. It will build a collection of Python modules into a single executable. These executables need access to IronPython.dll and IronMath.dll either in the path, a config file or the GAC. The collections of modules can also be loaded with sys.LoadAssembly* functions and then their Python modules can be imported and used in IronPython. There is no support yet for building a library that is easily usable from other CLS languages (like C# and VB). This will be coming at some currently unspecified time in the future. Thanks - Jim ________________________________ From: Keith J. Farmer [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Thursday, November 03, 2005 3:18 PM To: Discussion of IronPython Subject: RE: [IronPython] IronPython 0.9.4 released Does the static compilation include support for producing .NET libraries (as opposed to a sequence of snippets), or is that still being worked on? ________________________________ From: users-bounces at lists.ironpython.com on behalf of Martin Maly Sent: Thu 11/3/2005 1:54 PM To: 'Discussion of IronPython' Subject: [IronPython] IronPython 0.9.4 released Hello IronPython community, we have just released IronPython 0.9.4. The biggest change is implementation of static compilation (IronPython.Hosting.Compiler), a component that compiles multiple sources into the single executable. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Sat Nov 5 01:49:21 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Fri, 4 Nov 2005 16:49:21 -0800 Subject: [IronPython] IronPython 0.9.4 released References: Message-ID: Would be interesting seeing examples of how it works... ;) ________________________________ From: users-bounces at lists.ironpython.com on behalf of Jim Hugunin Sent: Fri 11/4/2005 4:31 PM I think that we overstated the announcement of static compilation a little bit. There is a new class that does support some static compilation, but it's far from complete. We only expose the class and no msbuild or command-line way of invoking the compiler so you'll need to write a Python (or C# or VB or ...) script to drive a build. It will build a collection of Python modules into a single executable. These executables need access to IronPython.dll and IronMath.dll either in the path, a config file or the GAC. The collections of modules can also be loaded with sys.LoadAssembly* functions and then their Python modules can be imported and used in IronPython. There is no support yet for building a library that is easily usable from other CLS languages (like C# and VB). This will be coming at some currently unspecified time in the future. -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 4611 bytes Desc: not available URL: From Martin.Maly at microsoft.com Sat Nov 5 01:55:36 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 4 Nov 2005 16:55:36 -0800 Subject: [IronPython] Hi In-Reply-To: <6.2.1.2.2.20051027135404.054fe598@pop.softhome.net> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F53354DE@df-foxhound-msg.exchange.corp.microsoft.com> Sorry for the delayed response. Part of the reason was that by answering after the 0.9.4 release, I can give you positive answer to one of your questions below. The string formatting is not complete yet so the %i is a known issue that we need to get to. On a better note, we have implemented splitlines (and many other missing string methods) in 0.9.4! Thanks Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pablo De Grande Sent: Thursday, October 27, 2005 10:00 AM To: users at lists.ironpython.com Subject: Re: [IronPython] Hi Hi. I am new to the list, and I am not sure this is the right place to report issues. Just in case, 2 issues: - %i appeared as not supported. I had to replace it by %d (in a format expression) - splitlines appeared as not supported. I had to replace it by split('\n') They are not big deal, but for real projects changing others code to meet my compiler could not be an option.... Byebye, P. ps: by the way, the code performed more than 2 times slower than running standard python... I am pretty much a dotnet fan, so I'd love running my code under .net.... so feel free to ask me for the code in case you need performance cases to tune the thing better.... At 01:43 PM 10/27/2005, users-request at lists.ironpython.com wrote: >Welcome to the users at lists.ironpython.com mailing list! > >To post to this list, send your email to: > > users at lists.ironpython.com > >General information about the mailing list is at: > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >If you ever want to unsubscribe or change your options (eg, switch to >or from digest mode, change your password, etc.), visit your >subscription page at: > > > http://lists.ironpython.com/options.cgi/users-ironpython.com/pablodg%4 > 0softhome.net > > >You can also make such adjustments via email by sending a message to: > > users-request at lists.ironpython.com > >with the word `help' in the subject or body (don't include the quotes), >and you will get back a message with instructions. > >You must know your password to change your options (including changing >the password, itself) or to unsubscribe. It is: > > bloclo > >Normally, Mailman will remind you of your lists.ironpython.com mailing >list passwords once every month, although you can disable this if you >prefer. This reminder will also include instructions on how to >unsubscribe or change your account options. There is also a button on >your options page that will email your current password to you. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ml.cyresse at gmail.com Sat Nov 5 06:10:46 2005 From: ml.cyresse at gmail.com (Liam Clarke) Date: Sat, 5 Nov 2005 18:10:46 +1300 Subject: [IronPython] IronPython 0.9.4 released In-Reply-To: References: Message-ID: With regards to this update, and .NET 2.0 coming out, are there rumblings of an October CTP for WFP? Was all looking forward to playing with it, and now I'm re-downloading old .NET betas... On 11/5/05, Keith J. Farmer wrote: > Would be interesting seeing examples of how it works... ;) > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of Jim Hugunin > Sent: Fri 11/4/2005 4:31 PM > > > I think that we overstated the announcement of static compilation a little bit. There is a new class that does support some static compilation, but it's far from complete. We only expose the class and no msbuild or command-line way of invoking the compiler so you'll need to write a Python (or C# or VB or ...) script to drive a build. It will build a collection of Python modules into a single executable. These executables need access to IronPython.dll and IronMath.dll either in the path, a config file or the GAC. The collections of modules can also be loaded with sys.LoadAssembly* functions and then their Python modules can be imported and used in IronPython. > > > > There is no support yet for building a library that is easily usable from other CLS languages (like C# and VB). This will be coming at some currently unspecified time in the future. > > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From ml.cyresse at gmail.com Sat Nov 5 06:17:05 2005 From: ml.cyresse at gmail.com (Liam Clarke) Date: Sat, 5 Nov 2005 18:17:05 +1300 Subject: [IronPython] Need help in learning. In-Reply-To: <4.3.2.7.2.20051104153829.01632bf0@mail.comcast.net> References: <4.3.2.7.2.20051101160352.0512e740@mail.comcast.net> <4.3.2.7.2.20051104153829.01632bf0@mail.comcast.net> Message-ID: On 11/5/05, J. Merrill wrote: > I'm a bit confused (not for the first time). That download page now says > on it "Date published: 11/3/2005" -- but you sent this on 11/1. Has it > been patched already!?! You think that's confusing, try looking at it when you're quite tired... Ironically for .NET, that publishing date is very culture specific.... As in my tired state, I took it to mean 11th of March, as it does here in NZ. From s.kobalczyk at softwaremind.pl Sat Nov 5 08:22:39 2005 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Sat, 05 Nov 2005 08:22:39 +0100 Subject: [IronPython] Is this memory leak ? In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F5335451@df-foxhound-msg.exchange.corp.microsoft.com> References: <5C0A6F919D675745BB1DBA7412DB68F5335451@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <436C5DBF.9000309@softwaremind.pl> I tried doing this as you suggested and indeed now I have better results. But still after evaluating same script in a loop there is always one Frame object left in memory. It's being referenced by some obscure array of objects. The problem is that this Frame in turn references module which holds all the variables used in this computation. I quickly added some ClearAttrs method on module to prevent this. So my thinking is that the memory problem is not only due to the compilation not using LCG (as this generates unmanaged memory leak that we also observed) but also that each time particular FrameCode is run the last Frame executed is stored in some static array. I hope that you can hunt it down and fix somehow soon. For now we will try to precompile and cache our scripts when possible. Martin Maly wrote: >The x below is actually FrameCode (you can take a peek at __builtin__.cs, function compile to see how it comes to exist. > >There are 3 ways to compile (3rd parameter to compile): >'exec' - supports series of statements: > > > >>>>compile("x=2+2\nfor i in range(x):\n print i\n", "", "exec") >>>> >>>> > > > >>>>eval(_) >>>> >>>> >0 >1 >2 >3 > >'eval' - supports single expression >'single' - one expression or statement > >That would be one way of doing things. Another could be somewhat simulating what IronPython does underneath, something similar to the following example that I quickly put together: > >using IronPython.Modules; >using IronPython.Objects; >using System.Collections.Generic; > >public class E { > public static void Main () { > IDictionary d = new Dictionary(); > PythonModule eval = new PythonModule("", d); > FrameCode x = Builtin.compile("2+2", "", "eval") as FrameCode; > for (;;) { > x.Run(new Frame(eval)); > } > } >} > >Martin > >-----Original Message----- >From: Szymon Kobalczyk [mailto:s.kobalczyk at softwaremind.pl] >Sent: Friday, November 04, 2005 2:57 PM >To: Martin Maly >Cc: users at lists.ironpython.com >Subject: Re: [IronPython] Is this memory leak ? > >Sorry to bother you again. > > > >>x = compile("2+2", "", "eval") >>for i in xrange(123456789): >> eval(x) >> >> >> >> >> >In this code, what object is assigned to the x var? Can I just store it by calling PythonEngine.Evaluate once than invoke multiple times passing it as variable: > >PythonEngine engine = new PythonEngine(); object x = engine.Evaluate("compile('2+2', '', 'eval')"); > >and somewhere else > >PythonEngine engine2 = new PythonEngine(); engine2.SerVariable("x", x); object result = engine.Evaluate("eval(x)"); > >Besides, my scripts are not always simple expressions. Sometimes there are multiple statements and thats why I mostly use PythonEngine.Execute method. Would the compile function also handle such case? (I guess the kind argument would should be 'exec' then) > > >Szymon. > > > From Martin.Maly at microsoft.com Sat Nov 5 15:35:37 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sat, 5 Nov 2005 06:35:37 -0800 Subject: [IronPython] IronPython 0.9.4 released In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5335592@df-foxhound-msg.exchange.corp.microsoft.com> I honestly don't know but I certainly hope that WFP for .NET 2.0 comes soon. My suggestion for the downgrading back to Beta in order to play with WFP ... I'd try to do it inside Virtual PC if you have it. Last time I was downgrading .NET I ended up with an inconsistent state. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Liam Clarke Sent: Friday, November 04, 2005 9:11 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 0.9.4 released With regards to this update, and .NET 2.0 coming out, are there rumblings of an October CTP for WFP? Was all looking forward to playing with it, and now I'm re-downloading old .NET betas... From ml.cyresse at gmail.com Sun Nov 6 01:05:32 2005 From: ml.cyresse at gmail.com (Liam Clarke) Date: Sun, 6 Nov 2005 13:05:32 +1300 Subject: [IronPython] IronPython 0.9.4 released In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F5335592@df-foxhound-msg.exchange.corp.microsoft.com> References: <5C0A6F919D675745BB1DBA7412DB68F5335592@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: I'm afraid I don't have Virtual PC, and my oldish computer probably couldn't handle the overhead. But I've got a Linux partition I've been meaning to remove, so the spring clean full reinstall of XP is on the cards anyway. To upgrade from beta to current .NET framework involved - Uninstall VS Express 8 beta Uninstall WFP Uninstall .NET framework Remove Internet Explorer(!) #Even though it's still on my system and runs fine w/out .NET Install new .NET framework Install VS Express 8 beta While I'm puzzled as to why .NET won't uninstall when IE is present, I'm okay with the current up and down; I was up to the 2.0 rc2 framework (as I said, misinterpreting American date formats is annoying), and haven't had any trouble so far. Although, I may have to figure out a way to preserve the VS and WFP installs locally, as the reinstalls are starting to push my data cap. Regards, Liam Clarke On 11/6/05, Martin Maly wrote: > I honestly don't know but I certainly hope that WFP for .NET 2.0 comes soon. > > My suggestion for the downgrading back to Beta in order to play with WFP ... I'd try to do it inside Virtual PC if you have it. Last time I was downgrading .NET I ended up with an inconsistent state. > > Martin > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Liam Clarke > Sent: Friday, November 04, 2005 9:11 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython 0.9.4 released > > With regards to this update, and .NET 2.0 coming out, are there rumblings of an October CTP for WFP? > > Was all looking forward to playing with it, and now I'm re-downloading old .NET betas... > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From ml.cyresse at gmail.com Sun Nov 6 01:07:57 2005 From: ml.cyresse at gmail.com (Liam Clarke) Date: Sun, 6 Nov 2005 13:07:57 +1300 Subject: [IronPython] Compiled .py's question Message-ID: Hi, My apologies if this has been asked repeatedly before, but the executable created from scripts run with IronPython - when I run one, I get the following error - Unhandled Exception: System.IO.FileNotFoundException: Could not load file or ass embly 'IronPython, Version=0.9.3.36778, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'IronPython, Version=0.9.3.36778, Culture=neutral, PublicKeyToken=nul l' Do I need to add IronPython to the GAC? Regards, Liam Clarke From kfarmer at thuban.org Sun Nov 6 02:23:54 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Sat, 5 Nov 2005 17:23:54 -0800 Subject: [IronPython] IronPython 0.9.4 released Message-ID: I didn't have to uninstall IE.. Perhaps your system's broke? ----- 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 Liam Clarke While I'm puzzled as to why .NET won't uninstall when IE is present, I'm okay with the current up and down; I was up to the 2.0 rc2 framework (as I said, misinterpreting American date formats is annoying), and haven't had any trouble so far. From Martin.Maly at microsoft.com Sun Nov 6 03:38:12 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sat, 5 Nov 2005 18:38:12 -0800 Subject: [IronPython] Compiled .py's question In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F53355E5@df-foxhound-msg.exchange.corp.microsoft.com> Either that (add to GAC) or have it in the same directory where your compiled exes are located. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Liam Clarke Sent: Saturday, November 05, 2005 4:08 PM To: Discussion of IronPython Subject: [IronPython] Compiled .py's question Hi, My apologies if this has been asked repeatedly before, but the executable created from scripts run with IronPython - when I run one, I get the following error - Unhandled Exception: System.IO.FileNotFoundException: Could not load file or ass embly 'IronPython, Version=0.9.3.36778, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. File name: 'IronPython, Version=0.9.3.36778, Culture=neutral, PublicKeyToken=nul l' Do I need to add IronPython to the GAC? Regards, Liam Clarke _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ml.cyresse at gmail.com Sun Nov 6 05:40:53 2005 From: ml.cyresse at gmail.com (Liam Clarke) Date: Sun, 6 Nov 2005 17:40:53 +1300 Subject: [IronPython] Compiled .py's question In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F53355E5@df-foxhound-msg.exchange.corp.microsoft.com> References: <5C0A6F919D675745BB1DBA7412DB68F53355E5@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: Thank you very much. On 11/6/05, Martin Maly wrote: > Either that (add to GAC) or have it in the same directory where your compiled exes are located. > > Martin > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Liam Clarke > Sent: Saturday, November 05, 2005 4:08 PM > To: Discussion of IronPython > Subject: [IronPython] Compiled .py's question > > Hi, > > My apologies if this has been asked repeatedly before, but the executable created from scripts run with IronPython - when I run one, I get the following error - > > Unhandled Exception: System.IO.FileNotFoundException: Could not load file or ass embly 'IronPython, Version=0.9.3.36778, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. > File name: 'IronPython, Version=0.9.3.36778, Culture=neutral, PublicKeyToken=nul l' > > Do I need to add IronPython to the GAC? > > Regards, > > Liam Clarke > _______________________________________________ > 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 Nov 8 13:11:42 2005 From: s.kobalczyk at softwaremind.pl (Szymon Kobalczyk) Date: Tue, 08 Nov 2005 13:11:42 +0100 Subject: [IronPython] Presenting IronPython for local INETA group Message-ID: <437095FE.7010800@softwaremind.pl> Hello, I will be presenting IronPython for KGD (Krakowska Grupa Deweloper?w .NET), the local INETA user group, on November 17th (thats Thursday next week). This will be short, half hour, session but I hope to make it interesting. I'm going to show some demos of using IP both as standalone interpreter and as embeddable script engine. I will also talk a bit about dynamic and scripting languages on the CLR framework in general. This is something I wanted to do since I learned of IronPython myself: spread the word of this great tool to other fellow developers. I think that after working with IP for last couple of months I have pretty good grasp of what it can do. But please let me know, if you have any materials or cool samples that I could use or you have any suggestions what I should absolutely show or talk about. If you happen to live near Krak?w (Poland) feel free to drop in. Regards, Szymon Kobalczyk http://www.geekswithblogs.net/kobush From alcarx at gmail.com Wed Nov 9 02:04:02 2005 From: alcarx at gmail.com (Angelo Xu) Date: Wed, 9 Nov 2005 09:04:02 +0800 Subject: [IronPython] How to do debugging for embedded usage In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F53350E3@df-foxhound-msg.exchange.corp.microsoft.com> References: <5C0A6F919D675745BB1DBA7412DB68F53350E3@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: Because i need to debug the embedded scripts, I changed from ExecuteFile(..) to RunFile(..), but the application will report "Common Language Runtime Detected an Invalid Program". I spent some time finding the reason. If i add statements such as "return False" "return 1" into the script, using RunFile(...) method will report the error, while executeFile works fine. The effect of using "IronPythonConsole scriptFilePath" just like using RunFile(...) method. I don't know why. 2005/11/4, Martin Maly : > > Because it it generated as a code snippet into the snippet assembly which > doesn't have association with the source file and therefore the debugger > cannot make the connection between the code and the source file. > I'm going to look into whether this could get changed/fixed. > Martin > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rudy.schockaert at gmail.com Wed Nov 9 23:00:55 2005 From: rudy.schockaert at gmail.com (Rudy Schockaert) Date: Wed, 9 Nov 2005 23:00:55 +0100 Subject: [IronPython] Writing a service or an Outlook add-in with IP Message-ID: <60987dac0511091400w659b8c34m39e21a78a6edfe9e@mail.gmail.com> using CPython and Mark Hammond's PyWin32 package it is rather easy to write a real windows service in Python. By real, I mean an application that can react on the service start/stop/restart... commands. It is also pretty easy to write an Outlook Add-In (see the SpamBayes project). Are these two things already possible in IP (without PyWin32 obviously) and if so, what would be the way to go? Regards, Rudy -- "You don't stop laughing because you grow old. You grow old because you stop laughing." -- Michael Pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Wed Nov 9 23:06:02 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Wed, 9 Nov 2005 14:06:02 -0800 Subject: [IronPython] Writing a service or an Outlook add-in with IP References: <60987dac0511091400w659b8c34m39e21a78a6edfe9e@mail.gmail.com> Message-ID: It's pretty easy to write an NT service using .NET -- there are classes in the framework for this exact thing as well as examples on the web. I'm not certain, though, if the services are accessed as libraries or as executables, which could potentially complicate matters given the limited support IP currently has for creating libraries. For Outlook, you'd need VSTO (Visual Studio Tools for Office), I think? Someone else can probably answer this more authoritatively than I can. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Rudy Schockaert Sent: Wed 11/9/2005 2:00 PM To: Discussion of IronPython Subject: [IronPython] Writing a service or an Outlook add-in with IP using CPython and Mark Hammond's PyWin32 package it is rather easy to write a real windows service in Python. By real, I mean an application that can react on the service start/stop/restart... commands. It is also pretty easy to write an Outlook Add-In (see the SpamBayes project). Are these two things already possible in IP (without PyWin32 obviously) and if so, what would be the way to go? -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 4160 bytes Desc: not available URL: From rudy.schockaert at gmail.com Wed Nov 9 23:22:39 2005 From: rudy.schockaert at gmail.com (Rudy Schockaert) Date: Wed, 9 Nov 2005 23:22:39 +0100 Subject: [IronPython] Writing a service or an Outlook add-in with IP In-Reply-To: References: <60987dac0511091400w659b8c34m39e21a78a6edfe9e@mail.gmail.com> Message-ID: <60987dac0511091422g58ea51caqd7846367a11238d2@mail.gmail.com> Thanks Keith, I found example code (http://www.c-sharpcorner.com/2/window_service.asp) for the service. I'll give it a try in IP as well. On 11/9/05, Keith J. Farmer wrote: > > It's pretty easy to write an NT service using .NET -- there are classes in > the framework for this exact thing as well as examples on the web. I'm not > certain, though, if the services are accessed as libraries or as > executables, which could potentially complicate matters given the limited > support IP currently has for creating libraries. > > For Outlook, you'd need VSTO (Visual Studio Tools for Office), I think? > Someone else can probably answer this more authoritatively than I can. > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of Rudy Schockaert > Sent: Wed 11/9/2005 2:00 PM > To: Discussion of IronPython > Subject: [IronPython] Writing a service or an Outlook add-in with IP > > > using CPython and Mark Hammond's PyWin32 package it is rather easy to > write a real windows service in Python. By real, I mean an application that > can react on the service start/stop/restart... commands. > > It is also pretty easy to write an Outlook Add-In (see the SpamBayes > project). > > Are these two things already possible in IP (without PyWin32 obviously) > and if so, what would be the way to go? > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > -- "You don't stop laughing because you grow old. You grow old because you stop laughing." -- Michael Pritchard -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Thu Nov 10 00:00:42 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Wed, 9 Nov 2005 15:00:42 -0800 Subject: [IronPython] Writing a service or an Outlook add-in with IP References: <60987dac0511091400w659b8c34m39e21a78a6edfe9e@mail.gmail.com> <60987dac0511091422g58ea51caqd7846367a11238d2@mail.gmail.com> Message-ID: Check out System.ServiceProcess.ServiceBase and cohorts. You might also try doing it in C# if you've got VS2005 installed. There's a specific project template which may be able to advise you. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Rudy Schockaert Sent: Wed 11/9/2005 2:22 PM To: Discussion of IronPython Subject: Re: [IronPython] Writing a service or an Outlook add-in with IP Thanks Keith, I found example code (http://www.c-sharpcorner.com/2/window_service.asp) for the service. I'll give it a try in IP as well. -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3888 bytes Desc: not available URL: From Martin.Maly at microsoft.com Fri Nov 11 00:27:10 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 10 Nov 2005 15:27:10 -0800 Subject: [IronPython] How to do debugging for embedded usage In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5450AD1@df-foxhound-msg.exchange.corp.microsoft.com> Sorry for delayed response... This is actually a valid bug in our codegen. The actual cause is that when we generate module-level code, we output void method and "return 1" tries to generate return code which would, on IL level, attempt to return non-void value from void function (that is in addition to the fact that we should generate syntax error in such case just like CPython does - "return statement outside of the function") Now the reason you see it when you use RunFile and not with ExecuteFile, is just the difference between the implementations of RunFile and ExecuteFile. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Angelo Xu Sent: Tuesday, November 08, 2005 5:04 PM To: Discussion of IronPython Subject: Re: [IronPython] How to do debugging for embedded usage Because i need to debug the embedded scripts, I changed from ExecuteFile(..) to RunFile(..), but the application will report "Common Language Runtime Detected an Invalid Program". I spent some time finding the reason. If i add statements such as "return False" "return 1" into the script, using RunFile(...) method will report the error, while executeFile works fine. The effect of using "IronPythonConsole scriptFilePath" just like using RunFile(...) method. I don't know why. 2005/11/4, Martin Maly : Because it it generated as a code snippet into the snippet assembly which doesn't have association with the source file and therefore the debugger cannot make the connection between the code and the source file. I'm going to look into whether this could get changed/fixed. Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From shilman at microsoft.com Fri Nov 11 21:58:59 2005 From: shilman at microsoft.com (Michael Shilman) Date: Fri, 11 Nov 2005 12:58:59 -0800 Subject: [IronPython] .NET Events in IronPython Message-ID: <6853740B7C45144ABF64C484B627E456AA4DFE@RED-MSG-11.redmond.corp.microsoft.com> Is there any way to declare .NET events in IronPython? Here is a simple example in C# that "abstracts" a button pressed event into a "hello" event: public delegate void HelloInvoked(); public class HelloControl : Panel { public event HelloInvoked Hello; public HelloControl() { Button b = new Button(); b.Text = "Hello"; b.Click += new EventHandler(b_Click); b.Dock = DockStyle.Fill; this.Controls.Add(b); } void b_Click(object sender, EventArgs e) { if (Hello != null) Hello(); } } I can do something equivalent with Python functions: class HelloControl(Panel): Hello = [] def __init__(self): b = Button(Text="Hello",Dock=DockStyle.Fill) b.Click += self.on_Click self.Controls.Add(b) def on_Click(self,sender,e): for h in self.Hello: h() def Foo(): print "hello" hc.Hello += [Foo] But for consistency with my other C# code I'd like to use events if possible. Any thoughts? Many thanks, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From GHenderson at ansell.com Fri Nov 11 22:05:02 2005 From: GHenderson at ansell.com (Greg Henderson) Date: Fri, 11 Nov 2005 15:05:02 -0600 Subject: [IronPython] Greg Henderson/AM/ANSELL is out of the office. Message-ID: I will be out of the office starting 11/11/2005 and will not return until 11/16/2005. I will respond to your message when I return. ___________________________________________________________________________ This e-mail (including any attachments) is intended only for the exclusive use of the individual to whom it is addressed. The information contained hereinafter may be proprietary, confidential, privileged and exempt from disclosure under applicable law. If the reader of this e-mail is not the intended recipient or agent responsible for delivering the message to the intended recipient, the reader is hereby put on notice that any use, dissemination, distribution or copying of this communication is strictly prohibited. If the reader has received this communication in error, please immediately notify the sender by telephone or e-mail and delete all copies of this e-mail and any attachments. Thank you. From catherine.devlin at gmail.com Sat Nov 12 15:34:43 2005 From: catherine.devlin at gmail.com (Catherine Devlin) Date: Sat, 12 Nov 2005 09:34:43 -0500 Subject: [IronPython] Presenting IronPython for local INETA group In-Reply-To: <437095FE.7010800@softwaremind.pl> References: <437095FE.7010800@softwaremind.pl> Message-ID: <6523e39a0511120634q25ddc121h8ea7bf37e62a773c@mail.gmail.com> Good for you, Szymon! I wish I could see it... from everything I've read, Krak?w is a beautiful city. I don't have any suggestions for you, but I do hope to benefit from whatever you end up putting together. I volunteered to give a "Python and IronPython" talk in Ohio on Jan. 21 (http://daytondevgroup.net/CodeCamp.htm), It's also a .NET-centered event, so if you'd be willing to share your slides, outlines, or whatever with me, I would greatly appreciate it. (I expect they'll be in Polish, but I think I'll be able to manage.) Since I come from the Python and open-source world, rather than the .NET world, I feel a particular need to anticipate the needs and questions of people for whom VB and C# are their frame of reference. Does anyone have suggestions there? Is there something like an IronPython Evangelism wiki page? Maybe we can assemble what we find and create into one... On 11/8/05, Szymon Kobalczyk wrote: > Hello, > > I will be presenting IronPython for KGD (Krakowska Grupa Deweloper?w > .NET), the local INETA user group, on November 17th (thats Thursday next > week). This will be short, half hour, session but I hope to make it > interesting. I'm going to show some demos of using IP both as standalone > interpreter and as embeddable script engine. I will also talk a bit > about dynamic and scripting languages on the CLR framework in general. > > This is something I wanted to do since I learned of IronPython myself: > spread the word of this great tool to other fellow developers. I think > that after working with IP for last couple of months I have pretty good > grasp of what it can do. But please let me know, if you have any > materials or cool samples that I could use or you have any suggestions > what I should absolutely show or talk about. > > If you happen to live near Krak?w (Poland) feel free to drop in. > > Regards, > Szymon Kobalczyk > http://www.geekswithblogs.net/kobush -- - Catherine http://catherinedevlin.blogspot.com/ From korpse-ironpython at kaydash.za.net Sun Nov 13 19:49:50 2005 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Sun, 13 Nov 2005 20:49:50 +0200 Subject: [IronPython] DLL hell? Message-ID: <43778ACE.8060607@kaydash.za.net> Hi, I've recently downloaded the DirectX October 2005 SDK in the hopes of playing with some of IronPython's recently added features. I've run into some sort of very odd situation, when attempting to load the "Microsoft.DirectX" assembly (for the Microsoft.Direct.Vector3 [and friends] struct) by name I am told that IronPython "Could not load assembly Microsoft.DirectX". Which struck me as odd because I know that assembly exists, so I found out the full filesystem path to the assembly and copied it to an accessible directory and tried to load it as a file and once again I am told that IronPython could not load the assembly. Stepping through the code produces a System.IO.FileNotFoundException with the value: {"The specified module could not be found. (Exception from HRESULT: 0x8007007E)":null} Both procedures produce the same message. Inspecting the DirectX installation directory leads me to believe that the installer installed the "beta" (there is a directory named "Beta" in the "\Developer Runtime" directory alongside an "x86" directory) version. Trying the "beta" and "x86" versions of the respective DLLs shows that the "beta" DLL is indeed the DLL that was installed to the global assembly registry (or whatever it is called) and that the "x86" (read: regular) version of the DLL works fine when loaded via IronPython. Simply adding a reference to the "beta" DLL via the Visual C# 2005 IDE seems to work. The sample project (that I tested) didn't actually compile because of, what appear to be, the addition of a number of symbols that exist in other DirectX namespaces. If anybody could perhaps shed some light on this situation for me, I'd be most appreciative. Regards -- Jonathan When you meet a master swordsman, show him your sword. When you meet a man who is not a poet, do not show him your poem. -- Rinzai, ninth century Zen master From shilman at microsoft.com Mon Nov 14 10:02:04 2005 From: shilman at microsoft.com (Michael Shilman) Date: Mon, 14 Nov 2005 01:02:04 -0800 Subject: [IronPython] C# code calling IP subclass weirdness Message-ID: <6853740B7C45144ABF64C484B627E456AA5482@RED-MSG-11.redmond.corp.microsoft.com> A question about subclassing, virtual methods, C#/IP interop, etc in IronPython-0.9.4. I have a library of two classes Helper & Master (greatly simplified from my actual situation, but analagous): using System; namespace TestLib { public class Helper { int _id; public Helper(int id) { _id = id; } public void DoSomething() { Console.WriteLine("Helper"); } } public class Master { protected virtual Helper CreateHelper(int id) { return new Helper(id); } public void DoSomething() { Helper helper = CreateHelper(0); helper.DoSomething(); } } } Master has a factory-style method that creates a helper, and then invokes a method on it. I want to insert some throw-away behavior, by subclassing both Master and Helper, so that FooMaster creates a FooHelper, and then invokes the FooHelper version of DoSomething. from TestLib import * class FooHelper(Helper): def __init__(self, id): self._id = id def DoSomething(self): print "FooHelper" class FooMaster(Master): def CreateHelper(self, id): return FooHelper(id) # === Main ================== fooMaster = FooMaster() fooMaster.DoSomething() I expect this to print out "FooHelper". Instead it prints out "Helper". Note that if I were to define the superclasses Helper/Master in Python instead of C#, everything works like a charm, and it prints out "FooHelper": class Helper: _id = 0 def __init__(self, id): self._id = id; def DoSomething(self): print "Helper" class Master: def CreateHelper(self, id): return Helper(id) def DoSomething(self): self.CreateHelper(10).DoSomething() This leads me to believe it is impossible for a C# object to call a Python method that overrides a virtual method. However, also note that if I define the Helper class to be abstract in C#, it also works fine and I see "FooHelper". using System; using System.Text; namespace TestLib { public abstract class Helper { int _id; public Helper(int id) { _id = id; } public abstract void DoSomething(); } public class Master { protected virtual Helper CreateHelper(int id) { return null; } public void DoSomething() { Helper helper = CreateHelper(0); helper.DoSomething(); } } } Furthermore, when I simplify things even further, it also works the way I'd expect: public class Helper { public Helper(int id) { } public virtual void DoSomething() { Console.WriteLine("Helper"); } } public class Master { public Master(Helper helper) { helper.DoSomething(); } } class FooHelper(Helper): def __init__(self, id): pass def DoSomething(self): print "FooHelper" Can anybody tell me what's going on? Is this a bug in IronPython or am I doing something wrong? Many thanks, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From msurel at comcast.net Mon Nov 14 20:58:13 2005 From: msurel at comcast.net (msurel at comcast.net) Date: Mon, 14 Nov 2005 19:58:13 +0000 Subject: [IronPython] C# code calling IP subclass weirdness Message-ID: <111420051958.17635.4378EC550002E7A7000044E32207300033040A9D9A9C03@comcast.net> In C#, if you want somebody to be able to override a method in a base class, I think you need the virtual keyword. I believe if you define the DoSomething method in Helper with the virtual keyword, then you should be ok. That would be about the only suggestion I have. Other than that, the code looks ok to me. In C# if you want to override a method in a base class I believe it has to be declared virtual and the method in the subclass needs to have the override keyword. Since you don't have the equivalent of the 'override' keyword in Python, I'm not 100% sure you will be able to do this anyway. > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An embedded message was scrubbed... From: "Michael Shilman" Subject: [IronPython] C# code calling IP subclass weirdness Date: Mon, 14 Nov 2005 09:02:14 +0000 Size: 33308 URL: From shilman at microsoft.com Mon Nov 14 22:41:52 2005 From: shilman at microsoft.com (Michael Shilman) Date: Mon, 14 Nov 2005 13:41:52 -0800 Subject: [IronPython] C# code calling IP subclass weirdness Message-ID: <6853740B7C45144ABF64C484B627E456AFE9CA@RED-MSG-11.redmond.corp.microsoft.com> Doh. I introduced a bug when reducing my complex actual bug to this toy example. I added "virtual" to the C# program where it should have been, and now it works fine. Now I need to figure out where things are going awry in my actual example, where things are a bit more complicated (and the method I care about *is* marked virtual, but still does not get called properly!). Thanks, and sorry for the false alarm. Michael -----Original Message----- From: msurel at comcast.net [mailto:msurel at comcast.net] Sent: Monday, November 14, 2005 11:58 AM To: Discussion of IronPython; Discussion of IronPython Cc: Michael Shilman Subject: Re: [IronPython] C# code calling IP subclass weirdness In C#, if you want somebody to be able to override a method in a base class, I think you need the virtual keyword. I believe if you define the DoSomething method in Helper with the virtual keyword, then you should be ok. That would be about the only suggestion I have. Other than that, the code looks ok to me. In C# if you want to override a method in a base class I believe it has to be declared virtual and the method in the subclass needs to have the override keyword. Since you don't have the equivalent of the 'override' keyword in Python, I'm not 100% sure you will be able to do this anyway. > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Nathan.Ernst at citadelgroup.com Mon Nov 14 15:36:06 2005 From: Nathan.Ernst at citadelgroup.com (Ernst, Nathan) Date: Mon, 14 Nov 2005 08:36:06 -0600 Subject: [IronPython] C# code calling IP subclass weirdness Message-ID: I'm not certain if this is the cause of the problem - but have you tried making "DoSomething" on Helper virtual? My guess would be that in your example, you're creating a new, non-virtual method in FooHelper that is hiding its base class's implementation, analogous to this: using System; namespace TestLib { public class Helper { int _id; public Helper(int id) { _id = id; } public void DoSomething() { Console.WriteLine("Helper"); } } public class FooHelper { public new void DoSomething() { Console.WriteLine("FooHelper"); } } public class Master { protected virtual Helper CreateHelper(int id) { return new Helper(id); } public void DoSomething() { Helper helper = CreateHelper(0); helper.DoSomething(); } } } -Nathan Ernst ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Shilman Sent: Monday, November 14, 2005 3:02 AM To: Discussion of IronPython Subject: [IronPython] C# code calling IP subclass weirdness A question about subclassing, virtual methods, C#/IP interop, etc in IronPython-0.9.4. I have a library of two classes Helper & Master (greatly simplified from my actual situation, but analagous): using System; namespace TestLib { public class Helper { int _id; public Helper(int id) { _id = id; } public void DoSomething() { Console.WriteLine("Helper"); } } public class Master { protected virtual Helper CreateHelper(int id) { return new Helper(id); } public void DoSomething() { Helper helper = CreateHelper(0); helper.DoSomething(); } } } Master has a factory-style method that creates a helper, and then invokes a method on it. I want to insert some throw-away behavior, by subclassing both Master and Helper, so that FooMaster creates a FooHelper, and then invokes the FooHelper version of DoSomething. from TestLib import * class FooHelper(Helper): def __init__(self, id): self._id = id def DoSomething(self): print "FooHelper" class FooMaster(Master): def CreateHelper(self, id): return FooHelper(id) # === Main ================== fooMaster = FooMaster() fooMaster.DoSomething() I expect this to print out "FooHelper". Instead it prints out "Helper". Note that if I were to define the superclasses Helper/Master in Python instead of C#, everything works like a charm, and it prints out "FooHelper": class Helper: _id = 0 def __init__(self, id): self._id = id; def DoSomething(self): print "Helper" class Master: def CreateHelper(self, id): return Helper(id) def DoSomething(self): self.CreateHelper(10).DoSomething() This leads me to believe it is impossible for a C# object to call a Python method that overrides a virtual method. However, also note that if I define the Helper class to be abstract in C#, it also works fine and I see "FooHelper". using System; using System.Text; namespace TestLib { public abstract class Helper { int _id; public Helper(int id) { _id = id; } public abstract void DoSomething(); } public class Master { protected virtual Helper CreateHelper(int id) { return null; } public void DoSomething() { Helper helper = CreateHelper(0); helper.DoSomething(); } } } Furthermore, when I simplify things even further, it also works the way I'd expect: public class Helper { public Helper(int id) { } public virtual void DoSomething() { Console.WriteLine("Helper"); } } public class Master { public Master(Helper helper) { helper.DoSomething(); } } class FooHelper(Helper): def __init__(self, id): pass def DoSomething(self): print "FooHelper" Can anybody tell me what's going on? Is this a bug in IronPython or am I doing something wrong? Many thanks, Michael ------------------------------------------------------------------------ ------------------------- ------------------------- CONFIDENTIALITY AND SECURITY NOTICE This e-mail contains information that may be confidential and proprietary. It is to be read and used solely by the intended recipient(s). Citadel and its affiliates retain all proprietary rights they may have in the information. If you are not an intended recipient, please notify us immediately either by reply e-mail or by telephone at 312-395-2100 and delete this e-mail (including any attachments hereto) immediately without reading, disseminating, distributing or copying. We cannot give any assurances that this e-mail and any attachments are free of viruses and other harmful code. Citadel reserves the right to monitor, intercept and block all communications involving its computer systems. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Tue Nov 15 02:23:23 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 14 Nov 2005 17:23:23 -0800 Subject: [IronPython] .NET Events in IronPython In-Reply-To: <6853740B7C45144ABF64C484B627E456AA4DFE@RED-MSG-11.redmond.corp.microsoft.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F54F7FD3@df-foxhound-msg.exchange.corp.microsoft.com> After playing with this for a bit, I think that at the moment IronPython is not capable of what you can do below in C#. The insurmountable (for now, I hope) obsctacle that I hit is that the events must be sealed classes, inherited from an abstract MulticastDelegate. IronPython doesn't know of this rule and for now doesn't generate sealed class and the IronPython code that attempts to mimic the output of C# compiler throws exception "delegate must be a sealed class". I think that as we improve the 'static compiler' story, we may need to support creating sealed classes. For now, the scenario below is broken... Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Shilman Sent: Friday, November 11, 2005 12:59 PM To: Discussion of IronPython Subject: [IronPython] .NET Events in IronPython Is there any way to declare .NET events in IronPython? Here is a simple example in C# that "abstracts" a button pressed event into a "hello" event: public delegate void HelloInvoked(); public class HelloControl : Panel { public event HelloInvoked Hello; public HelloControl() { Button b = new Button(); b.Text = "Hello"; b.Click += new EventHandler(b_Click); b.Dock = DockStyle.Fill; this.Controls.Add(b); } void b_Click(object sender, EventArgs e) { if (Hello != null) Hello(); } } I can do something equivalent with Python functions: class HelloControl(Panel): Hello = [] def __init__(self): b = Button(Text="Hello",Dock=DockStyle.Fill) b.Click += self.on_Click self.Controls.Add(b) def on_Click(self,sender,e): for h in self.Hello: h() def Foo(): print "hello" hc.Hello += [Foo] But for consistency with my other C# code I'd like to use events if possible. Any thoughts? Many thanks, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Tue Nov 15 02:59:34 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Mon, 14 Nov 2005 17:59:34 -0800 Subject: [IronPython] .NET Events in IronPython References: <5C0A6F919D675745BB1DBA7412DB68F54F7FD3@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: You'd need to add an event keyword, or some other marker, wouldn't you? Otherwise you don't know that it should be an event rather than some other property. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Martin Maly Sent: Mon 11/14/2005 5:23 PM To: Discussion of IronPython Subject: Re: [IronPython] .NET Events in IronPython After playing with this for a bit, I think that at the moment IronPython is not capable of what you can do below in C#. The insurmountable (for now, I hope) obsctacle that I hit is that the events must be sealed classes, inherited from an abstract MulticastDelegate. IronPython doesn't know of this rule and for now doesn't generate sealed class and the IronPython code that attempts to mimic the output of C# compiler throws exception "delegate must be a sealed class". I think that as we improve the 'static compiler' story, we may need to support creating sealed classes. For now, the scenario below is broken... -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 4455 bytes Desc: not available URL: From Martin.Maly at microsoft.com Tue Nov 15 20:09:59 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 15 Nov 2005 11:09:59 -0800 Subject: [IronPython] .NET Events in IronPython In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F54F8259@df-foxhound-msg.exchange.corp.microsoft.com> Either that (which I don't like very much the idea of adding keywords as it modifies the underlying language), or finding some way to express that the class I am deriving from .NET class should be sealed. That should get us there also, even though the code to do events would probably not be as slick as it is in C#. Martin ________________________________ From: Keith J. Farmer [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Monday, November 14, 2005 6:00 PM To: Discussion of IronPython Subject: RE: [IronPython] .NET Events in IronPython You'd need to add an event keyword, or some other marker, wouldn't you? Otherwise you don't know that it should be an event rather than some other property. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Martin Maly Sent: Mon 11/14/2005 5:23 PM To: Discussion of IronPython Subject: Re: [IronPython] .NET Events in IronPython After playing with this for a bit, I think that at the moment IronPython is not capable of what you can do below in C#. The insurmountable (for now, I hope) obsctacle that I hit is that the events must be sealed classes, inherited from an abstract MulticastDelegate. IronPython doesn't know of this rule and for now doesn't generate sealed class and the IronPython code that attempts to mimic the output of C# compiler throws exception "delegate must be a sealed class". I think that as we improve the 'static compiler' story, we may need to support creating sealed classes. For now, the scenario below is broken... -------------- next part -------------- An HTML attachment was scrubbed... URL: From ken.manheimer at gmail.com Tue Nov 15 23:32:06 2005 From: ken.manheimer at gmail.com (Ken Manheimer) Date: Tue, 15 Nov 2005 17:32:06 -0500 Subject: [IronPython] .NET Events in IronPython In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F54F8259@df-foxhound-msg.exchange.corp.microsoft.com> References: <5C0A6F919D675745BB1DBA7412DB68F54F8259@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <2cd46e7f0511151432k45fce902wb74e1aae5c23acb2@mail.gmail.com> On 11/15/05, Martin Maly wrote: > Either that (which I don't like very much the idea of adding keywords as it > modifies the underlying language), or finding some way to express that the > class I am deriving from .NET class should be sealed. That should get us > there also, even though the code to do events would probably not be as slick > as it is in C#. given a mechanism to produce or transform a class into a sealed class (if that's a sensible notion in the first place), then function/method decorators could be used to express the transformation. i think that's the kind of thing for which decorators are intended. (i, also, cringe at the even the thought of adding a new keyword...) ken ken.manheimer at gmail.com From brian at zope.com Wed Nov 16 00:10:41 2005 From: brian at zope.com (Brian Lloyd) Date: Tue, 15 Nov 2005 18:10:41 -0500 Subject: [IronPython] .NET Events in IronPython In-Reply-To: <2cd46e7f0511151432k45fce902wb74e1aae5c23acb2@mail.gmail.com> Message-ID: <20051115231036.593DE3B8016@smtp.zope.com> > given a mechanism to produce or transform a class into a sealed class > (if that's a sensible notion in the first place), then function/method > decorators could be used to express the transformation. i think > that's the kind of thing for which decorators are intended. (i, also, > cringe at the even the thought of adding a new keyword...) > > ken > ken.manheimer at gmail.com Hiya Ken - drop me a line, man ;^) I was just about to write that the 'pythonic' choices here would appear to be between: - some kind of event / delegate decorator - or some magical Event base class in builtins, etc. I'm generally (and usually specifically) opposed to magic, so I was asking myself whether the Python community at large have adopted decorators as 'pythonic' yet. Possibly not, but if it seems to be The Future, then I like that a lot better (and I like it better as a sustainable pattern to bridge these kinds of gaps) than anything else I can think of... Brian Lloyd brian at zope.com V.P. Engineering 540.361.1716 Zope Corporation http://www.zope.com From kfarmer at thuban.org Wed Nov 16 01:29:13 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Tue, 15 Nov 2005 16:29:13 -0800 Subject: [IronPython] .NET Events in IronPython References: <20051115231036.593DE3B8016@smtp.zope.com> Message-ID: Has the BDFL expressed an opinion on explicitly adding events? -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 2815 bytes Desc: not available URL: From tinuviel at sparcs.kaist.ac.kr Wed Nov 16 13:00:29 2005 From: tinuviel at sparcs.kaist.ac.kr (Seo Sanghyeon) Date: Wed, 16 Nov 2005 21:00:29 +0900 Subject: [IronPython] pyexpat for IronPython Message-ID: <20051116120029.GA28287@sparcs.kaist.ac.kr> pyexpat is a built-in XML parser for CPython. As this is not available from IronPython, I wrote a wrapper around System.Xml.XmlTextReader to fake the interface. http://sparcs.kaist.ac.kr/~tinuviel/devel/fepy/pyexpat.py With this, an example from the Python Library Reference runs correctly: http://docs.python.org/lib/module-xml.parsers.expat.html My main interest is to use this with ElementTree, a very nice API to deal with XML: http://effbot.org/zone/element-index.htm The most basic ElementTree operations already work correctly. Caveats: 1. repr() on ElementTree objects fail because %x formatting is not implemented yet. 2. Just unzipping ElementTree distribution and importing doesn't work. Copy ElementTree.py, and ElementTree.py only, to somewhere in sys.path. This is because ElementTree optionally imports ElementPath when present, but ElementPath uses re.findall which is not implemented yet. I am not experienced with .NET at all, and this is my first programming in IronPython apart from toying. Comments welcome! Seo Sanghyeon From tinuviel at sparcs.kaist.ac.kr Thu Nov 17 08:54:04 2005 From: tinuviel at sparcs.kaist.ac.kr (Seo Sanghyeon) Date: Thu, 17 Nov 2005 16:54:04 +0900 Subject: [IronPython] makefile is wrong Message-ID: <20051117075404.GA18788@sparcs.kaist.ac.kr> I downloaded 0.9.4 release, and when I type make, $ make makefile:16: *** missing separator (did you mean TAB instead of 8 spaces?). Stop. I am using GNU Make 3.80. Also, unlike Windows, POSIX systems don't create intermediate directories with mkdir. (It needs -p option for that.) Therefore "mkdir IronPythonTest/bin/Debug" fails. Including an empty bin directory in the release may be the easiest way to fix this. Seo Sanghyeon From dinov at exchange.microsoft.com Fri Nov 18 00:34:50 2005 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 17 Nov 2005 15:34:50 -0800 Subject: [IronPython] IronPython 0.9.5 released! Message-ID: <4039D552ADAB094BB1EA670F3E96214E66E7EB@df-foxhound-msg.exchange.corp.microsoft.com> Hello IronPython community, We've just released the latest version of IronPython - 0.9.5. We're continuing to drive towards full Python 2.4 compatibility with bug fixes and the implementation of more standard built-in types and modules. With these improvements we now pass 8 more tests in the standard CPython regression test suite. At the same time, we're also improving .NET/Python interoperability with improved support for subclassing from C# classes and a better experience using Python objects in WPF GUIs. The full list of changes is: optimized BuiltinFunctions don't have __doc__ Assignment to a literal not handled (just improve the error message) Can assign to None Keyword argument support for built in types New built-in modules: collections (deque), gc, thread Dir() was not showing all the attributes for subclasses. Fixed __init__ and __new__ semantics for built in types Parsing incomplete field access throws NullReferenceException Fix virtual calls from C# to Python overrides w/ structs, enums, & params args Implement ICustomTypeDescriptor for python types Fix name mangling for private members starting with _'s Fix classes derived from list can't be constructed w/ a string parameter With these changes we pass these baseline tests: timeit, dummy_threading, mutex, netrc, Queue, shlex, threading, and threading_local. We also pass the deque tests (with exceptions for weakref, pickle, and itertools) as well as thread and threading without any changes. We'd also like to thank the community for your bug reports and suggestions to make this a better release: Nicholas Jacobson, John Doty, Steven Drucker, Flexibal, Michael Shilman, and Chris Anderson. You can download the 0.9.5 release from: http://www.microsoft.com/downloads/details.aspx?FamilyId=EE009419-9D19-4DC7-B4EC-36CA1914F170&displaylang=en Thanks and keep in touch, The IronPython team -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Fri Nov 18 01:15:53 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 17 Nov 2005 16:15:53 -0800 Subject: [IronPython] .NET Events in IronPython In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F558F8B9@df-foxhound-msg.exchange.corp.microsoft.com> Not as far as I know. I even did some search for it and didn't find anything. The closest match I found was zope event framework, but no mention of syntax/language extensions. Martin ________________________________ From: Keith J. Farmer [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Tuesday, November 15, 2005 4:29 PM To: Discussion of IronPython Subject: RE: [IronPython] .NET Events in IronPython Has the BDFL expressed an opinion on explicitly adding events? -------------- next part -------------- An HTML attachment was scrubbed... URL: From jtk at yahoo.com Fri Nov 18 02:13:46 2005 From: jtk at yahoo.com (Jeff Kowalczyk) Date: Thu, 17 Nov 2005 20:13:46 -0500 Subject: [IronPython] IronPython 0.9.5 released, Runs on Mono References: <4039D552ADAB094BB1EA670F3E96214E66E7EB@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: Dino Viehland wrote: > We've just released the latest version of IronPython - 0.9.5. Thanks for the release. Just FYI, IronPython builds and runs on mono-1.1.10 under Gentoo Linux. There's a NotImplementedException around every corner, but you can run it easily. Steps to build: - change the makefile: CSC = gmcs eight spaces on line 16 should be a tab, and an extra line needs to be added to create the intermediate directory IronPythonTest/bin. $ make mkdir IronPythonTest/bin mkdir IronPythonTest/bin/Debug gmcs -t:library -r:bin/IronMath.dll -r:bin/IronPython.dll -out:IronPythonTest/bin/Debug/IronPythonTest.dll -recurse:IronPythonTest/*.cs IronPythonTest/DeTest.cs(151,26): warning CS0219: The variable `dts2' is assigned but its value is never used IronPythonTest/DeTest.cs(41,14): warning CS0169: The private method `IronPythonTest.DeTestStruct.Init()' is never used IronPythonTest/InheritTest.cs(171,24): warning CS0414: The private field `IronPythonTest.Inherited.str' is assigned but its value is never used Compilation succeeded - 3 warning(s) $ cd bin/ bin $ mono IronPythonConsole.exe IronPython 0.9.5 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> 2 + 2 4 >>> s = 'IronPython builds and runs on Mono' >>> dir(s) ['Clone', 'Compare', 'CompareOrdinal', 'CompareTo', 'Concat', 'Contains', 'Copy', 'CopyTo', 'Empty', 'EndsWith', 'Equals', 'Format', 'GetEncoding', 'GetEnumerator', 'GetHashCode', 'GetType', 'GetTypeCode', 'IndexOf', 'IndexOfAny', 'Insert', 'Intern', 'IsInterned', 'IsNullOrEmpty', 'Join', 'LastIndexOf', 'LastIndexOfAny', 'Length', 'Multiply', 'PadLeft', 'PadRight', 'Quote', 'RawDecode', 'RawEncode', 'Remove', 'Replace', 'Split', 'StartsWith', 'Substring', 'ToCharArray', 'ToLower', 'ToLowerInvariant', 'ToString', 'ToUpper', 'ToUpperInvariant', 'Trim', 'TrimEnd', 'TrimStart', '__contains__', '__eq__', '__getitem__', '__getslice__', '__init__', '__len__', '__mod__', '__mul__', '__ne__', '__new__', '__repr__', 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'op_Equality', 'op_Inequality', 'replace', 'rfind', 'rindex', 'rjust', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill'] >>> for c in s: print c I r o n P(...) Makefile Patch: $ diff -u IronPython-0.9.5/makefile IronPython-0.9.5fixed/makefile --- IronPython-0.9.5/makefile 2005-08-17 20:21:40.000000000 -0400 +++ IronPython-0.9.5fixed/makefile 2005-11-17 19:52:44.000000000 -0500 @@ -1,4 +1,4 @@ -CSC=csc +CSC=gmcs all:bin/IronMath.dll bin/IronPython.dll bin/IronPythonConsole.exe IronPythonTest/bin/Debug/IronPythonTest.dll @@ -13,5 +13,6 @@ IronPythonTest/bin/Debug/IronPythonTest.dll: bin/IronMath.dll bin/IronPython.dll - mkdir IronPythonTest/bin/Debug + mkdir IronPythonTest/bin + mkdir IronPythonTest/bin/Debug $(CSC) -t:library -r:bin/IronMath.dll -r:bin/IronPython.dll -out:IronPythonTest/bin/Debug/IronPythonTest.dll -recurse:IronPythonTest/*.cs From info at geatec.com Fri Nov 18 03:00:29 2005 From: info at geatec.com (J. de Hooge) Date: Fri, 18 Nov 2005 03:00:29 +0100 Subject: [IronPython] Problem: AllowDrop = True --> DragDrop registration failed Message-ID: <000001c5ebe3$da560060$6402a8c0@GEADELL> Hi, In the past months I've been coding quite extensively using previous versions of IronPython (upto 0.9.3) and the .NET 2.0 framework beta. One of the things I've been using a lot is drag&drop. Recently I've downloaded IP 0.9.5 and the "final" .NET 2.0 distribution. Setting the AllowDrop property of e.g. a Forms.ListView to True now results in an exception message: DragDrop registration failed. >From the internet I've gathered that I should change the ApartmentState of my main thread to STA, using an attribute. But how can I do that from IP? And why is MTA the default, causing this problem? Or is there a different solution. Any help appreciated. Thanks Jacques de Hooge info at geatec.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jlam at iunknown.com Fri Nov 18 03:24:35 2005 From: jlam at iunknown.com (John Lam) Date: Thu, 17 Nov 2005 21:24:35 -0500 Subject: [IronPython] Problem: AllowDrop = True --> DragDrop registrationfailed Message-ID: <1E66B509DC78F74BA1CC22C625B096D103C843@dc.iunknown.com> MTA is default due to a change in the behavior of the Whidbey CLR. In earlier versions of the CLR, CoInitializeEx was not called in *most* cases. So you could tell your thread to enter an STA via a change to ApartmentState in *most* cases. The default in Whidbey is to put all threads in the MTA which is more predictable, even at the expense of breaking applications that manually set the ApartmentState of a thread after execution has started. You must declare the COM requirements of the startup thread via an STAThread attribute in your application's Main() method. I'm not sure how attributes are supported in IP (I've run into this problem in my Ruby bridge - and have a non-ideal solution to it as well). HTH, -John http://www.iunknown.com ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. de Hooge Sent: Thursday, November 17, 2005 9:00 PM To: users at lists.ironpython.com Subject: [IronPython] Problem: AllowDrop = True --> DragDrop registrationfailed Hi, In the past months I've been coding quite extensively using previous versions of IronPython (upto 0.9.3) and the .NET 2.0 framework beta. One of the things I've been using a lot is drag&drop. Recently I've downloaded IP 0.9.5 and the "final" .NET 2.0 distribution. Setting the AllowDrop property of e.g. a Forms.ListView to True now results in an exception message: DragDrop registration failed. >From the internet I've gathered that I should change the ApartmentState of my main thread to STA, using an attribute. But how can I do that from IP? And why is MTA the default, causing this problem? Or is there a different solution. Any help appreciated. Thanks Jacques de Hooge info at geatec.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Fri Nov 18 04:26:10 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 17 Nov 2005 19:26:10 -0800 Subject: [IronPython] Problem: AllowDrop = True --> DragDrop registration failed In-Reply-To: <000001c5ebe3$da560060$6402a8c0@GEADELL> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F558FA55@df-foxhound-msg.exchange.corp.microsoft.com> Actually, I wonder if this is related to the recent change in IronPython. When debugging IronPython we found out that Visual Studio often complains about the aplication thread being marked as STA and not pumping messages and our investigations showed that the way to make Visual Studio happy was to remove the STAThread attribute from IronPython's Main and go with the default. It creates an interesting class of problems, having the engine be marked one way, and the application running in it needing different apartment settings. Could you try putting the STAThread attribute back on the IronPython Main and let me know if you got things working that way? I am interested to know what implications it may have to have the main IronPython thread marked either way. thanks very much Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. de Hooge Sent: Thursday, November 17, 2005 6:00 PM To: users at lists.ironpython.com Subject: [IronPython] Problem: AllowDrop = True --> DragDrop registration failed Hi, In the past months I've been coding quite extensively using previous versions of IronPython (upto 0.9.3) and the .NET 2.0 framework beta. One of the things I've been using a lot is drag&drop. Recently I've downloaded IP 0.9.5 and the "final" .NET 2.0 distribution. Setting the AllowDrop property of e.g. a Forms.ListView to True now results in an exception message: DragDrop registration failed. >From the internet I've gathered that I should change the ApartmentState of my main thread to STA, using an attribute. But how can I do that from IP? And why is MTA the default, causing this problem? Or is there a different solution. Any help appreciated. Thanks Jacques de Hooge info at geatec.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at geatec.com Fri Nov 18 11:26:55 2005 From: info at geatec.com (J. de Hooge) Date: Fri, 18 Nov 2005 11:26:55 +0100 Subject: [IronPython] Problem: AllowDrop = True --> DragDrop registration failed In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F558FA55@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <000001c5ec2a$99832ee0$6402a8c0@GEADELL> Martin, First and foremost: Adding [STAThread] to Main solves the problem I had! One other problem I am having is tooltips disappearing for good after having closed a local menu by clicking on its "parent window", But probably this has nothing to do with IronPython! (but with my own code or .NET) Some remarks about Visual Studio: I use VS 2003 as a convenient editor and have installed IronPythonConsole as an external tool, running it with a mouseclick. Adding the [STAThread] initially did not seem to have any positive effect on the AllowDrop problem. That all changed when I ran the modified IronPythonConsole just once from the commandline (with my Python app's main module as command parameter). The bug had disappeared. When I used VS after that to run IronPythonConsole, the bug did not show up again. However, when I remove the [STAThread] attribute the bug reappears, both from the command line and from VS. I am telling you this because you had some problems with Visual Studio "often complaining etc." I haven't the remotest idea what's causing this inconsistent behaviour, but it's clear to me that even only running stuff from VS can be tricky at times. 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 Martin Maly Verzonden: Friday, November 18, 2005 4:26 AM Aan: Discussion of IronPython Onderwerp: Re: [IronPython] Problem: AllowDrop = True --> DragDrop registration failed Actually, I wonder if this is related to the recent change in IronPython. When debugging IronPython we found out that Visual Studio often complains about the aplication thread being marked as STA and not pumping messages and our investigations showed that the way to make Visual Studio happy was to remove the STAThread attribute from IronPython's Main and go with the default. It creates an interesting class of problems, having the engine be marked one way, and the application running in it needing different apartment settings. Could you try putting the STAThread attribute back on the IronPython Main and let me know if you got things working that way? I am interested to know what implications it may have to have the main IronPython thread marked either way. thanks very much Martin _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. de Hooge Sent: Thursday, November 17, 2005 6:00 PM To: users at lists.ironpython.com Subject: [IronPython] Problem: AllowDrop = True --> DragDrop registration failed Hi, In the past months I've been coding quite extensively using previous versions of IronPython (upto 0.9.3) and the .NET 2.0 framework beta. One of the things I've been using a lot is drag&drop. Recently I've downloaded IP 0.9.5 and the "final" .NET 2.0 distribution. Setting the AllowDrop property of e.g. a Forms.ListView to True now results in an exception message: DragDrop registration failed. >From the internet I've gathered that I should change the ApartmentState of my main thread to STA, using an attribute. But how can I do that from IP? And why is MTA the default, causing this problem? Or is there a different solution. Any help appreciated. Thanks Jacques de Hooge info at geatec.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at geatec.com Fri Nov 18 11:29:16 2005 From: info at geatec.com (J. de Hooge) Date: Fri, 18 Nov 2005 11:29:16 +0100 Subject: [IronPython] Problem: AllowDrop = True --> DragDropregistrationfailed In-Reply-To: <1E66B509DC78F74BA1CC22C625B096D103C843@dc.iunknown.com> Message-ID: <000501c5ec2a$f065c470$6402a8c0@GEADELL> Thanks for the info! Jacques -----Oorspronkelijk bericht----- Van: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Namens John Lam Verzonden: Friday, November 18, 2005 3:25 AM Aan: Discussion of IronPython Onderwerp: Re: [IronPython] Problem: AllowDrop = True --> DragDropregistrationfailed MTA is default due to a change in the behavior of the Whidbey CLR. In earlier versions of the CLR, CoInitializeEx was not called in *most* cases. So you could tell your thread to enter an STA via a change to ApartmentState in *most* cases. The default in Whidbey is to put all threads in the MTA which is more predictable, even at the expense of breaking applications that manually set the ApartmentState of a thread after execution has started. You must declare the COM requirements of the startup thread via an STAThread attribute in your application's Main() method. I'm not sure how attributes are supported in IP (I've run into this problem in my Ruby bridge - and have a non-ideal solution to it as well). HTH, -John http://www.iunknown.com _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. de Hooge Sent: Thursday, November 17, 2005 9:00 PM To: users at lists.ironpython.com Subject: [IronPython] Problem: AllowDrop = True --> DragDrop registrationfailed Hi, In the past months I've been coding quite extensively using previous versions of IronPython (upto 0.9.3) and the .NET 2.0 framework beta. One of the things I've been using a lot is drag&drop. Recently I've downloaded IP 0.9.5 and the "final" .NET 2.0 distribution. Setting the AllowDrop property of e.g. a Forms.ListView to True now results in an exception message: DragDrop registration failed. >From the internet I've gathered that I should change the ApartmentState of my main thread to STA, using an attribute. But how can I do that from IP? And why is MTA the default, causing this problem? Or is there a different solution. Any help appreciated. Thanks Jacques de Hooge info at geatec.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Fri Nov 18 15:46:59 2005 From: jvm_cop at spamcop.net (J. Merrill) Date: Fri, 18 Nov 2005 09:46:59 -0500 Subject: [IronPython] Problem: AllowDrop = True --> DragDrop registration failed In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F558FA55@df-foxhound-msg.exc hange.corp.microsoft.com> References: <000001c5ebe3$da560060$6402a8c0@GEADELL> Message-ID: <4.3.2.7.2.20051118094237.05686c08@mail.comcast.net> A concession to reality could be that IP has to know (either figure out or be told) whether the app is intended to be a GUI (WinForms) app. If it's GUI, then STAThread becomes the default. I don't recall, off-hand, what the IP syntax is for specifying attributes -- particularly when (in C# or VB.Net) you use the STAThread attribute on the _class_ that represents your app, and IP's Main is not explicitly in a class. At 10:26 PM 11/17/2005, Martin Maly wrote >Actually, I wonder if this is related to the recent change in IronPython. When debugging IronPython we found out that Visual Studio often complains about the aplication thread being marked as STA and not pumping messages and our investigations showed that the way to make Visual Studio happy was to remove the STAThread attribute from IronPython's Main and go with the default. > >It creates an interesting class of problems, having the engine be marked one way, and the application running in it needing different apartment settings. > >Could you try putting the STAThread attribute back on the IronPython Main and let me know if you got things working that way? I am interested to know what implications it may have to have the main IronPython thread marked either way. > >thanks very much >Martin > > >---------- >From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. de Hooge >Sent: Thursday, November 17, 2005 6:00 PM >To: users at lists.ironpython.com >Subject: [IronPython] Problem: AllowDrop = True --> DragDrop registration failed > >Hi, > >In the past months I've been coding quite extensively using previous versions of IronPython (upto 0.9.3) and the .NET 2.0 framework beta. >One of the things I've been using a lot is drag&drop. > >Recently I've downloaded IP 0.9.5 and the "final" .NET 2.0 distribution. >Setting the AllowDrop property of e.g. a Forms.ListView to True now results in an exception message: DragDrop registration failed. > >From the internet I've gathered that I should change the ApartmentState of my main thread to STA, using an attribute. >But how can I do that from IP? And why is MTA the default, causing this problem? > >Or is there a different solution. >Any help appreciated. > >Thanks >Jacques de Hooge >info at geatec.com J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From jlam at iunknown.com Fri Nov 18 16:51:18 2005 From: jlam at iunknown.com (John Lam) Date: Fri, 18 Nov 2005 10:51:18 -0500 Subject: [IronPython] Problem: AllowDrop = True --> DragDrop registration failed References: <000001c5ebe3$da560060$6402a8c0@GEADELL> <4.3.2.7.2.20051118094237.05686c08@mail.comcast.net> Message-ID: <1E66B509DC78F74BA1CC22C625B096D1E1C2@dc.iunknown.com> This is the same problem that I have with my Ruby <-> CLR bridge. The way I "solve" this problem is through a wrapper for the ruby.exe interpreter - winruby.exe that will instruct my bridge to turn on COM the right way. In my case, the CLR isn't loaded until my bridge is loaded, so I can initialize the CLR via an unmanaged shim prior to hoisting the CLR into memory. -John http://www.iunknown.com -----Original Message----- From: users-bounces at lists.ironpython.com on behalf of J. Merrill Sent: Fri 11/18/2005 9:46 AM To: Discussion of IronPython Subject: Re: [IronPython] Problem: AllowDrop = True --> DragDrop registration failed A concession to reality could be that IP has to know (either figure out or be told) whether the app is intended to be a GUI (WinForms) app. If it's GUI, then STAThread becomes the default. I don't recall, off-hand, what the IP syntax is for specifying attributes -- particularly when (in C# or VB.Net) you use the STAThread attribute on the _class_ that represents your app, and IP's Main is not explicitly in a class. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sdrucker at microsoft.com Mon Nov 21 19:00:00 2005 From: sdrucker at microsoft.com (Steven Drucker) Date: Mon, 21 Nov 2005 10:00:00 -0800 Subject: [IronPython] Threading question on IP and Avalon (WPF) Message-ID: This is probably more a WPF question rather than IronPython, but here goes... I'm using WPF to do some drawing from IP and it only updates when the IP thread is idle (waiting for an input). What I'd like to do is be able to set some interface elements (like a textblock) with text indicating the progress along a fairly involved activity. While I can set the text from within IP, it only shows the results when the entire activity is done, and the IP prompt is idle. While I have had some limited success in spawning a second thread and processing activity there and calling back into the Application.Dispatcher to change the interface elements, this makes the programming model MUCH more complicated for the activities that I'm trying to get done. Is there a relatively simple solution? Perhaps an 'update' call that I can make this will make sure that the WPF interface is up-to-date? Or a different priority level on which to be calling the IP main thread? Thanks! --S -------------- next part -------------- An HTML attachment was scrubbed... URL: From lobrien at knowing.net Mon Nov 21 19:48:02 2005 From: lobrien at knowing.net (Larry O'Brien) Date: Mon, 21 Nov 2005 08:48:02 -1000 Subject: [IronPython] Threading question on IP and Avalon (WPF) In-Reply-To: Message-ID: <000e01c5eecc$1c1c1a30$54544e90$@net> Have you investigated the BackgroundWorker class?: On your BackgroundWorker instance, set the WorkerReportsProgress to true, and Add your UI delegate to the ProgressChanged event, and Have your activity call ReportProgress() every once in awhile Cheers, Larry -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Mon Nov 21 19:52:56 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Mon, 21 Nov 2005 10:52:56 -0800 Subject: [IronPython] Threading question on IP and Avalon (WPF) Message-ID: I don't suppose something as simple as Thread.Sleep(1) would prompt a repaint? ----- Keith J. Farmer kfarmer at thuban.org ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Steven Drucker Sent: Monday, 21 November 2005 10:00 To: users-ironpython.com at lists.ironpython.com Subject: [IronPython] Threading question on IP and Avalon (WPF) This is probably more a WPF question rather than IronPython, but here goes... I'm using WPF to do some drawing from IP and it only updates when the IP thread is idle (waiting for an input). What I'd like to do is be able to set some interface elements (like a textblock) with text indicating the progress along a fairly involved activity. While I can set the text from within IP, it only shows the results when the entire activity is done, and the IP prompt is idle. While I have had some limited success in spawning a second thread and processing activity there and calling back into the Application.Dispatcher to change the interface elements, this makes the programming model MUCH more complicated for the activities that I'm trying to get done. Is there a relatively simple solution? Perhaps an 'update' call that I can make this will make sure that the WPF interface is up-to-date? Or a different priority level on which to be calling the IP main thread? Thanks! --S -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian_raynes at dnr.state.ak.us Mon Nov 21 23:39:05 2005 From: brian_raynes at dnr.state.ak.us (Brian Raynes) Date: Mon, 21 Nov 2005 13:39:05 -0900 Subject: [IronPython] keyword argument in Form or Button constructor Message-ID: <43824C89.2090006@dnr.state.ak.us> I was following along in the tutorial (I'm using Iron Python 0.9.5 and .NET 2.0 framework that installs from the Visual C# Express Edition). The tutorial section that deals with adding a button click event handler directs us to create the click handler like this: def click(f, a): l = Label(Text = "Hello") l.Location = a.Location f.Controls.Add(l) After registering this handler, I did not see the labels appear on the form. Checking, I was able to confirm that label controls are added, but their Text property is an empty string. If I change the handler function like this, without using a keyword argument in the Label constructor, it works like expected: def click(f, a): l = Label() l.Text = "Hello" l.Location = a.Location f.Controls.Add(l) Playing around with keyword arguments in the constructor for Form() yielded similar results (empty string for .Text property): f = Form(Text="Hello") print f.Text Are keyword arguments in the constructor supposed to work in these cases? If they do not, it would be a really nice feature. In either case, the tutorial should reflect what does work, or at least what will work when 1.0 is released. Brian Raynes -- *********************************************************************** * Brian Raynes * * Land Surveyor I * * 907-269-8519 - brian_raynes at dnr.state.ak.us * * Division of Mining, Land & Water * * Dept. of Natural Resources, State of Alaska * *********************************************************************** From lkcl at lkcl.net Tue Nov 22 11:44:10 2005 From: lkcl at lkcl.net (Luke Kenneth Casson Leighton) Date: Tue, 22 Nov 2005 10:44:10 +0000 Subject: [IronPython] IronPython: how to display a PNG Message-ID: <20051122104410.GV8762@lkcl.net> hi there, the concept of ironpython? absolutely _love_ it - and am prepared to stick with it until i find a solution. this should be a simple, simple task: how to display a PNG image, and change it to another image, to make a stop-motion animated figure on-screen, using IronPython. the plan is to have the same program work on linux and windows (so that means 0.6 because mono - at least apt-get install mono - doesn't support .net 2.0 stuff yet on linux: IronPython 0.9.4 and 0.9.5 throw an error about some attributes missing) i've spent 3 days, several hours per day, looking for example code, dealing with monodoc (apt-get install monodoc) crashing, finding out that you have to do this in order to be able to get to Gdk: import sys sys.LoadAssemblyFromFile ("/usr/share/dotnet/mono/gtk-sharp/gdk-sharp.dll") import Gdk and finding out that that's not enough, you also have to do this (at least, the first two lines, you do - i added the other two myself to see if it made any difference to _another_ problem) quite literally, and very unusually, i can't find _any_ working examples of code that will display PNGs on-screen. i found this: http://svn.usefulinc.com/svn/repos/trunk/ironpython/monodn/04-gtk/05-graphics/main.py but it has bugs in it that stop it from working - fix the typos and it starts throwing up GDK_DRAWING assertions about depth = -1 or drawing = NULL. it's all very weird because everyone's raging about IronPython and how good it is: can you find _working_ example code that DoesTheJob(tm)? ...mmmm.... nope! the ironpython list archives aren't even searchable by google! so - could someone _please_ please point me in an appropriate direction of some example code or a tutorial with example code-fragments of how to friggin display PNGs on a screen. really appreciated. l. -- -- http://lkcl.net -- From tinuviel at sparcs.kaist.ac.kr Tue Nov 22 15:20:00 2005 From: tinuviel at sparcs.kaist.ac.kr (Seo Sanghyeon) Date: Tue, 22 Nov 2005 23:20:00 +0900 Subject: [IronPython] IronPython: how to display a PNG In-Reply-To: <20051122104410.GV8762@lkcl.net> References: <20051122104410.GV8762@lkcl.net> Message-ID: <20051122142000.GA16851@sparcs.kaist.ac.kr> On Tue, Nov 22, 2005 at 10:44:10AM +0000, Luke Kenneth Casson Leighton wrote: > > the plan is to have the same program work on linux and windows > (so that means 0.6 because mono - at least apt-get install > mono - doesn't support .net 2.0 stuff yet on linux: IronPython > 0.9.4 and 0.9.5 throw an error about some attributes missing) Wrong. I am using plain Debian Sid, and IronPython 0.9.5 works without problems. apt-get install mono mono-classlib-2.0 > and finding out that that's not enough, you also have to do this (at > least, the first two lines, you do - i added the other two myself to see > if it made any difference to _another_ problem) > > > > > Wrong. This is absolutely unnecessary if you install properly. Following apt-get line or install from source both work. apt-get install libgtk2.0-cil > it's all very weird because everyone's raging about IronPython and how > good it is: can you find _working_ example code that DoesTheJob(tm)? Sure. Have some common sense, look at Gtk# documentation, and experiment. If you are that much in hurry, here it is: (took 30 minutes or so for me, and this is my first time using Gtk#.) http://sparcs.kaist.ac.kr/~tinuviel/devel/fepy/pixbuf.py > so - could someone _please_ please point me in an appropriate > direction of some example code or a tutorial with example > code-fragments of how to friggin display PNGs on a screen. Given as requested. Seo Sanghyeon From jimhug at exchange.microsoft.com Tue Nov 22 21:43:01 2005 From: jimhug at exchange.microsoft.com (Jim Hugunin) Date: Tue, 22 Nov 2005 12:43:01 -0800 Subject: [IronPython] IronPython on MSDN TV and other blogging Message-ID: I've started blogging again now that we've shipped .NET 2.0. My most recent blog is about an IronPython demo video that you can download from the MSDN site. Links are available here: http://blogs.msdn.com/hugunin/default.aspx I hope to follow-up soon with technical blogs on the hard design issues for finishing IronPython 1.0. Thanks - Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From nnorwitz at gmail.com Sat Nov 19 01:44:55 2005 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 18 Nov 2005 16:44:55 -0800 Subject: [IronPython] status of 0.9.5 Message-ID: Hello. I'm curious about the status of iron. I was happy to see the mailling list seemed fairly active in November. I would specifically like to know how many of the Python 2.4 unittests pass/don't pass. I'd also like to know the speed. Jim had impressive numbers a long time ago, but now that it has matured, has the perf changed much. What is the perf on .NET vs. Mono? Finally, how many tests fail and are there things which should be changed in the python tests because there are assumptions about the environment. There are already conditions dealing with windows, darwin, jython, etc. Are any other changes necessary for iron python? Thanks, n From kfarmer at thuban.org Wed Nov 23 04:36:52 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Tue, 22 Nov 2005 19:36:52 -0800 Subject: [IronPython] status of 0.9.5 References: Message-ID: Check out the video of JimH: http://blogs.msdn.com/hugunin/default.aspx .. It shows him importing the 2.4 library. IronPython is distributed with the unit tests, which you can run (you may have to enable some). Not much of an answer, I grant, but it's better than muzak for waiting. ;) ________________________________ From: users-bounces at lists.ironpython.com on behalf of Neal Norwitz Sent: Fri 11/18/2005 4:44 PM To: users at lists.ironpython.com Subject: [IronPython] status of 0.9.5 Hello. I'm curious about the status of iron. I was happy to see the mailling list seemed fairly active in November. I would specifically like to know how many of the Python 2.4 unittests pass/don't pass. I'd also like to know the speed. Jim had impressive numbers a long time ago, but now that it has matured, has the perf changed much. What is the perf on .NET vs. Mono? Finally, how many tests fail and are there things which should be changed in the python tests because there are assumptions about the environment. There are already conditions dealing with windows, darwin, jython, etc. Are any other changes necessary for iron python? -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 4093 bytes Desc: not available URL: From korpse-ironpython at kaydash.za.net Wed Nov 23 14:05:41 2005 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Wed, 23 Nov 2005 15:05:41 +0200 Subject: [IronPython] Events and the += operator Message-ID: <43846925.4030001@kaydash.za.net> Hi, (I did a couple of searches on the archives and checked the bug tracker but still found nothing directly relating to this. Hopefully I didn't miss anything.) I'm having a problem trying to attach an event handler to System.Windows.Forms.Application.Idle: >>> System.Windows.Forms.Application.Idle >>> def _(sender, e): ... print 'Zzzz' ... >>> System.Windows.Forms.Application.Idle += _ Traceback (most recent call last): at TypeError: can't set attributes of built-in/extension type 'System.Windows.Forms.Application' At first glance, it looks like this didn't work. However, creating a Form object and passing it to Application.Run does indeed print 'Zzzz' when idle. Stepping through the code indicates that InPlaceAdd mimics the C# += syntax for events (ie. attaches the event handler) and that AugAssignStmt always emits a "set", which correlates with CPython's behaviour as seen below (I'm not sure whether this is part of the Python specification or not, anyway): >>> l = ([], []) >>> l[0] += [1, 2] Traceback (most recent call last): File "", line 1, in ? TypeError: object does not support item assignment It would seem that IronPython needs a more Pythonic (or less C#ish, if you prefer) way of doing this. In the meanwhile, one can get around it by either doing: >>> Application.Idle.__iadd__(_) or >>> try: >>> Application.Idle += _ >>> except TypeError: >>> pass Regards -- Jonathan When you meet a master swordsman, show him your sword. When you meet a man who is not a poet, do not show him your poem. -- Rinzai, ninth century Zen master From Martin.Maly at microsoft.com Wed Nov 23 18:59:24 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 23 Nov 2005 09:59:24 -0800 Subject: [IronPython] status of 0.9.5 In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F56497C6@df-foxhound-msg.exchange.corp.microsoft.com> Great question. Actually, for the purpose of tracking what tests pass/fail/haven't run yet ... We created an IronPython wiki on Channel9. Check the wiki at: http://channel9.msdn.com/wiki/default.aspx/IronPython.HomePage And the Python 2.4 test list at: http://channel9.msdn.com/wiki/default.aspx/IronPython.RegressionTests Hope this helps. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Neal Norwitz Sent: Friday, November 18, 2005 4:45 PM To: users at lists.ironpython.com Subject: [IronPython] status of 0.9.5 Hello. I'm curious about the status of iron. I was happy to see the mailling list seemed fairly active in November. I would specifically like to know how many of the Python 2.4 unittests pass/don't pass. I'd also like to know the speed. Jim had impressive numbers a long time ago, but now that it has matured, has the perf changed much. What is the perf on .NET vs. Mono? Finally, how many tests fail and are there things which should be changed in the python tests because there are assumptions about the environment. There are already conditions dealing with windows, darwin, jython, etc. Are any other changes necessary for iron python? Thanks, n _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From tinuviel at sparcs.kaist.ac.kr Thu Nov 24 06:41:49 2005 From: tinuviel at sparcs.kaist.ac.kr (Seo Sanghyeon) Date: Thu, 24 Nov 2005 14:41:49 +0900 Subject: [IronPython] Crash on method call Message-ID: <20051124054149.GA5852@sparcs.kaist.ac.kr> With following code, IronPython 0.9.5 crashes with the message "Unhandled Exception: no value for arg". class C: def foo(self, arg, bar): pass obj = C() obj.foo(None, bar=1) Above testcase was reduced from Python standard library's optparse.py, line 1120, in Python 2.4.2. Seo Sanghyeon From dinov at exchange.microsoft.com Thu Nov 24 07:15:15 2005 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 23 Nov 2005 22:15:15 -0800 Subject: [IronPython] Crash on method call In-Reply-To: <20051124054149.GA5852@sparcs.kaist.ac.kr> References: <20051124054149.GA5852@sparcs.kaist.ac.kr> Message-ID: <4039D552ADAB094BB1EA670F3E96214E235C0C@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the bug report Seo. We've had a similar bug in our database that I believe I fixed last week (I'm away currently so I can't verify) but I will confirm this next week after the Thanksgiving holiday and let you know if it'll be present in our next release. ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Seo Sanghyeon Sent: Wednesday, November 23, 2005 9:41 PM To: users at lists.ironpython.com Subject: [IronPython] Crash on method call With following code, IronPython 0.9.5 crashes with the message "Unhandled Exception: no value for arg". class C: def foo(self, arg, bar): pass obj = C() obj.foo(None, bar=1) Above testcase was reduced from Python standard library's optparse.py, line 1120, in Python 2.4.2. Seo Sanghyeon _______________________________________________ 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 lkcl at lkcl.net Fri Nov 25 13:18:31 2005 From: lkcl at lkcl.net (Luke Kenneth Casson Leighton) Date: Fri, 25 Nov 2005 12:18:31 +0000 Subject: [IronPython] IronPython: how to display a PNG In-Reply-To: <20051122104410.GV8762@lkcl.net> References: <20051122104410.GV8762@lkcl.net> Message-ID: <20051125121831.GR9467@lkcl.net> dear seo, thank you for responding. i hope you don't mind me relating my experiences here, but i have since resolved the issues i had. firstly, i added debian/testing as well as debian/unstable, and that made it possible to upgrade to mono 1.1.10 - it is mono 1.1.9 and the associated libraries libgtk2.0-cil from former (not-absolute-latest) versions that require the mono config trick. your comments were very helpful: they gave me the confidence to try IronPython 0.9.5 again, and this time it worked. what mono 1.1.10 still _won't_ do is _compile_ IronPython 0.9.5 (but it will do 0.9.4) thank you for the tip about gdk pixbuf. one really important question: how on earth did you _find_ it? i quite literally spent 6 to 8 hours over a period of three days searching with different google terms. your advice on what search criteria you used would therefore be absolutely invaluable: every coding environment has a different feel to the nebulous search criteria... "thing" and i could really do with some tips. for example, i'm now trying to find example code on how to parse xml documents (i note that Serialization is still under dev), to easily store and retrieve data - and once again i am at sea and floundering about, searching for things like "System.XML IronPython", "System.XML filetype:py" - to no avail. many thanks, l. p.s. after all that, Gtk.Image("monkey.png") works just fine. i believe i may have been caught out by the "delay in just-in-time compiling" that occasionally lags a recompile behind the last edit, resulting in a spurious runtime error that disappears when you re-run the [unmodified!] program a second time. From Martin.Maly at microsoft.com Fri Nov 25 20:48:32 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 25 Nov 2005 11:48:32 -0800 Subject: [IronPython] IronPython on MSDN TV and other blogging In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5649ABB@df-foxhound-msg.exchange.corp.microsoft.com> Wow, this is awesome!!! No wonder everyone gave it the highest rating so far. M. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jim Hugunin Sent: Tuesday, November 22, 2005 12:43 PM To: users at lists.ironpython.com Subject: [IronPython] IronPython on MSDN TV and other blogging I've started blogging again now that we've shipped .NET 2.0. My most recent blog is about an IronPython demo video that you can download from the MSDN site. Links are available here: http://blogs.msdn.com/hugunin/default.aspx I hope to follow-up soon with technical blogs on the hard design issues for finishing IronPython 1.0. Thanks - Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From srinivasarao_k at apollolife.com Sat Nov 26 07:02:23 2005 From: srinivasarao_k at apollolife.com (SrinivasaRao) Date: Sat, 26 Nov 2005 11:32:23 +0530 Subject: [IronPython] MSDB Message-ID: Hi, Please any one help to me by providing MSDB sourceCode. I taked from the address http://www.microsoft.com/downloads/details.aspx?familyid=38449a42-6b7a-4e28- 80ce-c55645ab1310&displaylang=en but its not working, means it is not build in my system. If any one find its then provide to me ASAP. My system configuration is --> 1. o.s -- Windows 2000 2. 2.0 .NET Framework. 3. C# 2005 Express edition -- editior. If any one helps to me in this issue then I will be very happey... Thanks Srinivasa Rao. Software Engineer. Apollo Health street Ltd. Hyderabad, India. Mobile : 91-9885334248. ? This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please notify the ISMS team of AHSL through ISMS at apollolife.com? From jvm_cop at spamcop.net Sun Nov 27 06:04:32 2005 From: jvm_cop at spamcop.net (J. Merrill) Date: Sun, 27 Nov 2005 00:04:32 -0500 Subject: [IronPython] MSDB In-Reply-To: Message-ID: <4.3.2.7.2.20051127000238.059a5d20@mail.comcast.net> The documentation says that you need the .Net 2.0 SDK beta 2 release. Do you have that? Isn't the source code in what you downloaded? The fact that it won't build is likely because you don't have the .Net 2.0 beta 2 SDK. I don't know if the compiled code will work on the official 2.0 release. At 01:02 AM 11/26/2005, SrinivasaRao wrote >Hi, > > Please any one help to me by providing MSDB sourceCode. > I taked from the address >http://www.microsoft.com/downloads/details.aspx?familyid=38449a42-6b7a-4e28- >80ce-c55645ab1310&displaylang=en but its not working, means it is not build >in my system. >If any one find its then provide to me ASAP. > >My system configuration is --> >1. o.s -- Windows 2000 >2. 2.0 .NET Framework. >3. C# 2005 Express edition -- editior. > >If any one helps to me in this issue then I will be very happey... > > >Thanks >Srinivasa Rao. >Software Engineer. >Apollo Health street Ltd. >Hyderabad, India. >Mobile : 91-9885334248. J. Merrill / Analytical Software Corp From srinivasarao_k at apollolife.com Sun Nov 27 08:15:55 2005 From: srinivasarao_k at apollolife.com (SrinivasaRao) Date: Sun, 27 Nov 2005 12:45:55 +0530 Subject: [IronPython] MSDB In-Reply-To: <4.3.2.7.2.20051127000238.059a5d20@mail.comcast.net> Message-ID: Yh, I have .net 2.0 framework which is instailed from MSDN site. Can u tell me the steps before building the project. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com]On Behalf Of J. Merrill Sent: Sunday, November 27, 2005 10:35 AM To: Discussion of IronPython Subject: Re: [IronPython] MSDB The documentation says that you need the .Net 2.0 SDK beta 2 release. Do you have that? Isn't the source code in what you downloaded? The fact that it won't build is likely because you don't have the .Net 2.0 beta 2 SDK. I don't know if the compiled code will work on the official 2.0 release. At 01:02 AM 11/26/2005, SrinivasaRao wrote >Hi, > > Please any one help to me by providing MSDB sourceCode. > I taked from the address >http://www.microsoft.com/downloads/details.aspx?familyid=38449a42-6b7a-4e28 - >80ce-c55645ab1310&displaylang=en but its not working, means it is not build >in my system. >If any one find its then provide to me ASAP. > >My system configuration is --> >1. o.s -- Windows 2000 >2. 2.0 .NET Framework. >3. C# 2005 Express edition -- editior. > >If any one helps to me in this issue then I will be very happey... > > >Thanks >Srinivasa Rao. >Software Engineer. >Apollo Health street Ltd. >Hyderabad, India. >Mobile : 91-9885334248. J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ? This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please notify the ISMS team of AHSL through ISMS at apollolife.com? From daftspaniel at gmail.com Sun Nov 27 22:28:36 2005 From: daftspaniel at gmail.com (Davy Mitchell) Date: Sun, 27 Nov 2005 21:28:36 +0000 Subject: [IronPython] WinForms Text Missing Message-ID: <20253b0c0511271328t27d4423u2f3e90a245f9b241@mail.gmail.com> Hi Folks, Hope your weekend was good. I am having an issue with running WinForms applications in 0.9.5. Controls such as buttons (but not menus) don't seem to show any text. This applies to the example GUI script too. Anyone else seen this? Thanks, Davy Mitchell Mood News - BBC News Headlines Auto-Classified as Good, Bad or Neutral. http://www.latedecember.com/sites/moodnews/ From acormier at gmail.com Sun Nov 27 22:57:57 2005 From: acormier at gmail.com (Alain Cormier) Date: Sun, 27 Nov 2005 22:57:57 +0100 Subject: [IronPython] WinForms Text Missing In-Reply-To: <20253b0c0511271328t27d4423u2f3e90a245f9b241@mail.gmail.com> References: <20253b0c0511271328t27d4423u2f3e90a245f9b241@mail.gmail.com> Message-ID: <8e3d16bf0511271357l1a9b05d1u6ad3b186444265@mail.gmail.com> Hi Davy, I have the same problem when I interactively creating a simple WinFX WPF form. The one button on the form doesn't show any text. Cheers, Alain On 11/27/05, Davy Mitchell wrote: > Hi Folks, > > Hope your weekend was good. > > I am having an issue with running WinForms applications in 0.9.5. > Controls such as buttons (but not menus) don't seem to show any text. > This applies to the example GUI script too. > > Anyone else seen this? > > Thanks, > Davy Mitchell > > Mood News > - BBC News Headlines Auto-Classified as Good, Bad or Neutral. > http://www.latedecember.com/sites/moodnews/ > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From gmane.10.laughingboy at spamgourmet.com Mon Nov 28 01:11:38 2005 From: gmane.10.laughingboy at spamgourmet.com (Mike Krell) Date: Mon, 28 Nov 2005 00:11:38 +0000 (UTC) Subject: [IronPython] WinForms Text Missing References: <20253b0c0511271328t27d4423u2f3e90a245f9b241@mail.gmail.com> <8e3d16bf0511271357l1a9b05d1u6ad3b186444265@mail.gmail.com> Message-ID: I had an issue with 0.9.5 and the forms tutorial example also. The example is supposed to create a new text box on the form at every point where the mouse is clicked. It actually does this, but the text is not visible. However, if you interactively loop over the controls and change the text, font, color, etc., then the change takes effect and you can see all the controls. Mike From jvm_cop at spamcop.net Mon Nov 28 04:14:50 2005 From: jvm_cop at spamcop.net (J. Merrill) Date: Sun, 27 Nov 2005 22:14:50 -0500 Subject: [IronPython] MSDB In-Reply-To: References: <4.3.2.7.2.20051127000238.059a5d20@mail.comcast.net> Message-ID: <4.3.2.7.2.20051127221256.057cb2d0@mail.comcast.net> You need the *** beta 2 *** SDK release, *** not *** the final one -- at least, that's what the download page says. There is a link on that page to let you download it -- and you will also need the beta 2 redistributable. At 02:15 AM 11/27/2005, SrinivasaRao wrote >Yh, I have .net 2.0 framework which is instailed from MSDN site. >Can u tell me the steps before building the project. > > >-----Original Message----- >From: users-bounces at lists.ironpython.com >[mailto:users-bounces at lists.ironpython.com]On Behalf Of J. Merrill >Sent: Sunday, November 27, 2005 10:35 AM >To: Discussion of IronPython >Subject: Re: [IronPython] MSDB > > >The documentation says that you need the .Net 2.0 SDK beta 2 release. Do >you have that? > >Isn't the source code in what you downloaded? The fact that it won't build >is likely because you don't have the .Net 2.0 beta 2 SDK. > >I don't know if the compiled code will work on the official 2.0 release. > >At 01:02 AM 11/26/2005, SrinivasaRao wrote >>Hi, >> >> Please any one help to me by providing MSDB sourceCode. >> I taked from the address >>http://www.microsoft.com/downloads/details.aspx?familyid=38449a42-6b7a-4e28 >- >>80ce-c55645ab1310&displaylang=en but its not working, means it is not build >>in my system. >>If any one find its then provide to me ASAP. >> >>My system configuration is --> >>1. o.s -- Windows 2000 >>2. 2.0 .NET Framework. >>3. C# 2005 Express edition -- editior. >> >>If any one helps to me in this issue then I will be very happey... >> >> >>Thanks >>Srinivasa Rao. >>Software Engineer. >>Apollo Health street Ltd. >>Hyderabad, India. >>Mobile : 91-9885334248. J. Merrill / Analytical Software Corp From borice23 at yahoo.com Mon Nov 28 07:18:13 2005 From: borice23 at yahoo.com (Boris Capitanu) Date: Sun, 27 Nov 2005 22:18:13 -0800 (PST) Subject: [IronPython] import socket fails on Win32 In-Reply-To: Message-ID: <20051128061813.15088.qmail@web81206.mail.mud.yahoo.com> Hello! First let me say Thank You for the wonderful job you guys have been doing so far with IronPython. I've been a long time user of Python.NET and have been very happy with the Python integration, with the only downside being that debugging is a little painfull when you can't step through the code or inspect variables. This is why I am now moving to IronPython. Most of my code transitioned perfectly to IronPython, however I did reach one module that failed importing "socket" on a Windows platform. I've traced the problem to a precompiled library in \Pyton24\DLLs folder, called _socket.pyd which is imported from \Python24\Lib\socket.py Apparently IronPython cannot handle the precompiled libraries yet. Any ideas on what needs to be done in order for this to work? Thank you very much. Boris Capitanu From borice23 at yahoo.com Mon Nov 28 07:41:13 2005 From: borice23 at yahoo.com (Boris Capitanu) Date: Sun, 27 Nov 2005 22:41:13 -0800 (PST) Subject: [IronPython] Embedding Python question In-Reply-To: Message-ID: <20051128064113.15180.qmail@web81202.mail.mud.yahoo.com> Hello again. This questions is regarding debugging a program without restarting by refreshing the in-memory script every time it has changed. Given the following scenario: PythonEngine engine = new PythonEngine(); void DoSomething(object arg0, object arg1) { engine.Import("SomeScript") Function f = engine.Evaluate("SomeScript.foo") as Function f.Call(arg0, arg1); } Now suppose that there is a form with a button on the screen, and the button's click event is wired to call "DoSomething". Now, DoSomething makes a call to a function "foo" in SomeScript.py. Everything works fine, i.e. when I run the application, function "foo" is invoked with the correct arguments. However, I'd like to be able to change what foo does in the script, without having to restart the application. That is, when the button is clicked, 'engine.Import("SomeScript")' should check that SomeScript.py has changed (the file modification time is different than last time it was loaded), and reload that script so that the updated 'foo' function is called. Currently the only way I can achieve the above behaviour is using engine.ExecuteFile(...) instead of engine.Import(...), but the problem with that is that functions I can no longer call "SomeScript.foo()", and I have to call "foo()" directly. However, if I have multiple "foo" defined in different script files, they overwrite eachother. To solve this problem, I added a new function called ExecuteFileInNewModule which is basically identical with the RunFileInNewModule function, with the only addition being a line like "topFrame.SetGlobal(moduleName, mod)". Now this seems to do the trick, however every time the execution gets slower and slower, as the number of modules generated increases, so it's not really a viable solution. Any ideas? Thank you, Boris Capitanu From borice23 at yahoo.com Mon Nov 28 07:52:17 2005 From: borice23 at yahoo.com (Boris Capitanu) Date: Sun, 27 Nov 2005 22:52:17 -0800 (PST) Subject: [IronPython] System.NotImplementedException encountered In-Reply-To: Message-ID: <20051128065217.92475.qmail@web81210.mail.mud.yahoo.com> Is formatting support on the TODO list already? :-) IronPython 0.9.5 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> ip = "10.20.30.40" >>> hexip = ''.join(["%04x" % long(i) for i in ip.split('.')]) Traceback (most recent call last): at System.NotImplementedException: format code 0 >>> From kfarmer at thuban.org Mon Nov 28 09:22:35 2005 From: kfarmer at thuban.org (Keith J. Farmer) Date: Mon, 28 Nov 2005 00:22:35 -0800 Subject: [IronPython] import socket fails on Win32 Message-ID: Not addressing the import of python byte code, have you taken a look at .NET's TcpListener and TcpClient classes? I've grown rather fond of them in a recent project. Otherwise, some Python bytecode -> Python source -> IL path would need to happen. If the bytecode references a C-code Python dll, that would need some wrapper created (akin to a DllImport-attributed method in C#), which I don't think would be difficult to pull off. ----- 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 Boris Capitanu Sent: Sunday, 27 November 2005 22:18 Most of my code transitioned perfectly to IronPython, however I did reach one module that failed importing "socket" on a Windows platform. I've traced the problem to a precompiled library in \Pyton24\DLLs folder, called _socket.pyd which is imported from \Python24\Lib\socket.py Apparently IronPython cannot handle the precompiled libraries yet. Any ideas on what needs to be done in order for this to work? From dinov at exchange.microsoft.com Mon Nov 28 17:21:58 2005 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 28 Nov 2005 08:21:58 -0800 Subject: [IronPython] Crash on method call In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E235C0C@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E7D93DF@df-foxhound-msg.exchange.corp.microsoft.com> I just verified this is indeed will be fixed in our next release. Thanks for letting us know about the issue! ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, November 23, 2005 10:15 PM To: Discussion of IronPython Subject: Re: [IronPython] Crash on method call Thanks for the bug report Seo. We've had a similar bug in our database that I believe I fixed last week (I'm away currently so I can't verify) but I will confirm this next week after the Thanksgiving holiday and let you know if it'll be present in our next release. ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Seo Sanghyeon Sent: Wednesday, November 23, 2005 9:41 PM To: users at lists.ironpython.com Subject: [IronPython] Crash on method call With following code, IronPython 0.9.5 crashes with the message "Unhandled Exception: no value for arg". class C: def foo(self, arg, bar): pass obj = C() obj.foo(None, bar=1) Above testcase was reduced from Python standard library's optparse.py, line 1120, in Python 2.4.2. Seo Sanghyeon _______________________________________________ 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 Mon Nov 28 18:16:32 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 28 Nov 2005 09:16:32 -0800 Subject: [IronPython] System.NotImplementedException encountered In-Reply-To: <20051128065217.92475.qmail@web81210.mail.mud.yahoo.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5649BB5@df-foxhound-msg.exchange.corp.microsoft.com> Yes. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Boris Capitanu Sent: Sunday, November 27, 2005 10:52 PM To: users at lists.ironpython.com Subject: [IronPython] System.NotImplementedException encountered Is formatting support on the TODO list already? :-) IronPython 0.9.5 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> ip = "10.20.30.40" >>> hexip = ''.join(["%04x" % long(i) for i in ip.split('.')]) Traceback (most recent call last): at System.NotImplementedException: format code 0 >>> _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Mon Nov 28 18:24:20 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 28 Nov 2005 09:24:20 -0800 Subject: [IronPython] import socket fails on Win32 In-Reply-To: <20051128061813.15088.qmail@web81206.mail.mud.yahoo.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5649BCA@df-foxhound-msg.exchange.corp.microsoft.com> Keith's suggestion to use the .NET classes is a great way to use sockets from IronPython. Ideally we should be also able to import 'socket' into IronPython which means implementing the _socket as an IronPython built-in module or writing a wrapper that would allow IronPyton to call _python.pyd directly. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Boris Capitanu Sent: Sunday, November 27, 2005 10:18 PM To: users at lists.ironpython.com Subject: [IronPython] import socket fails on Win32 Hello! First let me say Thank You for the wonderful job you guys have been doing so far with IronPython. I've been a long time user of Python.NET and have been very happy with the Python integration, with the only downside being that debugging is a little painfull when you can't step through the code or inspect variables. This is why I am now moving to IronPython. Most of my code transitioned perfectly to IronPython, however I did reach one module that failed importing "socket" on a Windows platform. I've traced the problem to a precompiled library in \Pyton24\DLLs folder, called _socket.pyd which is imported from \Python24\Lib\socket.py Apparently IronPython cannot handle the precompiled libraries yet. Any ideas on what needs to be done in order for this to work? Thank you very much. Boris Capitanu _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Mon Nov 28 18:30:24 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 28 Nov 2005 09:30:24 -0800 Subject: [IronPython] Events and the += operator In-Reply-To: <43846925.4030001@kaydash.za.net> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5649BE7@df-foxhound-msg.exchange.corp.microsoft.com> Hi Jonathan, We have bug in IronPython that prevents static events to be set. Instance events work just fine, it is the static ones (like Application.Idle) that cause trouble. We have the bug on our radar already and hopefully will fix it soon. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jonathan Jacobs Sent: Wednesday, November 23, 2005 5:06 AM To: Discussion of IronPython Subject: [IronPython] Events and the += operator Hi, (I did a couple of searches on the archives and checked the bug tracker but still found nothing directly relating to this. Hopefully I didn't miss anything.) I'm having a problem trying to attach an event handler to System.Windows.Forms.Application.Idle: >>> System.Windows.Forms.Application.Idle >>> def _(sender, e): ... print 'Zzzz' ... >>> System.Windows.Forms.Application.Idle += _ Traceback (most recent call last): at TypeError: can't set attributes of built-in/extension type 'System.Windows.Forms.Application' At first glance, it looks like this didn't work. However, creating a Form object and passing it to Application.Run does indeed print 'Zzzz' when idle. Stepping through the code indicates that InPlaceAdd mimics the C# += syntax for events (ie. attaches the event handler) and that AugAssignStmt always emits a "set", which correlates with CPython's behaviour as seen below (I'm not sure whether this is part of the Python specification or not, anyway): >>> l = ([], []) >>> l[0] += [1, 2] Traceback (most recent call last): File "", line 1, in ? TypeError: object does not support item assignment It would seem that IronPython needs a more Pythonic (or less C#ish, if you prefer) way of doing this. In the meanwhile, one can get around it by either doing: >>> Application.Idle.__iadd__(_) or >>> try: >>> Application.Idle += _ >>> except TypeError: >>> pass Regards -- Jonathan When you meet a master swordsman, show him your sword. When you meet a man who is not a poet, do not show him your poem. -- Rinzai, ninth century Zen master _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Mon Nov 28 20:06:34 2005 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 28 Nov 2005 11:06:34 -0800 Subject: [IronPython] WinForms Text Missing In-Reply-To: <20253b0c0511271328t27d4423u2f3e90a245f9b241@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E7D9571@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for reporting this Davy - this is a regression from our last release related to some changes in our __new__ and __init__ support. The good news is this only affects classes that have no parameters for their constructors. The fix is also quite simple; in Objects\ReflectedType.cs you can remove the code: if (PythonType.GetMaxArgs(callTarget) == 0) { return callTarget.Call(); } else In NewMethod.Call(object []args, string []names) This will be fixed in our next release (0.9.6). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Davy Mitchell Sent: Sunday, November 27, 2005 1:29 PM To: Discussion of IronPython Subject: [IronPython] WinForms Text Missing Hi Folks, Hope your weekend was good. I am having an issue with running WinForms applications in 0.9.5. Controls such as buttons (but not menus) don't seem to show any text. This applies to the example GUI script too. Anyone else seen this? Thanks, Davy Mitchell Mood News - BBC News Headlines Auto-Classified as Good, Bad or Neutral. http://www.latedecember.com/sites/moodnews/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From daftspaniel at gmail.com Mon Nov 28 23:13:20 2005 From: daftspaniel at gmail.com (Davy Mitchell) Date: Mon, 28 Nov 2005 22:13:20 +0000 Subject: [IronPython] WinForms Text Missing In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E7D9571@df-foxhound-msg.exchange.corp.microsoft.com> References: <20253b0c0511271328t27d4423u2f3e90a245f9b241@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E7D9571@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <20253b0c0511281413t7b2bee7fp268eb3eb5e189cd4@mail.gmail.com> Thanks Dino and everyone else. As suggested by Mike, I changed my code to access the properties rather than use the contructor. Everything is fine now. Cheers, Davy Mitchell From srinivasarao_k at apollolife.com Tue Nov 29 06:05:44 2005 From: srinivasarao_k at apollolife.com (SrinivasaRao) Date: Tue, 29 Nov 2005 10:35:44 +0530 Subject: [IronPython] Crash on method call In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E7D93DF@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: Hi, I downloaded mdbg v2.0, after I run the project i get MDBG command prompt, in that if I wite " PY 1+2 " command then it is showing an error message " no active process" sometimes " unrecognized command" etc Plese give me a solution for this as soon as possible.. Thanks Srinivasa Rao. Software Engineer. Apollo Health street Ltd. Hyderabad, India. Mobile : 91-9885334248. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com]On Behalf Of Dino Viehland Sent: Monday, November 28, 2005 9:52 PM To: Discussion of IronPython Subject: Re: [IronPython] Crash on method call I just verified this is indeed will be fixed in our next release. Thanks for letting us know about the issue! ---------------------------------------------------------------------------- -- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, November 23, 2005 10:15 PM To: Discussion of IronPython Subject: Re: [IronPython] Crash on method call Thanks for the bug report Seo. We've had a similar bug in our database that I believe I fixed last week (I'm away currently so I can't verify) but I will confirm this next week after the Thanksgiving holiday and let you know if it'll be present in our next release. ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Seo Sanghyeon Sent: Wednesday, November 23, 2005 9:41 PM To: users at lists.ironpython.com Subject: [IronPython] Crash on method call With following code, IronPython 0.9.5 crashes with the message "Unhandled Exception: no value for arg". class C: def foo(self, arg, bar): pass obj = C() obj.foo(None, bar=1) Above testcase was reduced from Python standard library's optparse.py, line 1120, in Python 2.4.2. Seo Sanghyeon _______________________________________________ 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 korpse-ironpython at kaydash.za.net Tue Nov 29 08:08:36 2005 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Tue, 29 Nov 2005 09:08:36 +0200 Subject: [IronPython] Events and the += operator In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F5649BE7@df-foxhound-msg.exchange.corp.microsoft.com> References: <5C0A6F919D675745BB1DBA7412DB68F5649BE7@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <438BFE74.9010307@kaydash.za.net> Martin Maly wrote: > We have bug in IronPython that prevents static events to be set. Instance events work just fine, it is the static ones (like Application.Idle) that cause trouble. We have the bug on our radar already and hopefully will fix it soon. Aha! Thanks Martin. -- Jonathan From dinov at exchange.microsoft.com Tue Nov 29 18:52:12 2005 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 29 Nov 2005 09:52:12 -0800 Subject: [IronPython] Crash on method call In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E7D9B5F@df-foxhound-msg.exchange.corp.microsoft.com> I just used mdbg 2.0 that ships w/ the RTM version of VS and IronPython 0.9.5 and the extension appeared to work fine. Are you running IronPython 0.9.5 against RTM VS? Do you have any additional steps that might help us repro it? ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of SrinivasaRao Sent: Monday, November 28, 2005 9:06 PM To: Discussion of IronPython Subject: Re: [IronPython] Crash on method call Hi, I downloaded mdbg v2.0, after I run the project i get MDBG command prompt, in that if I wite " PY 1+2 " command then it is showing an error message " no active process" sometimes " unrecognized command" etc Plese give me a solution for this as soon as possible.. Thanks Srinivasa Rao. Software Engineer. Apollo Health street Ltd. Hyderabad, India. Mobile : 91-9885334248. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com]On Behalf Of Dino Viehland Sent: Monday, November 28, 2005 9:52 PM To: Discussion of IronPython Subject: Re: [IronPython] Crash on method call I just verified this is indeed will be fixed in our next release. Thanks for letting us know about the issue! ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, November 23, 2005 10:15 PM To: Discussion of IronPython Subject: Re: [IronPython] Crash on method call Thanks for the bug report Seo. We've had a similar bug in our database that I believe I fixed last week (I'm away currently so I can't verify) but I will confirm this next week after the Thanksgiving holiday and let you know if it'll be present in our next release. ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Seo Sanghyeon Sent: Wednesday, November 23, 2005 9:41 PM To: users at lists.ironpython.com Subject: [IronPython] Crash on method call With following code, IronPython 0.9.5 crashes with the message "Unhandled Exception: no value for arg". class C: def foo(self, arg, bar): pass obj = C() obj.foo(None, bar=1) Above testcase was reduced from Python standard library's optparse.py, line 1120, in Python 2.4.2. Seo Sanghyeon _______________________________________________ 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 borice23 at yahoo.com Wed Nov 30 00:43:37 2005 From: borice23 at yahoo.com (Boris Capitanu) Date: Tue, 29 Nov 2005 15:43:37 -0800 (PST) Subject: [IronPython] debugging question In-Reply-To: Message-ID: <20051129234337.69265.qmail@web81207.mail.mud.yahoo.com> Hello. I'd like to find out if the following is the normal (expected) behaviour, or there is some problem on my end: Suppose I have the following Python script: def bar(): return 1 def foo(): x = bar() print x ...and some C# code that calls (using the Python hosting support) function "foo". I can set a breakpoint on the first line of function "foo", and the VS debugger gets to it as exected, however if I would like to step into (F11) the call to function "bar", the debugger jumps me inside the IronPython C# code that does all the magic in resolving what "bar" means, and calling it... however what I would like is for the debugger to actually place me on the first line of the function "bar". Is this possible to achieve? (I know I can always set a breakpoint on the first line of "bar", but it's cumbersome to set up breakpoints inside all the functions that I have) Thank you for any clarifications. Boris Capitanu From Martin.Maly at microsoft.com Wed Nov 30 00:49:50 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 29 Nov 2005 15:49:50 -0800 Subject: [IronPython] debugging question In-Reply-To: <20051129234337.69265.qmail@web81207.mail.mud.yahoo.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F571A191@df-foxhound-msg.exchange.corp.microsoft.com> Hi Boris, My experience is that when using release build of IronPython (where the debug symbols are not available), Visual Studio steps right through the IronPython logic and lands on the first line of bar(). With debug build of IronPython you will experience VS stepping into IronPython internals. We are currently actively thinking about the debugging support and the ways to make it better and certainly the stepping through the Python code without stepping through the Python internals is on our list. Ultimately it is fairly easy to tell the debugger to ignore some code (IronPython internals) and fly right through it and land on the first line of bar(). Unfortunately, this doesn't quite work for the developers working on IronPython code so we need to find solution that works both ways. I hope this answers your question Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Boris Capitanu Sent: Tuesday, November 29, 2005 3:44 PM To: users at lists.ironpython.com Subject: [IronPython] debugging question Hello. I'd like to find out if the following is the normal (expected) behaviour, or there is some problem on my end: Suppose I have the following Python script: def bar(): return 1 def foo(): x = bar() print x ...and some C# code that calls (using the Python hosting support) function "foo". I can set a breakpoint on the first line of function "foo", and the VS debugger gets to it as exected, however if I would like to step into (F11) the call to function "bar", the debugger jumps me inside the IronPython C# code that does all the magic in resolving what "bar" means, and calling it... however what I would like is for the debugger to actually place me on the first line of the function "bar". Is this possible to achieve? (I know I can always set a breakpoint on the first line of "bar", but it's cumbersome to set up breakpoints inside all the functions that I have) Thank you for any clarifications. Boris Capitanu _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From borice23 at yahoo.com Wed Nov 30 02:23:44 2005 From: borice23 at yahoo.com (Boris Capitanu) Date: Tue, 29 Nov 2005 17:23:44 -0800 (PST) Subject: [IronPython] operator problem In-Reply-To: Message-ID: <20051130012344.60850.qmail@web81203.mail.mud.yahoo.com> Hello again. Any reason why the "|" operator in not supported in IronPython? I can see that "or" is supported, but I'd like to be able to say something like: stateChanged |= menuChanged This sort of assignment works under CPython, but not IronPython. IronPython 0.9.5 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> True | False Traceback (most recent call last): at TypeError: unsupported operand type(s) for |: 'bool' and 'bool' >>> True or False True Boris Capitanu From Martin.Maly at microsoft.com Wed Nov 30 02:46:00 2005 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 29 Nov 2005 17:46:00 -0800 Subject: [IronPython] operator problem In-Reply-To: <20051130012344.60850.qmail@web81203.mail.mud.yahoo.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F571A2C8@df-foxhound-msg.exchange.corp.microsoft.com> Unfortunately, this is a bug in IronPython. The bit-wise or '|' is not implemented for all types. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Boris Capitanu Sent: Tuesday, November 29, 2005 5:24 PM To: users at lists.ironpython.com Subject: [IronPython] operator problem Hello again. Any reason why the "|" operator in not supported in IronPython? I can see that "or" is supported, but I'd like to be able to say something like: stateChanged |= menuChanged This sort of assignment works under CPython, but not IronPython. IronPython 0.9.5 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> True | False Traceback (most recent call last): at TypeError: unsupported operand type(s) for |: 'bool' and 'bool' >>> True or False True Boris Capitanu _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com