From angus at finalbuilder.com Mon Jun 2 03:09:54 2008 From: angus at finalbuilder.com (Angus Gratton) Date: Mon, 02 Jun 2008 11:09:54 +1000 Subject: [IronPython] Distributing a commercial application which hosts IronPython 2 Message-ID: <48434862.1040701@finalbuilder.com> Hi folks, (Sorry if this is an inappropriate place to ask this question. I searched the archives, but prior license discussions all seem to refer to the old license.) What is the "best" way to distribute a commercial application which hosts IronPython 2? Is this even possible? My original plan was just to require users to install IronPython first, and reference the assemblies from the IronPython installation. However, because IronPython doesn't install anything to the GAC, and because of .NET Framework limitations about loading assemblies from outside the AppDomain's base directory, this is impractical. It doesn't seem like Silverlight installs anything to the GAC, either. From reading the MS Public License, it looks like it might be possible to distribute the IronPython and DLR assemblies along with our application, explicitly under the MS-PL. While concurrently the commercial/proprietary parts of the application (including our hosting code) are distributed under our closed license. Is that correct? I can't seem to find a clear answer anywhere. Are there any examples of how to correctly structure a license agreement, in this case? I would very much like to allow people to use IronPython from our application (I'm very impressed with both the language implementation, the performance, and the hosting API), I'm just unsure how to do it. Thanks in advance. -- Regards, Angus Gratton VSoft Technologies http://www.finalbuilder.com/ ---------------------------------------- Automate your Build Process with FinalBuilder From Jimmy.Schementi at microsoft.com Mon Jun 2 06:45:10 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Sun, 1 Jun 2008 21:45:10 -0700 Subject: [IronPython] Distributing a commercial application which hosts IronPython 2 In-Reply-To: <48434862.1040701@finalbuilder.com> Message-ID: Angus, You can definitely redistribute IronPython assemblies in your application, and that's the best way to use IronPython on both the desktop and Silverlight. I'd simply have a "IronPython" folder in your app, and in there you put the assemblies and the license.txt, containing the Ms-Pl text. Resolver Systems does this with their products, so maybe Michael Foord can give you some advise. The Ms-Pl license that IronPython uses is "non-infectious" ... as in other code that uses does not need to conform to the same license. Reciprocal licenses, like the Ms-Rl or the GPL, require anything using the code to have the same license. ~Jimmy On 6/1/08 6:09 PM, "Angus Gratton" wrote: Hi folks, (Sorry if this is an inappropriate place to ask this question. I searched the archives, but prior license discussions all seem to refer to the old license.) What is the "best" way to distribute a commercial application which hosts IronPython 2? Is this even possible? My original plan was just to require users to install IronPython first, and reference the assemblies from the IronPython installation. However, because IronPython doesn't install anything to the GAC, and because of .NET Framework limitations about loading assemblies from outside the AppDomain's base directory, this is impractical. It doesn't seem like Silverlight installs anything to the GAC, either. From reading the MS Public License, it looks like it might be possible to distribute the IronPython and DLR assemblies along with our application, explicitly under the MS-PL. While concurrently the commercial/proprietary parts of the application (including our hosting code) are distributed under our closed license. Is that correct? I can't seem to find a clear answer anywhere. Are there any examples of how to correctly structure a license agreement, in this case? I would very much like to allow people to use IronPython from our application (I'm very impressed with both the language implementation, the performance, and the hosting API), I'm just unsure how to do it. Thanks in advance. -- Regards, Angus Gratton VSoft Technologies http://www.finalbuilder.com/ ---------------------------------------- Automate your Build Process with FinalBuilder _______________________________________________ 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 fuzzyman at voidspace.org.uk Mon Jun 2 22:52:16 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 02 Jun 2008 21:52:16 +0100 Subject: [IronPython] Distributing a commercial application which hosts IronPython 2 In-Reply-To: References: Message-ID: <48445D80.6010605@voidspace.org.uk> Jimmy Schementi wrote: > Angus, > > You can definitely redistribute IronPython assemblies in your > application, and that?s the best way to use IronPython on both the > desktop and Silverlight. I?d simply have a ?IronPython? folder in your > app, and in there you put the assemblies and the license.txt, > containing the Ms-Pl text. Resolver Systems does this with their > products, so maybe Michael Foord can give you some advise. We pretty much do exactly as Jimmy says. We have all our app assemblies in one folder (including the IronPython ones), and then compiled Python files (actually 'exe's I think) in the Python package structure. We then have a licenses folder with all relevant licenses and a mention of the IronPython license in our about dialog I believe. Michael Foord > > The Ms-Pl license that IronPython uses is ?non-infectious? ... as in > other code that uses does not need to conform to the same license. > Reciprocal licenses, like the Ms-Rl or the GPL, require anything using > the code to have the same license. > > ~Jimmy > > On 6/1/08 6:09 PM, "Angus Gratton" wrote: > > Hi folks, > > (Sorry if this is an inappropriate place to ask this question. I > searched the archives, but prior license discussions all seem to refer > to the old license.) > > What is the "best" way to distribute a commercial application which > hosts IronPython 2? Is this even possible? > > My original plan was just to require users to install IronPython > first, > and reference the assemblies from the IronPython installation. > However, > because IronPython doesn't install anything to the GAC, and because of > .NET Framework limitations about loading assemblies from outside the > AppDomain's base directory, this is impractical. > > It doesn't seem like Silverlight installs anything to the GAC, either. > > From reading the MS Public License, it looks like it might be possible > to distribute the IronPython and DLR assemblies along with our > application, explicitly under the MS-PL. While concurrently the > commercial/proprietary parts of the application (including our hosting > code) are distributed under our closed license. Is that correct? I > can't > seem to find a clear answer anywhere. Are there any examples of how to > correctly structure a license agreement, in this case? > > I would very much like to allow people to use IronPython from our > application (I'm very impressed with both the language implementation, > the performance, and the hosting API), I'm just unsure how to do it. > > Thanks in advance. > > -- > Regards, > > Angus Gratton > VSoft Technologies > http://www.finalbuilder.com/ > ---------------------------------------- > Automate your Build Process with FinalBuilder > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From falcon at uwyo.edu Tue Jun 3 07:01:13 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Mon, 2 Jun 2008 23:01:13 -0600 Subject: [IronPython] Iron Python debuggin using PythonEngine Message-ID: Hello all, This is my first post so bear with me! My company is using iron python as an embedded scripting engine and we are loving every piece of it. I just downloaded IronPython Studio and am working on making our scripts available to the studio for editing so we can get intellisense. As a side project I wanted to see if I could get Iron Python to work with break points. In python studio I "ran without debugging" this piece of code. It forced me to connect to vs2008 and allowed me to find my program.py file and debug it. hello = "Hello VSX!!!" import System import System.Diagnostics print hello System.Diagnostics.Debugger.Launch() System.Diagnostics.Debugger.Break() print hello The problem lies when i execute this file from the PythonEngine. The code below is in c# and when executed prompts me to attach to C# program.cs not program.py . PythonEngine eng = new PythonEngine(); eng.CreateModule(); eng.Import("System"); eng.Import("System.Diagnostics"); eng.ExecuteFile(@"IronPython Studio\ConsoleApplication3\ConsoleApplication3\Program.py"); Does anyone have any ideas on how to get this to work. I really love the idea of hosting ironpython in our application but we could definitely use the ability to get breakpoints. -- Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidjensen at usa.net Wed Jun 4 15:36:18 2008 From: davidjensen at usa.net (David Jensen) Date: Wed, 04 Jun 2008 09:36:18 -0400 Subject: [IronPython] Users Digest, Vol 47, Issue 3 Message-ID: <359mFDNjs5438S04.1212586578@cmsweb04.cms.usa.net> I would like to know what support there is for ironpython in vs 2008. The only thing I can find is something for vs 2005 (it did not look like much) and a comment that it did not support Vista(!). ------ Original Message ------ Received: Tue, 03 Jun 2008 10:03:37 PM EDT From: users-request at lists.ironpython.com To: users at lists.ironpython.com Subject: Users Digest, Vol 47, Issue 3 > Send Users mailing list submissions to > users at lists.ironpython.com > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > or, via email, send a message with subject or body 'help' to > users-request at lists.ironpython.com > > You can reach the person managing the list at > users-owner at lists.ironpython.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Users digest..." > > > Today's Topics: > > 1. Iron Python debuggin using PythonEngine (Michael Stephens) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 2 Jun 2008 23:01:13 -0600 > From: "Michael Stephens" > Subject: [IronPython] Iron Python debuggin using PythonEngine > To: users at lists.ironpython.com > Message-ID: > > Content-Type: text/plain; charset="iso-8859-1" > > Hello all, This is my first post so bear with me! > > My company is using iron python as an embedded scripting engine and we are > loving every piece of it. I just downloaded IronPython Studio and am > working on making our scripts available to the studio for editing so we can > get intellisense. As a side project I wanted to see if I could get Iron > Python to work with break points. In python studio I "ran without debugging" > this piece of code. It forced me to connect to vs2008 and allowed me to > find my program.py file and debug it. > > hello = "Hello VSX!!!" > import System > import System.Diagnostics > print hello > System.Diagnostics.Debugger.Launch() > System.Diagnostics.Debugger.Break() > print hello > > The problem lies when i execute this file from the PythonEngine. The code > below is in c# and when executed prompts me to attach to C# program.cs not > program.py . > PythonEngine eng = new PythonEngine(); > eng.CreateModule(); > eng.Import("System"); > eng.Import("System.Diagnostics"); > eng.ExecuteFile(@"IronPython > Studio\ConsoleApplication3\ConsoleApplication3\Program.py"); > > Does anyone have any ideas on how to get this to work. I really love the > idea of hosting ironpython in our application but we could definitely use > the ability to get breakpoints. > > > > -- > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > End of Users Digest, Vol 47, Issue 3 > ************************************ > From dinov at exchange.microsoft.com Thu Jun 5 17:59:32 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 5 Jun 2008 08:59:32 -0700 Subject: [IronPython] Iron Python debuggin using PythonEngine In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227012BC9D34BAF@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Debugging needs to be globally enabled - but once it is ExecuteFile will produce debuggable code. To globally enable debugging in 1.x you do: EngineOptions eo = new EngineOptions(); eo.ClrDebuggingEnabled = true; PythonEngine eng = new PythonEngine(eo); To create the PythonEngine. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens Sent: Monday, June 02, 2008 10:01 PM To: users at lists.ironpython.com Subject: [IronPython] Iron Python debuggin using PythonEngine Hello all, This is my first post so bear with me! My company is using iron python as an embedded scripting engine and we are loving every piece of it. I just downloaded IronPython Studio and am working on making our scripts available to the studio for editing so we can get intellisense. As a side project I wanted to see if I could get Iron Python to work with break points. In python studio I "ran without debugging" this piece of code. It forced me to connect to vs2008 and allowed me to find my program.py file and debug it. hello = "Hello VSX!!!" import System import System.Diagnostics print hello System.Diagnostics.Debugger.Launch() System.Diagnostics.Debugger.Break() print hello The problem lies when i execute this file from the PythonEngine. The code below is in c# and when executed prompts me to attach to C# program.cs not program.py . PythonEngine eng = new PythonEngine(); eng.CreateModule(); eng.Import("System"); eng.Import("System.Diagnostics"); eng.ExecuteFile(@"IronPython Studio\ConsoleApplication3\ConsoleApplication3\Program.py"); Does anyone have any ideas on how to get this to work. I really love the idea of hosting ironpython in our application but we could definitely use the ability to get breakpoints. -- Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From falcon at uwyo.edu Thu Jun 5 18:50:59 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Thu, 5 Jun 2008 10:50:59 -0600 Subject: [IronPython] Iron Python debuggin using PythonEngine In-Reply-To: <7AD436E4270DD54A94238001769C2227012BC9D34BAF@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227012BC9D34BAF@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: That is great.. Now how do I get locals and a watch window running. I installed PythonStudio hoping that would do the trick. But alas I only get the ability to F10 through code which isnt that useful unless you can see what its doing. On Thu, Jun 5, 2008 at 9:59 AM, Dino Viehland wrote: > Debugging needs to be globally enabled ? but once it is ExecuteFile will > produce debuggable code. To globally enable debugging in 1.x you do: > > > > EngineOptions eo = new EngineOptions(); > > eo.ClrDebuggingEnabled = true; > > PythonEngine eng = new PythonEngine(eo); > > > > To create the PythonEngine. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Michael Stephens > *Sent:* Monday, June 02, 2008 10:01 PM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] Iron Python debuggin using PythonEngine > > > > Hello all, This is my first post so bear with me! > > My company is using iron python as an embedded scripting engine and we are > loving every piece of it. I just downloaded IronPython Studio and am > working on making our scripts available to the studio for editing so we can > get intellisense. As a side project I wanted to see if I could get Iron > Python to work with break points. In python studio I "ran without debugging" > this piece of code. It forced me to connect to vs2008 and allowed me to > find my program.py file and debug it. > > hello = "Hello VSX!!!" > import System > import System.Diagnostics > print hello > System.Diagnostics.Debugger.Launch() > System.Diagnostics.Debugger.Break() > print hello > > The problem lies when i execute this file from the PythonEngine. The code > below is in c# and when executed prompts me to attach to C# program.cs not > program.py . > PythonEngine eng = new PythonEngine(); > eng.CreateModule(); > eng.Import("System"); > eng.Import("System.Diagnostics"); > eng.ExecuteFile(@"IronPython > Studio\ConsoleApplication3\ConsoleApplication3\Program.py"); > > Does anyone have any ideas on how to get this to work. I really love the > idea of hosting ironpython in our application but we could definitely use > the ability to get breakpoints. > > > > -- > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Jun 5 21:00:25 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 5 Jun 2008 12:00:25 -0700 Subject: [IronPython] Iron Python debuggin using PythonEngine In-Reply-To: References: <7AD436E4270DD54A94238001769C2227012BC9D34BAF@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227012BC9D34C60@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Locals in methods will just show up. Unfortunately everything else is still rough :(. Module globals won't be easy to get to - if it's possible at all, they're static fields off in a weirdly named type. Inspecting classes requires drilling into their dictionary objects. For IronPython 2.0 Haibo had a blog entry which improves this for old-style classes - http://blogs.msdn.com/haibo_luo/archive/2007/08/03/4210344.aspx and that can probably be adapted for 1.x if someone was so inclined. For new-style classes you'll see the bases members as normal .NET members. One way to improve the experience is through __slots__ - in 1.x you should see them show up directly as fields/properties on the object. And again for all other attributes you'll have to look in the dictionary. So lots of the info you want is there it just takes some digging. I guess the good news is that we've recently been hiring partially to fill this void. The plan is to look at VS integration for both IronPython and IronRuby and make sure it's a good end-to-end experience. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens Sent: Thursday, June 05, 2008 9:51 AM To: Discussion of IronPython Subject: Re: [IronPython] Iron Python debuggin using PythonEngine That is great.. Now how do I get locals and a watch window running. I installed PythonStudio hoping that would do the trick. But alas I only get the ability to F10 through code which isnt that useful unless you can see what its doing. On Thu, Jun 5, 2008 at 9:59 AM, Dino Viehland > wrote: Debugging needs to be globally enabled - but once it is ExecuteFile will produce debuggable code. To globally enable debugging in 1.x you do: EngineOptions eo = new EngineOptions(); eo.ClrDebuggingEnabled = true; PythonEngine eng = new PythonEngine(eo); To create the PythonEngine. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens Sent: Monday, June 02, 2008 10:01 PM To: users at lists.ironpython.com Subject: [IronPython] Iron Python debuggin using PythonEngine Hello all, This is my first post so bear with me! My company is using iron python as an embedded scripting engine and we are loving every piece of it. I just downloaded IronPython Studio and am working on making our scripts available to the studio for editing so we can get intellisense. As a side project I wanted to see if I could get Iron Python to work with break points. In python studio I "ran without debugging" this piece of code. It forced me to connect to vs2008 and allowed me to find my program.py file and debug it. hello = "Hello VSX!!!" import System import System.Diagnostics print hello System.Diagnostics.Debugger.Launch() System.Diagnostics.Debugger.Break() print hello The problem lies when i execute this file from the PythonEngine. The code below is in c# and when executed prompts me to attach to C# program.cs not program.py . PythonEngine eng = new PythonEngine(); eng.CreateModule(); eng.Import("System"); eng.Import("System.Diagnostics"); eng.ExecuteFile(@"IronPython Studio\ConsoleApplication3\ConsoleApplication3\Program.py"); Does anyone have any ideas on how to get this to work. I really love the idea of hosting ironpython in our application but we could definitely use the ability to get breakpoints. -- Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Sat Jun 7 16:19:10 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Sat, 7 Jun 2008 07:19:10 -0700 Subject: [IronPython] Resolver One 1.1 Message-ID: Congratulations to the Resolver One folks on the most recent release! http://www.resolversystems.com/news/?p=61 I've just come back from helping out with the Dynamic Languages booth at TechEd, and it was very gratifying to be able to prove to people that IronPython is a "real product" by naming a shipping application which is implemented with it. -- Curt Hagenlocher curt at hagenlocher.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From Marty.Nelson at symyx.com Sun Jun 8 01:12:08 2008 From: Marty.Nelson at symyx.com (Marty Nelson) Date: Sat, 7 Jun 2008 16:12:08 -0700 Subject: [IronPython] Products with IronPython In-Reply-To: References: Message-ID: <515335F32AA04440B3DE6FEA1993E9AD03269852@srv-be-101.Symyx-IC.symyx.com> We used IronPython for scripting of form editor widgets in our universal ELN product: http://www.symyx.com/press_release.php?id=4&p=283&y=2008 We plan on continuing to leverage DLR scripting to move more extensibility points from customization to configuration. And while the 2.0 generation IP on top of the common DLR infrastructure really makes it so we don't care what DLR scripting language they choose, IronPython is our first choice to support in terms of editors, etc., as it has been well received among the scientific community. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Saturday, June 07, 2008 7:19 AM To: Discussion of IronPython Subject: [IronPython] Resolver One 1.1 Congratulations to the Resolver One folks on the most recent release! http://www.resolversystems.com/news/?p=61 I've just come back from helping out with the Dynamic Languages booth at TechEd, and it was very gratifying to be able to prove to people that IronPython is a "real product" by naming a shipping application which is implemented with it. -- Curt Hagenlocher curt at hagenlocher.org ======= Notice: This e-mail message, together with any attachments, contains information of Symyx Technologies, Inc. or any of its affiliates or subsidiaries that may be confidential, proprietary, copyrighted, privileged and/or protected work product, and is meant solely for the intended recipient. If you are not the intended recipient, and have received this message in error, please contact the sender immediately, permanently delete the original and any copies of this email and any attachments thereto. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Sun Jun 8 17:23:46 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 8 Jun 2008 10:23:46 -0500 Subject: [IronPython] IronPython and Threads Message-ID: <4817b6fc0806080823qcf5e0fev5067e0c782499f7@mail.gmail.com> I'm having a problem debugging some issues that I suspect are thread related in Silverlight. My application is failing silently, so I have no way to be sure yet. Is it possible that exceptions in a background thread are quietly swallowed? I'm pretty sure my callback is being called, but all that is in it right now is a raise statement. I've enabled debug. I've been trying to explore Threads a little more with IronPython to see what might be the problem, but even there I'm not having much luck. I could swear this used to work in Beta 1. Now it crashes the interpreter. IronPython 2.0 Beta (2.0.0.2000) on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> from System.Threading import Thread, ThreadStart >>> def foo(): ... raise ValueError ... >>> t = Thread(ThreadStart(foo)) >>> t.Start() >>> Unhandled Exception: System.ArgumentException at foo$1##16(Closure ) at _stub_##25(Closure , CallSite , CodeContext , Object ) at Microsoft.Scripting.Utils.InvokeHelper`5.Invoke(Object arg0, Object arg1, Object arg2, Object arg3) at Microsoft.Scripting.Utils.ReflectedCaller.InvokeInstance(Object instance, Object[] args) at Microsoft.Scripting.Actions.ActionBinder.UpdateSiteAndExecute[T](CodeContext context, CallSite`1 site, Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update1[T0,TRet](CallSite site, CodeContext context, T0 arg0) at System.Void(), using PythonBinder##20(Closure ) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() What's going wrong? How should I be doing this? Thanks, -Dan From curt at hagenlocher.org Sun Jun 8 18:44:14 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Sun, 8 Jun 2008 09:44:14 -0700 Subject: [IronPython] Products with IronPython In-Reply-To: <515335F32AA04440B3DE6FEA1993E9AD03269852@srv-be-101.Symyx-IC.symyx.com> References: <515335F32AA04440B3DE6FEA1993E9AD03269852@srv-be-101.Symyx-IC.symyx.com> Message-ID: Thanks for the reference! Maybe someone could create a page on the IronPython Cookbook wiki( http://www.ironpython.info/index.php/Main_Page) with links to various products using IronPython... On Sat, Jun 7, 2008 at 4:12 PM, Marty Nelson wrote: > We used IronPython for scripting of form editor widgets in our universal > ELN product: http://www.symyx.com/press_release.php?id=4&p=283&y=2008 > > > > We plan on continuing to leverage DLR scripting to move more extensibility > points from customization to configuration. > > > > And while the 2.0 generation IP on top of the common DLR infrastructure > really makes it so we don't care what DLR scripting language they choose, > IronPython is our first choice to support in terms of editors, etc., as it > has been well received among the scientific community. > > > ------------------------------ > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Curt Hagenlocher > *Sent:* Saturday, June 07, 2008 7:19 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] Resolver One 1.1 > > > > Congratulations to the Resolver One folks on the most recent release! > > > > http://www.resolversystems.com/news/?p=61 > > > > I've just come back from helping out with the Dynamic Languages booth at > TechEd, and it was very gratifying to be able to prove to people that > IronPython is a "real product" by naming a shipping application which > is implemented with it. > > > > -- > > Curt Hagenlocher > > curt at hagenlocher.org > ======= > Notice: This e-mail message, together with any attachments, contains > information of Symyx Technologies, Inc. or any of its affiliates or > subsidiaries that may be confidential, proprietary, copyrighted, > privileged and/or protected work product, and is meant solely for > the intended recipient. If you are not the intended recipient, and > have received this message in error, please contact the sender > immediately, permanently delete the original and any copies of this > email and any attachments thereto. > > _______________________________________________ > 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 curt at hagenlocher.org Sun Jun 8 19:04:02 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Sun, 8 Jun 2008 10:04:02 -0700 Subject: [IronPython] IronPython and Threads In-Reply-To: <4817b6fc0806080823qcf5e0fev5067e0c782499f7@mail.gmail.com> References: <4817b6fc0806080823qcf5e0fev5067e0c782499f7@mail.gmail.com> Message-ID: Under CLR 2, any uncaught exception in a thread other than the primary thread will take down the entire process. This is not specific to IronPython. I don't know what the Silverlight CLR will do under these circumstances. You could make a case that a Python-initiated thread shouldn't terminate the process given that CPython wouldn't do the same, but as far as I know, we haven't gotten any requests along those lines. For now, you'll probably want to wrap any function used as a thread "main" in a try/except and do something to log the error in the exception handler. On Sun, Jun 8, 2008 at 8:23 AM, Dan Eloff wrote: > I'm having a problem debugging some issues that I suspect are thread > related in Silverlight. My application is failing silently, so I have > no way to be sure yet. Is it possible that exceptions in a background > thread are quietly swallowed? I'm pretty sure my callback is being > called, but all that is in it right now is a raise statement. > > I've enabled debug. > > > I've been trying to explore Threads a little more with IronPython to > see what might be the problem, but even there I'm not having much > luck. I could swear this used to work in Beta 1. Now it crashes the > interpreter. > > IronPython 2.0 Beta (2.0.0.2000) on .NET 2.0.50727.1433 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> from System.Threading import Thread, ThreadStart > >>> def foo(): > ... raise ValueError > ... > >>> t = Thread(ThreadStart(foo)) > >>> t.Start() > >>> > Unhandled Exception: System.ArgumentException > at foo$1##16(Closure ) > at _stub_##25(Closure , CallSite , CodeContext , Object ) > at Microsoft.Scripting.Utils.InvokeHelper`5.Invoke(Object arg0, > Object arg1, Object arg2, Object arg3) > at Microsoft.Scripting.Utils.ReflectedCaller.InvokeInstance(Object > instance, Object[] args) > at > Microsoft.Scripting.Actions.ActionBinder.UpdateSiteAndExecute[T](CodeContext > context, CallSite`1 site, Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update1[T0,TRet](CallSite > site, CodeContext context, T0 arg0) > at System.Void(), using PythonBinder##20(Closure ) > at System.Threading.ExecutionContext.Run(ExecutionContext > executionContext, ContextCallback callback, Object state) > at System.Threading.ThreadHelper.ThreadStart() > > What's going wrong? How should I be doing this? > > Thanks, > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Sun Jun 8 19:55:05 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Sun, 8 Jun 2008 10:55:05 -0700 Subject: [IronPython] IronPython and Threads In-Reply-To: References: <4817b6fc0806080823qcf5e0fev5067e0c782499f7@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012BC9D35023@DF-GRTDANE-MSG.exchange.corp.microsoft.com> If you use the thread module we will wrap the newly created thread in a try/except for you and print to std-out when the unhandled exception occurs. That way we match the CPython behavior but you can get the standard .NET behavior if you want by going to System.Threading. Unfortunately printing to std out isn't too useful in Silverlight but we could also look at having that display in Silverlight somehow too. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Sunday, June 08, 2008 10:04 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython and Threads Under CLR 2, any uncaught exception in a thread other than the primary thread will take down the entire process. This is not specific to IronPython. I don't know what the Silverlight CLR will do under these circumstances. You could make a case that a Python-initiated thread shouldn't terminate the process given that CPython wouldn't do the same, but as far as I know, we haven't gotten any requests along those lines. For now, you'll probably want to wrap any function used as a thread "main" in a try/except and do something to log the error in the exception handler. On Sun, Jun 8, 2008 at 8:23 AM, Dan Eloff > wrote: I'm having a problem debugging some issues that I suspect are thread related in Silverlight. My application is failing silently, so I have no way to be sure yet. Is it possible that exceptions in a background thread are quietly swallowed? I'm pretty sure my callback is being called, but all that is in it right now is a raise statement. I've enabled debug. I've been trying to explore Threads a little more with IronPython to see what might be the problem, but even there I'm not having much luck. I could swear this used to work in Beta 1. Now it crashes the interpreter. IronPython 2.0 Beta (2.0.0.2000) on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> from System.Threading import Thread, ThreadStart >>> def foo(): ... raise ValueError ... >>> t = Thread(ThreadStart(foo)) >>> t.Start() >>> Unhandled Exception: System.ArgumentException at foo$1##16(Closure ) at _stub_##25(Closure , CallSite , CodeContext , Object ) at Microsoft.Scripting.Utils.InvokeHelper`5.Invoke(Object arg0, Object arg1, Object arg2, Object arg3) at Microsoft.Scripting.Utils.ReflectedCaller.InvokeInstance(Object instance, Object[] args) at Microsoft.Scripting.Actions.ActionBinder.UpdateSiteAndExecute[T](CodeContext context, CallSite`1 site, Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update1[T0,TRet](CallSite site, CodeContext context, T0 arg0) at System.Void(), using PythonBinder##20(Closure ) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() What's going wrong? How should I be doing this? Thanks, -Dan _______________________________________________ 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 dan.eloff at gmail.com Sun Jun 8 20:47:06 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 8 Jun 2008 13:47:06 -0500 Subject: [IronPython] IronPython and Threads In-Reply-To: <7AD436E4270DD54A94238001769C2227012BC9D35023@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0806080823qcf5e0fev5067e0c782499f7@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012BC9D35023@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0806081147m64f7b1f9we194d36bfecc60c5@mail.gmail.com> > For now, you'll probably want to wrap any function used as a thread "main" in a try/except and do something to log the error in the exception handler. I guess that's what I need to do, seeing as I don't create the thread, Silverlight does. Logging/printing is out because it's silverlight. > printing to std out isn't too useful in Silverlight but we could also look > at having that display in Silverlight somehow too. Tell me about it, I'm going to have to think very carefully just to find a way to see this error that's bringing everything down. It would be great if you guys think of something for Silverlight, (more likely just pass the task on to one of the Silverlight guys (Jimmy, are you reading this)) because it just silently catches the error, and it's very difficult to try to display it, depending on where/when it occurs. -Dan On Sun, Jun 8, 2008 at 12:55 PM, Dino Viehland wrote: > If you use the thread module we will wrap the newly created thread in a > try/except for you and print to std-out when the unhandled exception > occurs. That way we match the CPython behavior but you can get the standard > .NET behavior if you want by going to System.Threading. Unfortunately > printing to std out isn't too useful in Silverlight but we could also look > at having that display in Silverlight somehow too. > > > > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher > Sent: Sunday, June 08, 2008 10:04 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython and Threads > > > > Under CLR 2, any uncaught exception in a thread other than the primary > thread will take down the entire process. This is not specific to > IronPython. I don't know what the Silverlight CLR will do under these > circumstances. > > > > You could make a case that a Python-initiated thread shouldn't terminate the > process given that CPython wouldn't do the same, but as far as I know, we > haven't gotten any requests along those lines. For now, you'll probably > want to wrap any function used as a thread "main" in a try/except and do > something to log the error in the exception handler. > > On Sun, Jun 8, 2008 at 8:23 AM, Dan Eloff wrote: > > I'm having a problem debugging some issues that I suspect are thread > related in Silverlight. My application is failing silently, so I have > no way to be sure yet. Is it possible that exceptions in a background > thread are quietly swallowed? I'm pretty sure my callback is being > called, but all that is in it right now is a raise statement. > > I've enabled debug. > > > I've been trying to explore Threads a little more with IronPython to > see what might be the problem, but even there I'm not having much > luck. I could swear this used to work in Beta 1. Now it crashes the > interpreter. > > IronPython 2.0 Beta (2.0.0.2000) on .NET 2.0.50727.1433 > Copyright (c) Microsoft Corporation. All rights reserved. >>>> from System.Threading import Thread, ThreadStart >>>> def foo(): > ... raise ValueError > ... >>>> t = Thread(ThreadStart(foo)) >>>> t.Start() >>>> > Unhandled Exception: System.ArgumentException > at foo$1##16(Closure ) > at _stub_##25(Closure , CallSite , CodeContext , Object ) > at Microsoft.Scripting.Utils.InvokeHelper`5.Invoke(Object arg0, > Object arg1, Object arg2, Object arg3) > at Microsoft.Scripting.Utils.ReflectedCaller.InvokeInstance(Object > instance, Object[] args) > at > Microsoft.Scripting.Actions.ActionBinder.UpdateSiteAndExecute[T](CodeContext > context, CallSite`1 site, Object[] args) > at Microsoft.Scripting.Actions.UpdateDelegates.Update1[T0,TRet](CallSite > site, CodeContext context, T0 arg0) > at System.Void(), using PythonBinder##20(Closure ) > at System.Threading.ExecutionContext.Run(ExecutionContext > executionContext, ContextCallback callback, Object state) > at System.Threading.ThreadHelper.ThreadStart() > > What's going wrong? How should I be doing this? > > Thanks, > -Dan > _______________________________________________ > 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 fuzzyman at voidspace.org.uk Sun Jun 8 20:55:18 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 08 Jun 2008 19:55:18 +0100 Subject: [IronPython] IronPython and Threads In-Reply-To: <4817b6fc0806081147m64f7b1f9we194d36bfecc60c5@mail.gmail.com> References: <4817b6fc0806080823qcf5e0fev5067e0c782499f7@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012BC9D35023@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0806081147m64f7b1f9we194d36bfecc60c5@mail.gmail.com> Message-ID: <484C2B16.1030809@voidspace.org.uk> Dan Eloff wrote: >> For now, you'll probably want to wrap any function used as a thread "main" in a try/except and do something to log the error in the exception handler. >> > > I guess that's what I need to do, seeing as I don't create the thread, > Silverlight does. Logging/printing is out because it's silverlight. > > In my IronPython Web IDE I divert standard out and redirect it to an html textarea so that I can see everything that is printed. This is very useful for debugging. If you are doing this from threads you ought to use a dispatcher to add the text to the htmlarea - but it is very easy. Michael Foord http://www.ironpythoninaction.com >> printing to std out isn't too useful in Silverlight but we could also look >> at having that display in Silverlight somehow too. >> > > Tell me about it, I'm going to have to think very carefully just to > find a way to see this error that's bringing everything down. It would > be great if you guys think of something for Silverlight, (more likely > just pass the task on to one of the Silverlight guys (Jimmy, are you > reading this)) because it just silently catches the error, and it's > very difficult to try to display it, depending on where/when it > occurs. > > -Dan > > > On Sun, Jun 8, 2008 at 12:55 PM, Dino Viehland > wrote: > >> If you use the thread module we will wrap the newly created thread in a >> try/except for you and print to std-out when the unhandled exception >> occurs. That way we match the CPython behavior but you can get the standard >> .NET behavior if you want by going to System.Threading. Unfortunately >> printing to std out isn't too useful in Silverlight but we could also look >> at having that display in Silverlight somehow too. >> >> >> >> From: users-bounces at lists.ironpython.com >> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher >> Sent: Sunday, June 08, 2008 10:04 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] IronPython and Threads >> >> >> >> Under CLR 2, any uncaught exception in a thread other than the primary >> thread will take down the entire process. This is not specific to >> IronPython. I don't know what the Silverlight CLR will do under these >> circumstances. >> >> >> >> You could make a case that a Python-initiated thread shouldn't terminate the >> process given that CPython wouldn't do the same, but as far as I know, we >> haven't gotten any requests along those lines. For now, you'll probably >> want to wrap any function used as a thread "main" in a try/except and do >> something to log the error in the exception handler. >> >> On Sun, Jun 8, 2008 at 8:23 AM, Dan Eloff wrote: >> >> I'm having a problem debugging some issues that I suspect are thread >> related in Silverlight. My application is failing silently, so I have >> no way to be sure yet. Is it possible that exceptions in a background >> thread are quietly swallowed? I'm pretty sure my callback is being >> called, but all that is in it right now is a raise statement. >> >> I've enabled debug. >> >> >> I've been trying to explore Threads a little more with IronPython to >> see what might be the problem, but even there I'm not having much >> luck. I could swear this used to work in Beta 1. Now it crashes the >> interpreter. >> >> IronPython 2.0 Beta (2.0.0.2000) on .NET 2.0.50727.1433 >> Copyright (c) Microsoft Corporation. All rights reserved. >> >>>>> from System.Threading import Thread, ThreadStart >>>>> def foo(): >>>>> >> ... raise ValueError >> ... >> >>>>> t = Thread(ThreadStart(foo)) >>>>> t.Start() >>>>> >>>>> >> Unhandled Exception: System.ArgumentException >> at foo$1##16(Closure ) >> at _stub_##25(Closure , CallSite , CodeContext , Object ) >> at Microsoft.Scripting.Utils.InvokeHelper`5.Invoke(Object arg0, >> Object arg1, Object arg2, Object arg3) >> at Microsoft.Scripting.Utils.ReflectedCaller.InvokeInstance(Object >> instance, Object[] args) >> at >> Microsoft.Scripting.Actions.ActionBinder.UpdateSiteAndExecute[T](CodeContext >> context, CallSite`1 site, Object[] args) >> at Microsoft.Scripting.Actions.UpdateDelegates.Update1[T0,TRet](CallSite >> site, CodeContext context, T0 arg0) >> at System.Void(), using PythonBinder##20(Closure ) >> at System.Threading.ExecutionContext.Run(ExecutionContext >> executionContext, ContextCallback callback, Object state) >> at System.Threading.ThreadHelper.ThreadStart() >> >> What's going wrong? How should I be doing this? >> >> Thanks, >> -Dan >> _______________________________________________ >> 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 > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From dan.eloff at gmail.com Sun Jun 8 21:22:27 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 8 Jun 2008 14:22:27 -0500 Subject: [IronPython] IronPython and Threads In-Reply-To: <484C2B16.1030809@voidspace.org.uk> References: <4817b6fc0806080823qcf5e0fev5067e0c782499f7@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012BC9D35023@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0806081147m64f7b1f9we194d36bfecc60c5@mail.gmail.com> <484C2B16.1030809@voidspace.org.uk> Message-ID: <4817b6fc0806081222q56713e61q2533b16c6a2168e@mail.gmail.com> Michael Foord Wrote: > In my IronPython Web IDE I divert standard out and redirect it to an html > textarea so that I can see everything that is printed. This is very useful > for debugging. > > If you are doing this from threads you ought to use a dispatcher to add the > text to the htmlarea - but it is very easy. > I redirect stdout and stderr to an interactive python console in silverlight, but it does me no good here because this is happening before the console loads. So I think I will need to create an html textarea like you suggested to handle any output before the console loads. -Dan From g.mulot at free.fr Sun Jun 8 22:35:29 2008 From: g.mulot at free.fr (Gerard Mulot) Date: Sun, 8 Jun 2008 22:35:29 +0200 Subject: [IronPython] Products with IronPython Message-ID: <000101c8c9a7$30cc0ea0$92642be0$@mulot@free.fr> LeeBeLLuL is a little framework to develop style RIA application which use IronPython in the browser and InfoPath in the form design 2 demos are available The first with IronPython 1.0 : http://www.leebellul.com/DEMO/V1/LBL_v1.zip The second with IronPython 2.0 : http://www.leebellul.com/DEMO/V2/LBL_v2.zip Applications developed with IronPython 1.0 are in used more than a year : http://www.leebellul.com/Site/index.html The site is in French -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Mon Jun 9 02:20:59 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 8 Jun 2008 19:20:59 -0500 Subject: [IronPython] IronPython and Threads In-Reply-To: <4817b6fc0806081222q56713e61q2533b16c6a2168e@mail.gmail.com> References: <4817b6fc0806080823qcf5e0fev5067e0c782499f7@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012BC9D35023@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0806081147m64f7b1f9we194d36bfecc60c5@mail.gmail.com> <484C2B16.1030809@voidspace.org.uk> <4817b6fc0806081222q56713e61q2533b16c6a2168e@mail.gmail.com> Message-ID: <4817b6fc0806081720m1f28c26dnb4e774922770b8ec@mail.gmail.com> Ok I've been at this all day, and I've discovered some nifty things. It was pretty trivial to redirect output to an html textarea. The html markup/styling gave me way more trouble than the managed code (I really hate html.) The big find though was the Application.Current.UnhandledException event. def excepthook(sender, e): print e.ExceptionObject def startup(): import sys sys.stdout = sys.stderr = DebugStream() Application.Current.UnhandledException += excepthook # start application startup() Which will print unhandled exceptions, even ones that occur in background threads! But of course this prints a .NET traceback, which is pretty much useless for IronPython. But surely there is some way to print a python exception once I have this .NET exception object? Thanks, -Dan On Sun, Jun 8, 2008 at 2:22 PM, Dan Eloff wrote: > Michael Foord Wrote: >> In my IronPython Web IDE I divert standard out and redirect it to an html >> textarea so that I can see everything that is printed. This is very useful >> for debugging. >> >> If you are doing this from threads you ought to use a dispatcher to add the >> text to the htmlarea - but it is very easy. >> > > I redirect stdout and stderr to an interactive python console in > silverlight, but it does me no good here because this is happening > before the console loads. So I think I will need to create an html > textarea like you suggested to handle any output before the console > loads. > > -Dan > From dinov at exchange.microsoft.com Mon Jun 9 02:44:23 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Sun, 8 Jun 2008 17:44:23 -0700 Subject: [IronPython] IronPython and Threads In-Reply-To: <4817b6fc0806081720m1f28c26dnb4e774922770b8ec@mail.gmail.com> References: <4817b6fc0806080823qcf5e0fev5067e0c782499f7@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012BC9D35023@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0806081147m64f7b1f9we194d36bfecc60c5@mail.gmail.com> <484C2B16.1030809@voidspace.org.uk> <4817b6fc0806081222q56713e61q2533b16c6a2168e@mail.gmail.com> <4817b6fc0806081720m1f28c26dnb4e774922770b8ec@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012BC9D35029@DF-GRTDANE-MSG.exchange.corp.microsoft.com> There's a DLR hosting API for formatting exceptions - ScriptEngine.FormatException. >From Silverlight I think you can access the DynamicApplication class, in Microsoft.Scripting.Silverlight, which gives you access to the current ScriptRuntime . You might need a clr.AddReference to Microsoft.Scripting.Silverlight in there. From there you can get the ScriptEngine for Python and then call FormatException on the exception object. And that will give you the Python stack trace as we normally display it. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Sunday, June 08, 2008 5:21 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython and Threads Ok I've been at this all day, and I've discovered some nifty things. It was pretty trivial to redirect output to an html textarea. The html markup/styling gave me way more trouble than the managed code (I really hate html.) The big find though was the Application.Current.UnhandledException event. def excepthook(sender, e): print e.ExceptionObject def startup(): import sys sys.stdout = sys.stderr = DebugStream() Application.Current.UnhandledException += excepthook # start application startup() Which will print unhandled exceptions, even ones that occur in background threads! But of course this prints a .NET traceback, which is pretty much useless for IronPython. But surely there is some way to print a python exception once I have this .NET exception object? Thanks, -Dan On Sun, Jun 8, 2008 at 2:22 PM, Dan Eloff wrote: > Michael Foord Wrote: >> In my IronPython Web IDE I divert standard out and redirect it to an html >> textarea so that I can see everything that is printed. This is very useful >> for debugging. >> >> If you are doing this from threads you ought to use a dispatcher to add the >> text to the htmlarea - but it is very easy. >> > > I redirect stdout and stderr to an interactive python console in > silverlight, but it does me no good here because this is happening > before the console loads. So I think I will need to create an html > textarea like you suggested to handle any output before the console > loads. > > -Dan > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Mon Jun 9 03:18:27 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sun, 8 Jun 2008 20:18:27 -0500 Subject: [IronPython] IronPython and Threads In-Reply-To: <7AD436E4270DD54A94238001769C2227012BC9D35029@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0806080823qcf5e0fev5067e0c782499f7@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012BC9D35023@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0806081147m64f7b1f9we194d36bfecc60c5@mail.gmail.com> <484C2B16.1030809@voidspace.org.uk> <4817b6fc0806081222q56713e61q2533b16c6a2168e@mail.gmail.com> <4817b6fc0806081720m1f28c26dnb4e774922770b8ec@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012BC9D35029@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0806081818i77b679c5ka2a593510c6f300d@mail.gmail.com> On Sun, Jun 8, 2008 at 7:44 PM, Dino Viehland wrote: > There's a DLR hosting API for formatting exceptions - ScriptEngine.FormatException. > > >From Silverlight I think you can access the DynamicApplication class, in Microsoft.Scripting.Silverlight, which gives you access to the current ScriptRuntime . You might need a clr.AddReference to Microsoft.Scripting.Silverlight in there. From there you can get the ScriptEngine for Python and then call FormatException on the exception object. And that will give you the Python stack trace as we normally display it. def excepthook(sender, e): print Application.Current.Environment.GetEngine('py').FormatException(e.ExceptionObject) Thanks! Works like a charm. Now I see exceptions on any thread without having to add try/except clauses all over. Btw, is there anywhere to get documentation on things like ScriptRuntime? I had to dig through the IronPython source to figure out how to get the engine. Many thanks to everyone here who took the time to respond on Sunday! -Dan From dinov at exchange.microsoft.com Mon Jun 9 04:00:33 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Sun, 8 Jun 2008 19:00:33 -0700 Subject: [IronPython] IronPython and Threads In-Reply-To: <4817b6fc0806081818i77b679c5ka2a593510c6f300d@mail.gmail.com> References: <4817b6fc0806080823qcf5e0fev5067e0c782499f7@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012BC9D35023@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0806081147m64f7b1f9we194d36bfecc60c5@mail.gmail.com> <484C2B16.1030809@voidspace.org.uk> <4817b6fc0806081222q56713e61q2533b16c6a2168e@mail.gmail.com> <4817b6fc0806081720m1f28c26dnb4e774922770b8ec@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012BC9D35029@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0806081818i77b679c5ka2a593510c6f300d@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012BC9D3502C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Yep, we actually have a pretty good spec on the hosting APIs. It's available over at http://compilerlab.members.winisp.net/ The direct links are: Doc: http://compilerlab.members.winisp.net/dlr-spec-hosting.doc PDF: http://compilerlab.members.winisp.net/dlr-spec-hosting.pdf -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Sunday, June 08, 2008 6:18 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython and Threads On Sun, Jun 8, 2008 at 7:44 PM, Dino Viehland wrote: > There's a DLR hosting API for formatting exceptions - ScriptEngine.FormatException. > > >From Silverlight I think you can access the DynamicApplication class, in Microsoft.Scripting.Silverlight, which gives you access to the current ScriptRuntime . You might need a clr.AddReference to Microsoft.Scripting.Silverlight in there. From there you can get the ScriptEngine for Python and then call FormatException on the exception object. And that will give you the Python stack trace as we normally display it. def excepthook(sender, e): print Application.Current.Environment.GetEngine('py').FormatException(e.ExceptionObject) Thanks! Works like a charm. Now I see exceptions on any thread without having to add try/except clauses all over. Btw, is there anywhere to get documentation on things like ScriptRuntime? I had to dig through the IronPython source to figure out how to get the engine. Many thanks to everyone here who took the time to respond on Sunday! -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From giles.thomas at resolversystems.com Mon Jun 9 12:04:31 2008 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Mon, 09 Jun 2008 11:04:31 +0100 Subject: [IronPython] Resolver One 1.1 In-Reply-To: References: Message-ID: <484D002F.7000500@resolversystems.com> Curt, Thanks! And many thanks to everyone on the IP team for producing such a solid platform, we're really enjoying working with it. Best regards, Giles Curt Hagenlocher wrote: > Congratulations to the Resolver One folks on the most recent release! > > http://www.resolversystems.com/news/?p=61 > > I've just come back from helping out with the Dynamic Languages > booth at TechEd, and it was very gratifying to be able to prove to > people that IronPython is a "real product" by naming a > shipping application which is implemented with it. > > -- > Curt Hagenlocher > curt at hagenlocher.org > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Giles Thomas MD & CTO, Resolver Systems Ltd. giles.thomas at resolversystems.com +44 (0) 20 7253 6372 Try out Resolver One! (Free registration required) 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK -------------- next part -------------- An HTML attachment was scrubbed... URL: From helmut.orian at schema.de Tue Jun 10 12:59:30 2008 From: helmut.orian at schema.de (Orian, Helmut) Date: Tue, 10 Jun 2008 12:59:30 +0200 Subject: [IronPython] Hosting API and PlatformAdaptationLayer Message-ID: At the moment I am hosting IronPython and IronRuby using the sources from the Silverlight2beta1 SDK which I recompiled to work against .NET 2.0 because it is the latest build of the DLR I found where both projects work with a common Microsoft.Scripting.dll. We have a client-server architecture and all our config-files and other script language files (like xsl and some own languages :-) are stored and versioned in our central application server instead of a harddisk. For the initial python script I want to execute this was no problem, but to get the import statement of python ('require' in ruby) to work I implemented a class deriving from Microsoft.Scripting.PlatformAdaptationLayer. This implementation worked perfectly for me, but I have not found a way to bootstrap ScriptRuntime and ScriptHost with my implementation by using the current public API in Microsoft.Scripting. I had to use an own implementation derived from ScriptHost to inject my derived PlatformAdaptationLayer instance with (ugly) reflection into the ScriptRuntime. It would be nice if I could set/use my derived PlatformAdaptationLayer instance by public API. Thanks, Helmut --------------------------------------------------------------------------- An- und Abmeldung zur SCHEMA Mailingliste unter http://www.schema.de/mail --------------------------------------------------------------------------- From curt at hagenlocher.org Tue Jun 10 14:55:43 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 10 Jun 2008 05:55:43 -0700 Subject: [IronPython] Products with IronPython In-Reply-To: <-7039741985362303264@unknownmsgid> References: <-7039741985362303264@unknownmsgid> Message-ID: This looks very interesting. My feeble French-language skills don't allow for as much understanding as I'd like, but fortunately expressions like "un environnement de d?veloppement puissant" are pretty close to their English equivalent. I'm also fascinated by the product's unconventional name. There must be some kind of story behind it, yes? On Sun, Jun 8, 2008 at 1:35 PM, Gerard Mulot wrote: > LeeBeLLuL is a little framework to develop style RIA application which > use IronPython in the browser and InfoPath in the form design > > > > 2 demos are available > > > > The first with IronPython 1.0 : > http://www.leebellul.com/DEMO/V1/LBL_v1.zip > > > > The second with IronPython 2.0 : > http://www.leebellul.com/DEMO/V2/LBL_v2.zip > > > > Applications developed with IronPython 1.0 are in used more than a year : > http://www.leebellul.com/Site/index.html > > > > The site is in French > > > > > > > > > > _______________________________________________ > 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 fuzzyman at voidspace.org.uk Tue Jun 10 17:26:48 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 10 Jun 2008 16:26:48 +0100 Subject: [IronPython] IronPython for Silverlight 2 Beta 2 Message-ID: <484E9D38.1060106@voidspace.org.uk> Hello guys, Is there a new release of the Silverlight (tm) Dynamic Languages SDK for Silverlight 2 Beta 2 planned? Michael Foord -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From falcon at uwyo.edu Tue Jun 10 18:01:54 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Tue, 10 Jun 2008 10:01:54 -0600 Subject: [IronPython] Products with IronPython In-Reply-To: <515335F32AA04440B3DE6FEA1993E9AD03269852@srv-be-101.Symyx-IC.symyx.com> References: <515335F32AA04440B3DE6FEA1993E9AD03269852@srv-be-101.Symyx-IC.symyx.com> Message-ID: We use IronPython at www.handelit.com in our product called RiteTrack to do user scripting. The implementation was extremely fast and it has been incredibly powerful. We are using the embedded PythonEngine. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Sat, Jun 7, 2008 at 5:12 PM, Marty Nelson wrote: > We used IronPython for scripting of form editor widgets in our universal > ELN product: http://www.symyx.com/press_release.php?id=4&p=283&y=2008 > > > > We plan on continuing to leverage DLR scripting to move more extensibility > points from customization to configuration. > > > > And while the 2.0 generation IP on top of the common DLR infrastructure > really makes it so we don't care what DLR scripting language they choose, > IronPython is our first choice to support in terms of editors, etc., as it > has been well received among the scientific community. > > > ------------------------------ > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Curt Hagenlocher > *Sent:* Saturday, June 07, 2008 7:19 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] Resolver One 1.1 > > > > Congratulations to the Resolver One folks on the most recent release! > > > > http://www.resolversystems.com/news/?p=61 > > > > I've just come back from helping out with the Dynamic Languages booth at > TechEd, and it was very gratifying to be able to prove to people that > IronPython is a "real product" by naming a shipping application which > is implemented with it. > > > > -- > > Curt Hagenlocher > > curt at hagenlocher.org > ======= > Notice: This e-mail message, together with any attachments, contains > information of Symyx Technologies, Inc. or any of its affiliates or > subsidiaries that may be confidential, proprietary, copyrighted, > privileged and/or protected work product, and is meant solely for > the intended recipient. If you are not the intended recipient, and > have received this message in error, please contact the sender > immediately, permanently delete the original and any copies of this > email and any attachments thereto. > > _______________________________________________ > 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 Jimmy.Schementi at microsoft.com Tue Jun 10 21:45:52 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 10 Jun 2008 12:45:52 -0700 Subject: [IronPython] IronPython for Silverlight 2 Beta 2 In-Reply-To: <484E9D38.1060106@voidspace.org.uk> References: <484E9D38.1060106@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC4071F5@NA-EXMSG-C116.redmond.corp.microsoft.com> Yep, pushing it out today > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Tuesday, June 10, 2008 8:27 AM > To: Discussion of IronPython > Subject: [IronPython] IronPython for Silverlight 2 Beta 2 > > Hello guys, > > Is there a new release of the Silverlight (tm) Dynamic Languages SDK > for > Silverlight 2 Beta 2 planned? > > Michael Foord > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Tue Jun 10 21:47:10 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 10 Jun 2008 20:47:10 +0100 Subject: [IronPython] IronPython for Silverlight 2 Beta 2 In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC4071F5@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <484E9D38.1060106@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC4071F5@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <484EDA3E.4020103@voidspace.org.uk> Jimmy Schementi wrote: > Yep, pushing it out today > Hooray :-) Michael > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Tuesday, June 10, 2008 8:27 AM >> To: Discussion of IronPython >> Subject: [IronPython] IronPython for Silverlight 2 Beta 2 >> >> Hello guys, >> >> Is there a new release of the Silverlight (tm) Dynamic Languages SDK >> for >> Silverlight 2 Beta 2 planned? >> >> Michael Foord >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.theotherdelia.co.uk/ >> http://www.voidspace.org.uk/ >> http://www.ironpython.info/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From Jimmy.Schementi at microsoft.com Tue Jun 10 21:58:32 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 10 Jun 2008 12:58:32 -0700 Subject: [IronPython] Hosting API and PlatformAdaptationLayer In-Reply-To: References: Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC40720D@NA-EXMSG-C116.redmond.corp.microsoft.com> The public API to do this is ScriptRuntimeSetup.HostType; an example of using this is in Silverlight. Take a look at Microsoft.Scripting.Silverlight/BrowserPAL.cs and Microsoft.Scripting.Silverlight/BrowserScriptHost.cs. Here's the basics: class YourPAL : PlatforAdaptationLayer { static readonly YourPAL PAL = new YourPAL(); ... } class YourScriptHost : ScriptHost { ... public override PlatformAdaptationLayer PlatformAdaptationLayer { get { return YourPAL.PAL; } } } // In code that hosts the DLR: ScriptRuntimeSetup setup = new ScriptRuntimeSetup(true) setup.HostType = typeof(YourScriptHost) ScriptRuntime runtime = ScriptRuntime.Create(setup) ... Make sense? ~Jimmy > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Orian, Helmut > Sent: Tuesday, June 10, 2008 4:00 AM > To: users at lists.ironpython.com > Subject: [IronPython] Hosting API and PlatformAdaptationLayer > > At the moment I am hosting IronPython and IronRuby using the sources > from the Silverlight2beta1 SDK which I recompiled to work against .NET > 2.0 because it is the latest build of the DLR I found where both > projects work with a common Microsoft.Scripting.dll. > > We have a client-server architecture and all our config-files and other > script language files (like xsl and some own languages :-) are stored > and versioned in our central application server instead of a harddisk. > > For the initial python script I want to execute this was no problem, > but > to get the import statement of python ('require' in ruby) to work I > implemented a class deriving from > Microsoft.Scripting.PlatformAdaptationLayer. This implementation worked > perfectly for me, but I have not found a way to bootstrap ScriptRuntime > and ScriptHost with my implementation by using the current public API > in > Microsoft.Scripting. > > I had to use an own implementation derived from ScriptHost to inject my > derived PlatformAdaptationLayer instance with (ugly) reflection into > the > ScriptRuntime. > > It would be nice if I could set/use my derived PlatformAdaptationLayer > instance by public API. > > > Thanks, > Helmut > > > ----------------------------------------------------------------------- > ---- > > An- und Abmeldung zur SCHEMA Mailingliste unter > http://www.schema.de/mail > > ----------------------------------------------------------------------- > ---- > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Tue Jun 10 22:15:42 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 10 Jun 2008 21:15:42 +0100 Subject: [IronPython] Hosting API and PlatformAdaptationLayer In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC40720D@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC40720D@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <484EE0EE.5000703@voidspace.org.uk> What's the use case for doing this? Michael Jimmy Schementi wrote: > The public API to do this is ScriptRuntimeSetup.HostType; an example of using this is in Silverlight. Take a look at Microsoft.Scripting.Silverlight/BrowserPAL.cs and Microsoft.Scripting.Silverlight/BrowserScriptHost.cs. Here's the basics: > > class YourPAL : PlatforAdaptationLayer { > static readonly YourPAL PAL = new YourPAL(); > ... > } > > class YourScriptHost : ScriptHost { > ... > > public override PlatformAdaptationLayer PlatformAdaptationLayer { > get { > return YourPAL.PAL; > } > } > } > > // In code that hosts the DLR: > ScriptRuntimeSetup setup = new ScriptRuntimeSetup(true) > setup.HostType = typeof(YourScriptHost) > ScriptRuntime runtime = ScriptRuntime.Create(setup) > ... > > Make sense? > ~Jimmy > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Orian, Helmut >> Sent: Tuesday, June 10, 2008 4:00 AM >> To: users at lists.ironpython.com >> Subject: [IronPython] Hosting API and PlatformAdaptationLayer >> >> At the moment I am hosting IronPython and IronRuby using the sources >> from the Silverlight2beta1 SDK which I recompiled to work against .NET >> 2.0 because it is the latest build of the DLR I found where both >> projects work with a common Microsoft.Scripting.dll. >> >> We have a client-server architecture and all our config-files and other >> script language files (like xsl and some own languages :-) are stored >> and versioned in our central application server instead of a harddisk. >> >> For the initial python script I want to execute this was no problem, >> but >> to get the import statement of python ('require' in ruby) to work I >> implemented a class deriving from >> Microsoft.Scripting.PlatformAdaptationLayer. This implementation worked >> perfectly for me, but I have not found a way to bootstrap ScriptRuntime >> and ScriptHost with my implementation by using the current public API >> in >> Microsoft.Scripting. >> >> I had to use an own implementation derived from ScriptHost to inject my >> derived PlatformAdaptationLayer instance with (ugly) reflection into >> the >> ScriptRuntime. >> >> It would be nice if I could set/use my derived PlatformAdaptationLayer >> instance by public API. >> >> >> Thanks, >> Helmut >> >> >> ----------------------------------------------------------------------- >> ---- >> >> An- und Abmeldung zur SCHEMA Mailingliste unter >> http://www.schema.de/mail >> >> ----------------------------------------------------------------------- >> ---- >> >> >> _______________________________________________ >> 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 > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From g.mulot at free.fr Tue Jun 10 22:24:51 2008 From: g.mulot at free.fr (Gerard Mulot) Date: Tue, 10 Jun 2008 22:24:51 +0200 Subject: [IronPython] Products with IronPython Message-ID: <000001c8cb38$09a27cf0$1ce776d0$@mulot@free.fr> Curt Thank you for your comments One night i was listening Radio France Culture. The convener of the emission asked the writers that they were receiving. What was for you the most beautiful word of the French language. A writer replied "libellule". -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Tue Jun 10 22:58:40 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 10 Jun 2008 13:58:40 -0700 Subject: [IronPython] Hosting API and PlatformAdaptationLayer In-Reply-To: <484EE0EE.5000703@voidspace.org.uk> References: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC40720D@NA-EXMSG-C116.redmond.corp.microsoft.com> <484EE0EE.5000703@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC4B62CE@NA-EXMSG-C116.redmond.corp.microsoft.com> For Silverlight, a custom PAL is needed to override methods like "FileExists", "LoadAssemblyFromPath", etc, since Silverlight should look inside the XAP file when anything that assumes access to the file system is used. The fact that we have a custom PAL in Silverlight a little strange, as we should support hosting the DLR in C# Silverlight apps by just having the assembles build with Silverlight, but if you can't change the DLR code and want a different platform behavior, overriding the PAL is the way to go. ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Tuesday, June 10, 2008 1:16 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Hosting API and PlatformAdaptationLayer > > What's the use case for doing this? > > Michael > > Jimmy Schementi wrote: > > The public API to do this is ScriptRuntimeSetup.HostType; an example > of using this is in Silverlight. Take a look at > Microsoft.Scripting.Silverlight/BrowserPAL.cs and > Microsoft.Scripting.Silverlight/BrowserScriptHost.cs. Here's the > basics: > > > > class YourPAL : PlatforAdaptationLayer { > > static readonly YourPAL PAL = new YourPAL(); > > ... > > } > > > > class YourScriptHost : ScriptHost { > > ... > > > > public override PlatformAdaptationLayer PlatformAdaptationLayer { > > get { > > return YourPAL.PAL; > > } > > } > > } > > > > // In code that hosts the DLR: > > ScriptRuntimeSetup setup = new ScriptRuntimeSetup(true) > > setup.HostType = typeof(YourScriptHost) > > ScriptRuntime runtime = ScriptRuntime.Create(setup) > > ... > > > > Make sense? > > ~Jimmy > > > > > >> -----Original Message----- > >> From: users-bounces at lists.ironpython.com [mailto:users- > >> bounces at lists.ironpython.com] On Behalf Of Orian, Helmut > >> Sent: Tuesday, June 10, 2008 4:00 AM > >> To: users at lists.ironpython.com > >> Subject: [IronPython] Hosting API and PlatformAdaptationLayer > >> > >> At the moment I am hosting IronPython and IronRuby using the sources > >> from the Silverlight2beta1 SDK which I recompiled to work against > .NET > >> 2.0 because it is the latest build of the DLR I found where both > >> projects work with a common Microsoft.Scripting.dll. > >> > >> We have a client-server architecture and all our config-files and > other > >> script language files (like xsl and some own languages :-) are > stored > >> and versioned in our central application server instead of a > harddisk. > >> > >> For the initial python script I want to execute this was no problem, > >> but > >> to get the import statement of python ('require' in ruby) to work I > >> implemented a class deriving from > >> Microsoft.Scripting.PlatformAdaptationLayer. This implementation > worked > >> perfectly for me, but I have not found a way to bootstrap > ScriptRuntime > >> and ScriptHost with my implementation by using the current public > API > >> in > >> Microsoft.Scripting. > >> > >> I had to use an own implementation derived from ScriptHost to inject > my > >> derived PlatformAdaptationLayer instance with (ugly) reflection into > >> the > >> ScriptRuntime. > >> > >> It would be nice if I could set/use my derived > PlatformAdaptationLayer > >> instance by public API. > >> > >> > >> Thanks, > >> Helmut > >> > >> > >> -------------------------------------------------------------------- > --- > >> ---- > >> > >> An- und Abmeldung zur SCHEMA Mailingliste unter > >> http://www.schema.de/mail > >> > >> -------------------------------------------------------------------- > --- > >> ---- > >> > >> > >> _______________________________________________ > >> 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 > > > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Tue Jun 10 22:59:48 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 10 Jun 2008 21:59:48 +0100 Subject: [IronPython] Hosting API and PlatformAdaptationLayer In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC4B62CE@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC40720D@NA-EXMSG-C116.redmond.corp.microsoft.com> <484EE0EE.5000703@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC4B62CE@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <484EEB44.9070109@voidspace.org.uk> Interesting - thanks. Michael Jimmy Schementi wrote: > For Silverlight, a custom PAL is needed to override methods like "FileExists", "LoadAssemblyFromPath", etc, since Silverlight should look inside the XAP file when anything that assumes access to the file system is used. > > The fact that we have a custom PAL in Silverlight a little strange, as we should support hosting the DLR in C# Silverlight apps by just having the assembles build with Silverlight, but if you can't change the DLR code and want a different platform behavior, overriding the PAL is the way to go. > > ~js > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Tuesday, June 10, 2008 1:16 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Hosting API and PlatformAdaptationLayer >> >> What's the use case for doing this? >> >> Michael >> >> Jimmy Schementi wrote: >> >>> The public API to do this is ScriptRuntimeSetup.HostType; an example >>> >> of using this is in Silverlight. Take a look at >> Microsoft.Scripting.Silverlight/BrowserPAL.cs and >> Microsoft.Scripting.Silverlight/BrowserScriptHost.cs. Here's the >> basics: >> >>> class YourPAL : PlatforAdaptationLayer { >>> static readonly YourPAL PAL = new YourPAL(); >>> ... >>> } >>> >>> class YourScriptHost : ScriptHost { >>> ... >>> >>> public override PlatformAdaptationLayer PlatformAdaptationLayer { >>> get { >>> return YourPAL.PAL; >>> } >>> } >>> } >>> >>> // In code that hosts the DLR: >>> ScriptRuntimeSetup setup = new ScriptRuntimeSetup(true) >>> setup.HostType = typeof(YourScriptHost) >>> ScriptRuntime runtime = ScriptRuntime.Create(setup) >>> ... >>> >>> Make sense? >>> ~Jimmy >>> >>> >>> >>>> -----Original Message----- >>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>> bounces at lists.ironpython.com] On Behalf Of Orian, Helmut >>>> Sent: Tuesday, June 10, 2008 4:00 AM >>>> To: users at lists.ironpython.com >>>> Subject: [IronPython] Hosting API and PlatformAdaptationLayer >>>> >>>> At the moment I am hosting IronPython and IronRuby using the sources >>>> from the Silverlight2beta1 SDK which I recompiled to work against >>>> >> .NET >> >>>> 2.0 because it is the latest build of the DLR I found where both >>>> projects work with a common Microsoft.Scripting.dll. >>>> >>>> We have a client-server architecture and all our config-files and >>>> >> other >> >>>> script language files (like xsl and some own languages :-) are >>>> >> stored >> >>>> and versioned in our central application server instead of a >>>> >> harddisk. >> >>>> For the initial python script I want to execute this was no problem, >>>> but >>>> to get the import statement of python ('require' in ruby) to work I >>>> implemented a class deriving from >>>> Microsoft.Scripting.PlatformAdaptationLayer. This implementation >>>> >> worked >> >>>> perfectly for me, but I have not found a way to bootstrap >>>> >> ScriptRuntime >> >>>> and ScriptHost with my implementation by using the current public >>>> >> API >> >>>> in >>>> Microsoft.Scripting. >>>> >>>> I had to use an own implementation derived from ScriptHost to inject >>>> >> my >> >>>> derived PlatformAdaptationLayer instance with (ugly) reflection into >>>> the >>>> ScriptRuntime. >>>> >>>> It would be nice if I could set/use my derived >>>> >> PlatformAdaptationLayer >> >>>> instance by public API. >>>> >>>> >>>> Thanks, >>>> Helmut >>>> >>>> >>>> -------------------------------------------------------------------- >>>> >> --- >> >>>> ---- >>>> >>>> An- und Abmeldung zur SCHEMA Mailingliste unter >>>> http://www.schema.de/mail >>>> >>>> -------------------------------------------------------------------- >>>> >> --- >> >>>> ---- >>>> >>>> >>>> _______________________________________________ >>>> 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 >>> >>> >> -- >> http://www.ironpythoninaction.com/ >> http://www.theotherdelia.co.uk/ >> http://www.voidspace.org.uk/ >> http://www.ironpython.info/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From Jimmy.Schementi at microsoft.com Tue Jun 10 23:08:32 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 10 Jun 2008 14:08:32 -0700 Subject: [IronPython] Dynamic Lanugages in Silverlight 2 Beta 2 Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC4B62EC@NA-EXMSG-C116.redmond.corp.microsoft.com> http://blog.jimmy.schementi.com/2008/06/dynamic-languages-in-silverlight-2-beta.html With the announcement of Silverlight 2 Beta 2, the Silverlight Dynamic Languages SDK has been updated as well! Download the Dynamic Languages SDK: http://www.codeplex.com/sdlsdk/Release/ProjectReleases.aspx?ReleaseId=14254 There's a lot of new stuff here, from new versions of IronRuby, IronPython, Managed JScript, and the Dynamic Languages Runtime, to more sample. Also, there are now three packages: SDK, SDK Samples, and SDK Source. * SDK: Necessary package to create dynamic language Silverlight applications. * SDK Samples: a bunch of Ruby, Python, and JScript samples. Best bet is to unzip this in the SDK directory. * SDK Source Code: If you want to modify the languages/DLR/Silverlight integration, you can do so here, and build using the given Solution file in Visual Studio. This will create a /bin directory with the identical binaries as the /bin directory in the SDK, however without DLL signing. Enjoy! ~Jimmy From ben2004uk at googlemail.com Tue Jun 10 23:29:34 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Tue, 10 Jun 2008 22:29:34 +0100 Subject: [IronPython] [Ironruby-core] Dynamic Lanugages in Silverlight 2 Beta 2 In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC4B62EC@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC4B62EC@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Excellent!! A new set of IronPython, IronRuby and DLR assemblies. I can actually get my app working tonight! Thanks Ben Blog.BenHall.me.uk On Tue, Jun 10, 2008 at 10:08 PM, Jimmy Schementi wrote: > http://blog.jimmy.schementi.com/2008/06/dynamic-languages-in-silverlight-2-beta.html > > With the announcement of Silverlight 2 Beta 2, the Silverlight Dynamic Languages SDK has been updated as well! > > Download the Dynamic Languages SDK: > http://www.codeplex.com/sdlsdk/Release/ProjectReleases.aspx?ReleaseId=14254 > > There's a lot of new stuff here, from new versions of IronRuby, IronPython, Managed JScript, and the Dynamic Languages Runtime, to more sample. Also, there are now three packages: SDK, SDK Samples, and SDK Source. > > * SDK: Necessary package to create dynamic language Silverlight applications. > * SDK Samples: a bunch of Ruby, Python, and JScript samples. Best bet is to unzip this in the SDK directory. > * SDK Source Code: If you want to modify the languages/DLR/Silverlight integration, you can do so here, and build using the given Solution file in Visual Studio. This will create a /bin directory with the identical binaries as the /bin directory in the SDK, however without DLL signing. > > Enjoy! > ~Jimmy > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > From ben2004uk at googlemail.com Wed Jun 11 00:48:40 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Tue, 10 Jun 2008 23:48:40 +0100 Subject: [IronPython] System, Version 2.0.5.0 Message-ID: Hello, I have just downloaded and upgraded my WinForms application to use the latest Dynamic Languages for Silverlight Beta 2. I think I must be confused, but the two DLR assemblies (Microsoft.Scripting.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 and Microsoft.Scripting, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) both reference System, Version 2.0.5.0 - the one shipped with Silverlight and not System, Version 2.0.0.0 as shipped with IronPython Beta 2. I expected the DLR assemblies to work in both WinForms and Silverlight. As such, when I try and execute IronPython code, I get the following exception. Unhandled Exception System.IO.FileNotFoundException: Could not load file or assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified. File name: 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' at IronPython.Compiler.Parser.Reset(SourceUnit sourceUnit, PythonLanguageFeatures languageFeatures) at IronPython.Compiler.Parser..ctor(Tokenizer tokenizer, ErrorSink errorSink, ParserSink parserSink, PythonLanguageFeatures languageFeatures) at IronPython.Compiler.Parser.CreateParser(CompilerContext context, PythonEngineOptions options, Boolean verbatim) at IronPython.Compiler.Parser.CreateParser(CompilerContext context, PythonEngineOptions options) at IronPython.Runtime.PythonContext.ParseSourceCode(CompilerContext context) at Microsoft.Scripting.SourceUnit.Parse(CompilerOptions options, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Compile(CompilerOptions options, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Execute(Scope scope) at Microsoft.Scripting.Hosting.ScriptScope.Execute(String code) at DLRHost.Engine.ScriptExecutor.ExecuteStatement(String code) in E:\Source Control\DLRHost\trunk\src\DLRHost.Engine\ScriptExecutor.cs:line 33 If someone could explain this to me, that would be great! Thanks Ben Blog.BenHall.me.uk From srivatsn at microsoft.com Wed Jun 11 00:54:15 2008 From: srivatsn at microsoft.com (Srivatsn Narayanan) Date: Tue, 10 Jun 2008 15:54:15 -0700 Subject: [IronPython] System, Version 2.0.5.0 In-Reply-To: References: Message-ID: The DSL package has the languages and DLR sources compiled against the silverlight CLR. The sources need to be compiled against the desktop CLR for it to work with 2.0.0.0. For the latest desktop IronPython you'd need to wait for IronPython beta 3 coming very soon. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ben Hall Sent: Tuesday, June 10, 2008 3:49 PM To: Discussion of IronPython Subject: [IronPython] System, Version 2.0.5.0 Hello, I have just downloaded and upgraded my WinForms application to use the latest Dynamic Languages for Silverlight Beta 2. I think I must be confused, but the two DLR assemblies (Microsoft.Scripting.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 and Microsoft.Scripting, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) both reference System, Version 2.0.5.0 - the one shipped with Silverlight and not System, Version 2.0.0.0 as shipped with IronPython Beta 2. I expected the DLR assemblies to work in both WinForms and Silverlight. As such, when I try and execute IronPython code, I get the following exception. Unhandled Exception System.IO.FileNotFoundException: Could not load file or assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified. File name: 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' at IronPython.Compiler.Parser.Reset(SourceUnit sourceUnit, PythonLanguageFeatures languageFeatures) at IronPython.Compiler.Parser..ctor(Tokenizer tokenizer, ErrorSink errorSink, ParserSink parserSink, PythonLanguageFeatures languageFeatures) at IronPython.Compiler.Parser.CreateParser(CompilerContext context, PythonEngineOptions options, Boolean verbatim) at IronPython.Compiler.Parser.CreateParser(CompilerContext context, PythonEngineOptions options) at IronPython.Runtime.PythonContext.ParseSourceCode(CompilerContext context) at Microsoft.Scripting.SourceUnit.Parse(CompilerOptions options, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Compile(CompilerOptions options, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Execute(Scope scope) at Microsoft.Scripting.Hosting.ScriptScope.Execute(String code) at DLRHost.Engine.ScriptExecutor.ExecuteStatement(String code) in E:\Source Control\DLRHost\trunk\src\DLRHost.Engine\ScriptExecutor.cs:line 33 If someone could explain this to me, that would be great! Thanks Ben Blog.BenHall.me.uk _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ben2004uk at googlemail.com Wed Jun 11 01:17:04 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Wed, 11 Jun 2008 00:17:04 +0100 Subject: [IronPython] System, Version 2.0.5.0 In-Reply-To: References: Message-ID: Thanks for your reply. Do you not think that will get really confusing for people - having two different Microsoft.Scripting assemblies based on the host? Cheers Ben On Tue, Jun 10, 2008 at 11:54 PM, Srivatsn Narayanan wrote: > The DSL package has the languages and DLR sources compiled against the silverlight CLR. The sources need to be compiled against the desktop CLR for it to work with 2.0.0.0. For the latest desktop IronPython you'd need to wait for IronPython beta 3 coming very soon. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ben Hall > Sent: Tuesday, June 10, 2008 3:49 PM > To: Discussion of IronPython > Subject: [IronPython] System, Version 2.0.5.0 > > Hello, > > I have just downloaded and upgraded my WinForms application to use the > latest Dynamic Languages for Silverlight Beta 2. I think I must be > confused, but the two DLR assemblies (Microsoft.Scripting.Core, > Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 and > Microsoft.Scripting, Version=2.0.5.0, Culture=neutral, > PublicKeyToken=31bf3856ad364e35) both reference System, Version > 2.0.5.0 - the one shipped with Silverlight and not System, Version > 2.0.0.0 as shipped with IronPython Beta 2. > > I expected the DLR assemblies to work in both WinForms and Silverlight. > > As such, when I try and execute IronPython code, I get the following exception. > > Unhandled Exception System.IO.FileNotFoundException: Could not load > file or assembly 'System, Version=2.0.5.0, Culture=neutral, > PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The > system cannot find the file specified. > File name: 'System, Version=2.0.5.0, Culture=neutral, > PublicKeyToken=7cec85d7bea7798e' > at IronPython.Compiler.Parser.Reset(SourceUnit sourceUnit, > PythonLanguageFeatures languageFeatures) > at IronPython.Compiler.Parser..ctor(Tokenizer tokenizer, ErrorSink > errorSink, ParserSink parserSink, PythonLanguageFeatures > languageFeatures) > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > PythonEngineOptions options, Boolean verbatim) > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > PythonEngineOptions options) > at IronPython.Runtime.PythonContext.ParseSourceCode(CompilerContext context) > at Microsoft.Scripting.SourceUnit.Parse(CompilerOptions options, > ErrorSink errorSink) > at Microsoft.Scripting.SourceUnit.Compile(CompilerOptions options, > ErrorSink errorSink) > at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) > at Microsoft.Scripting.SourceUnit.Execute(Scope scope) > at Microsoft.Scripting.Hosting.ScriptScope.Execute(String code) > at DLRHost.Engine.ScriptExecutor.ExecuteStatement(String code) in > E:\Source Control\DLRHost\trunk\src\DLRHost.Engine\ScriptExecutor.cs:line > 33 > > If someone could explain this to me, that would be great! > > Thanks > > Ben > Blog.BenHall.me.uk > _______________________________________________ > 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 Jimmy.Schementi at microsoft.com Wed Jun 11 01:44:00 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 10 Jun 2008 16:44:00 -0700 Subject: [IronPython] System, Version 2.0.5.0 In-Reply-To: References: Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC4B6455@NA-EXMSG-C116.redmond.corp.microsoft.com> Silverlight is not a host, it's a platform, with unique compilers and libraries. The .NET framework shipped with Silverlight is not the same as what's on the desktop, though meant to look the same by having a similar API. Plus, there are "platform" specific features of each, like security levels and the file system on the Desktop and HtmlBridge and isolated storage on Silverlight. Point being, to use something on a specific platform, it must be built for that platform. The source code may be the same for each, but that's a detail of the implementation. If you look at your Silverlight installation location, there is mscorlib.dll, System.Windows.dll, etc ... all have "equivalent" Desktop versions, but they are definitely not interchangeable. This is what it's like living in a compiled world =P Make sense? ~Jimmy > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Ben Hall > Sent: Tuesday, June 10, 2008 4:17 PM > To: Discussion of IronPython > Subject: Re: [IronPython] System, Version 2.0.5.0 > > Thanks for your reply. Do you not think that will get really > confusing for people - having two different Microsoft.Scripting > assemblies based on the host? > > Cheers > > Ben > > On Tue, Jun 10, 2008 at 11:54 PM, Srivatsn Narayanan > wrote: > > The DSL package has the languages and DLR sources compiled against > the silverlight CLR. The sources need to be compiled against the > desktop CLR for it to work with 2.0.0.0. For the latest desktop > IronPython you'd need to wait for IronPython beta 3 coming very soon. > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Ben Hall > > Sent: Tuesday, June 10, 2008 3:49 PM > > To: Discussion of IronPython > > Subject: [IronPython] System, Version 2.0.5.0 > > > > Hello, > > > > I have just downloaded and upgraded my WinForms application to use > the > > latest Dynamic Languages for Silverlight Beta 2. I think I must be > > confused, but the two DLR assemblies (Microsoft.Scripting.Core, > > Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 and > > Microsoft.Scripting, Version=2.0.5.0, Culture=neutral, > > PublicKeyToken=31bf3856ad364e35) both reference System, Version > > 2.0.5.0 - the one shipped with Silverlight and not System, Version > > 2.0.0.0 as shipped with IronPython Beta 2. > > > > I expected the DLR assemblies to work in both WinForms and > Silverlight. > > > > As such, when I try and execute IronPython code, I get the following > exception. > > > > Unhandled Exception System.IO.FileNotFoundException: Could not load > > file or assembly 'System, Version=2.0.5.0, Culture=neutral, > > PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The > > system cannot find the file specified. > > File name: 'System, Version=2.0.5.0, Culture=neutral, > > PublicKeyToken=7cec85d7bea7798e' > > at IronPython.Compiler.Parser.Reset(SourceUnit sourceUnit, > > PythonLanguageFeatures languageFeatures) > > at IronPython.Compiler.Parser..ctor(Tokenizer tokenizer, ErrorSink > > errorSink, ParserSink parserSink, PythonLanguageFeatures > > languageFeatures) > > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > > PythonEngineOptions options, Boolean verbatim) > > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > > PythonEngineOptions options) > > at IronPython.Runtime.PythonContext.ParseSourceCode(CompilerContext > context) > > at Microsoft.Scripting.SourceUnit.Parse(CompilerOptions options, > > ErrorSink errorSink) > > at Microsoft.Scripting.SourceUnit.Compile(CompilerOptions options, > > ErrorSink errorSink) > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink > errorSink) > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope) > > at Microsoft.Scripting.Hosting.ScriptScope.Execute(String code) > > at DLRHost.Engine.ScriptExecutor.ExecuteStatement(String code) in > > E:\Source > Control\DLRHost\trunk\src\DLRHost.Engine\ScriptExecutor.cs:line > > 33 > > > > If someone could explain this to me, that would be great! > > > > Thanks > > > > Ben > > Blog.BenHall.me.uk > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From srivatsn at microsoft.com Wed Jun 11 02:38:02 2008 From: srivatsn at microsoft.com (Srivatsn Narayanan) Date: Tue, 10 Jun 2008 17:38:02 -0700 Subject: [IronPython] System, Version 2.0.5.0 In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC4B6455@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC4B6455@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: One thing we are doing that will help here is starting from beta3 the ironpython codeplex sources will have the silverlight sources (including Chiron) and Ironpython.sln will be configured the way Ivan mentioned in the IronRuby alias so that a msbuild /p:Configuration="Release" builds the desktop version of ipy/dlr and msbuild /p:Configuration="Silverlight Release" builds the silverlight version. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi Sent: Tuesday, June 10, 2008 4:44 PM To: Discussion of IronPython Subject: Re: [IronPython] System, Version 2.0.5.0 Silverlight is not a host, it's a platform, with unique compilers and libraries. The .NET framework shipped with Silverlight is not the same as what's on the desktop, though meant to look the same by having a similar API. Plus, there are "platform" specific features of each, like security levels and the file system on the Desktop and HtmlBridge and isolated storage on Silverlight. Point being, to use something on a specific platform, it must be built for that platform. The source code may be the same for each, but that's a detail of the implementation. If you look at your Silverlight installation location, there is mscorlib.dll, System.Windows.dll, etc ... all have "equivalent" Desktop versions, but they are definitely not interchangeable. This is what it's like living in a compiled world =P Make sense? ~Jimmy > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Ben Hall > Sent: Tuesday, June 10, 2008 4:17 PM > To: Discussion of IronPython > Subject: Re: [IronPython] System, Version 2.0.5.0 > > Thanks for your reply. Do you not think that will get really > confusing for people - having two different Microsoft.Scripting > assemblies based on the host? > > Cheers > > Ben > > On Tue, Jun 10, 2008 at 11:54 PM, Srivatsn Narayanan > wrote: > > The DSL package has the languages and DLR sources compiled against > the silverlight CLR. The sources need to be compiled against the > desktop CLR for it to work with 2.0.0.0. For the latest desktop > IronPython you'd need to wait for IronPython beta 3 coming very soon. > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Ben Hall > > Sent: Tuesday, June 10, 2008 3:49 PM > > To: Discussion of IronPython > > Subject: [IronPython] System, Version 2.0.5.0 > > > > Hello, > > > > I have just downloaded and upgraded my WinForms application to use > the > > latest Dynamic Languages for Silverlight Beta 2. I think I must be > > confused, but the two DLR assemblies (Microsoft.Scripting.Core, > > Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 and > > Microsoft.Scripting, Version=2.0.5.0, Culture=neutral, > > PublicKeyToken=31bf3856ad364e35) both reference System, Version > > 2.0.5.0 - the one shipped with Silverlight and not System, Version > > 2.0.0.0 as shipped with IronPython Beta 2. > > > > I expected the DLR assemblies to work in both WinForms and > Silverlight. > > > > As such, when I try and execute IronPython code, I get the following > exception. > > > > Unhandled Exception System.IO.FileNotFoundException: Could not load > > file or assembly 'System, Version=2.0.5.0, Culture=neutral, > > PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The > > system cannot find the file specified. > > File name: 'System, Version=2.0.5.0, Culture=neutral, > > PublicKeyToken=7cec85d7bea7798e' > > at IronPython.Compiler.Parser.Reset(SourceUnit sourceUnit, > > PythonLanguageFeatures languageFeatures) > > at IronPython.Compiler.Parser..ctor(Tokenizer tokenizer, ErrorSink > > errorSink, ParserSink parserSink, PythonLanguageFeatures > > languageFeatures) > > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > > PythonEngineOptions options, Boolean verbatim) > > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > > PythonEngineOptions options) > > at IronPython.Runtime.PythonContext.ParseSourceCode(CompilerContext > context) > > at Microsoft.Scripting.SourceUnit.Parse(CompilerOptions options, > > ErrorSink errorSink) > > at Microsoft.Scripting.SourceUnit.Compile(CompilerOptions options, > > ErrorSink errorSink) > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink > errorSink) > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope) > > at Microsoft.Scripting.Hosting.ScriptScope.Execute(String code) > > at DLRHost.Engine.ScriptExecutor.ExecuteStatement(String code) in > > E:\Source > Control\DLRHost\trunk\src\DLRHost.Engine\ScriptExecutor.cs:line > > 33 > > > > If someone could explain this to me, that would be great! > > > > Thanks > > > > Ben > > Blog.BenHall.me.uk > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From r.worbis at cubido.at Wed Jun 11 06:51:22 2008 From: r.worbis at cubido.at (Rainer Worbis) Date: Wed, 11 Jun 2008 06:51:22 +0200 Subject: [IronPython] System, Version 2.0.5.0 In-Reply-To: References: Message-ID: <676F9CCC1D1D3242BE4B133746E3807E49AA1C@XARA.cubido.linz> Hallo, Is there an 'easy' to use package which includes IronPython, Ruby and JScript for use with desktop applications - or an documentation how to compile these things from an silverlight distributation? Rainer -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Srivatsn Narayanan Gesendet: Mittwoch, 11. Juni 2008 00:54 An: Discussion of IronPython Betreff: Re: [IronPython] System, Version 2.0.5.0 The DSL package has the languages and DLR sources compiled against the silverlight CLR. The sources need to be compiled against the desktop CLR for it to work with 2.0.0.0. For the latest desktop IronPython you'd need to wait for IronPython beta 3 coming very soon. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ben Hall Sent: Tuesday, June 10, 2008 3:49 PM To: Discussion of IronPython Subject: [IronPython] System, Version 2.0.5.0 Hello, I have just downloaded and upgraded my WinForms application to use the latest Dynamic Languages for Silverlight Beta 2. I think I must be confused, but the two DLR assemblies (Microsoft.Scripting.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 and Microsoft.Scripting, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) both reference System, Version 2.0.5.0 - the one shipped with Silverlight and not System, Version 2.0.0.0 as shipped with IronPython Beta 2. I expected the DLR assemblies to work in both WinForms and Silverlight. As such, when I try and execute IronPython code, I get the following exception. Unhandled Exception System.IO.FileNotFoundException: Could not load file or assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified. File name: 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' at IronPython.Compiler.Parser.Reset(SourceUnit sourceUnit, PythonLanguageFeatures languageFeatures) at IronPython.Compiler.Parser..ctor(Tokenizer tokenizer, ErrorSink errorSink, ParserSink parserSink, PythonLanguageFeatures languageFeatures) at IronPython.Compiler.Parser.CreateParser(CompilerContext context, PythonEngineOptions options, Boolean verbatim) at IronPython.Compiler.Parser.CreateParser(CompilerContext context, PythonEngineOptions options) at IronPython.Runtime.PythonContext.ParseSourceCode(CompilerContext context) at Microsoft.Scripting.SourceUnit.Parse(CompilerOptions options, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Compile(CompilerOptions options, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.Execute(Scope scope) at Microsoft.Scripting.Hosting.ScriptScope.Execute(String code) at DLRHost.Engine.ScriptExecutor.ExecuteStatement(String code) in E:\Source Control\DLRHost\trunk\src\DLRHost.Engine\ScriptExecutor.cs:line 33 If someone could explain this to me, that would be great! Thanks Ben Blog.BenHall.me.uk _______________________________________________ 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 ben2004uk at googlemail.com Wed Jun 11 10:23:37 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Wed, 11 Jun 2008 09:23:37 +0100 Subject: [IronPython] System, Version 2.0.5.0 In-Reply-To: <676F9CCC1D1D3242BE4B133746E3807E49AA1C@XARA.cubido.linz> References: <676F9CCC1D1D3242BE4B133746E3807E49AA1C@XARA.cubido.linz> Message-ID: Not at the moment. Sounds like Beta 3 will be the next package, hopefully IronRuby will be packaged at the same time (I have requested a set of binaries already). To get this Dynamic silverlight package to compile for the desktop, what you need to do is this: 1) Add a new build configuration. 2) For each project in the properties, you need to remove the SILVERLIGHT compile flag (done on the Build tab of the properties). 3) Update all the references for the .Net 2.0 assemblies (mscorlib, system) to use .Net 2.0.0.0 and not Silverlight. When you compile, the code has special checks to see if the SILVERLIGHT flag has been set, if it hasn't (because we removed it on the properties) then that code isn't compiled into the release. As such, it will work on the desktop. This step should have been done for us in Beta 3 so we can just compile the code for desktop\silverlight based on our requirements. Hope this makes sense, Ben On Wed, Jun 11, 2008 at 5:51 AM, Rainer Worbis wrote: > Hallo, > > > Is there an 'easy' to use package which includes IronPython, Ruby and JScript for use with desktop applications - or an documentation how to compile these things from an silverlight distributation? > > Rainer > > > > -----Urspr?ngliche Nachricht----- > Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Srivatsn Narayanan > Gesendet: Mittwoch, 11. Juni 2008 00:54 > An: Discussion of IronPython > Betreff: Re: [IronPython] System, Version 2.0.5.0 > > The DSL package has the languages and DLR sources compiled against the silverlight CLR. The sources need to be compiled against the desktop CLR for it to work with 2.0.0.0. For the latest desktop IronPython you'd need to wait for IronPython beta 3 coming very soon. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ben Hall > Sent: Tuesday, June 10, 2008 3:49 PM > To: Discussion of IronPython > Subject: [IronPython] System, Version 2.0.5.0 > > Hello, > > I have just downloaded and upgraded my WinForms application to use the > latest Dynamic Languages for Silverlight Beta 2. I think I must be > confused, but the two DLR assemblies (Microsoft.Scripting.Core, > Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 and > Microsoft.Scripting, Version=2.0.5.0, Culture=neutral, > PublicKeyToken=31bf3856ad364e35) both reference System, Version > 2.0.5.0 - the one shipped with Silverlight and not System, Version > 2.0.0.0 as shipped with IronPython Beta 2. > > I expected the DLR assemblies to work in both WinForms and Silverlight. > > As such, when I try and execute IronPython code, I get the following exception. > > Unhandled Exception System.IO.FileNotFoundException: Could not load > file or assembly 'System, Version=2.0.5.0, Culture=neutral, > PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The > system cannot find the file specified. > File name: 'System, Version=2.0.5.0, Culture=neutral, > PublicKeyToken=7cec85d7bea7798e' > at IronPython.Compiler.Parser.Reset(SourceUnit sourceUnit, > PythonLanguageFeatures languageFeatures) > at IronPython.Compiler.Parser..ctor(Tokenizer tokenizer, ErrorSink > errorSink, ParserSink parserSink, PythonLanguageFeatures > languageFeatures) > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > PythonEngineOptions options, Boolean verbatim) > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > PythonEngineOptions options) > at IronPython.Runtime.PythonContext.ParseSourceCode(CompilerContext context) > at Microsoft.Scripting.SourceUnit.Parse(CompilerOptions options, > ErrorSink errorSink) > at Microsoft.Scripting.SourceUnit.Compile(CompilerOptions options, > ErrorSink errorSink) > at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) > at Microsoft.Scripting.SourceUnit.Execute(Scope scope) > at Microsoft.Scripting.Hosting.ScriptScope.Execute(String code) > at DLRHost.Engine.ScriptExecutor.ExecuteStatement(String code) in > E:\Source Control\DLRHost\trunk\src\DLRHost.Engine\ScriptExecutor.cs:line > 33 > > If someone could explain this to me, that would be great! > > Thanks > > Ben > Blog.BenHall.me.uk > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From ivan at flanders.co.nz Wed Jun 11 10:43:44 2008 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Wed, 11 Jun 2008 20:43:44 +1200 Subject: [IronPython] System, Version 2.0.5.0 In-Reply-To: <676F9CCC1D1D3242BE4B133746E3807E49AA1C@XARA.cubido.linz> References: <676F9CCC1D1D3242BE4B133746E3807E49AA1C@XARA.cubido.linz> Message-ID: Hi you can also download the source code of http://www.codeplex.com/dynamicscriptcontrol And in that zip you'll find the compiled binaries. Cheers Ivan On Wed, Jun 11, 2008 at 4:51 PM, Rainer Worbis wrote: > Hallo, > > > Is there an 'easy' to use package which includes IronPython, Ruby and > JScript for use with desktop applications - or an documentation how to > compile these things from an silverlight distributation? > > Rainer > > > > -----Urspr?ngliche Nachricht----- > Von: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] Im Auftrag von Srivatsn Narayanan > Gesendet: Mittwoch, 11. Juni 2008 00:54 > An: Discussion of IronPython > Betreff: Re: [IronPython] System, Version 2.0.5.0 > > The DSL package has the languages and DLR sources compiled against the > silverlight CLR. The sources need to be compiled against the desktop CLR for > it to work with 2.0.0.0. For the latest desktop IronPython you'd need to > wait for IronPython beta 3 coming very soon. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Ben Hall > Sent: Tuesday, June 10, 2008 3:49 PM > To: Discussion of IronPython > Subject: [IronPython] System, Version 2.0.5.0 > > Hello, > > I have just downloaded and upgraded my WinForms application to use the > latest Dynamic Languages for Silverlight Beta 2. I think I must be > confused, but the two DLR assemblies (Microsoft.Scripting.Core, > Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 and > Microsoft.Scripting, Version=2.0.5.0, Culture=neutral, > PublicKeyToken=31bf3856ad364e35) both reference System, Version > 2.0.5.0 - the one shipped with Silverlight and not System, Version > 2.0.0.0 as shipped with IronPython Beta 2. > > I expected the DLR assemblies to work in both WinForms and Silverlight. > > As such, when I try and execute IronPython code, I get the following > exception. > > Unhandled Exception System.IO.FileNotFoundException: Could not load > file or assembly 'System, Version=2.0.5.0, Culture=neutral, > PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The > system cannot find the file specified. > File name: 'System, Version=2.0.5.0, Culture=neutral, > PublicKeyToken=7cec85d7bea7798e' > at IronPython.Compiler.Parser.Reset(SourceUnit sourceUnit, > PythonLanguageFeatures languageFeatures) > at IronPython.Compiler.Parser..ctor(Tokenizer tokenizer, ErrorSink > errorSink, ParserSink parserSink, PythonLanguageFeatures > languageFeatures) > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > PythonEngineOptions options, Boolean verbatim) > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > PythonEngineOptions options) > at IronPython.Runtime.PythonContext.ParseSourceCode(CompilerContext > context) > at Microsoft.Scripting.SourceUnit.Parse(CompilerOptions options, > ErrorSink errorSink) > at Microsoft.Scripting.SourceUnit.Compile(CompilerOptions options, > ErrorSink errorSink) > at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink > errorSink) > at Microsoft.Scripting.SourceUnit.Execute(Scope scope) > at Microsoft.Scripting.Hosting.ScriptScope.Execute(String code) > at DLRHost.Engine.ScriptExecutor.ExecuteStatement(String code) in > E:\Source Control\DLRHost\trunk\src\DLRHost.Engine\ScriptExecutor.cs:line > 33 > > If someone could explain this to me, that would be great! > > Thanks > > Ben > Blog.BenHall.me.uk > _______________________________________________ > 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 r.worbis at cubido.at Wed Jun 11 10:49:21 2008 From: r.worbis at cubido.at (Rainer Worbis) Date: Wed, 11 Jun 2008 10:49:21 +0200 Subject: [IronPython] System, Version 2.0.5.0 In-Reply-To: References: <676F9CCC1D1D3242BE4B133746E3807E49AA1C@XARA.cubido.linz> Message-ID: <676F9CCC1D1D3242BE4B133746E3807E49AA3E@XARA.cubido.linz> Thank you, I will try that. Is there any chance to integrate a version of JScript into these Libraries? Rainer -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Ben Hall Gesendet: Mittwoch, 11. Juni 2008 10:24 An: Discussion of IronPython Betreff: Re: [IronPython] System, Version 2.0.5.0 Not at the moment. Sounds like Beta 3 will be the next package, hopefully IronRuby will be packaged at the same time (I have requested a set of binaries already). To get this Dynamic silverlight package to compile for the desktop, what you need to do is this: 1) Add a new build configuration. 2) For each project in the properties, you need to remove the SILVERLIGHT compile flag (done on the Build tab of the properties). 3) Update all the references for the .Net 2.0 assemblies (mscorlib, system) to use .Net 2.0.0.0 and not Silverlight. When you compile, the code has special checks to see if the SILVERLIGHT flag has been set, if it hasn't (because we removed it on the properties) then that code isn't compiled into the release. As such, it will work on the desktop. This step should have been done for us in Beta 3 so we can just compile the code for desktop\silverlight based on our requirements. Hope this makes sense, Ben On Wed, Jun 11, 2008 at 5:51 AM, Rainer Worbis wrote: > Hallo, > > > Is there an 'easy' to use package which includes IronPython, Ruby and JScript for use with desktop applications - or an documentation how to compile these things from an silverlight distributation? > > Rainer > > > > -----Urspr?ngliche Nachricht----- > Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Srivatsn Narayanan > Gesendet: Mittwoch, 11. Juni 2008 00:54 > An: Discussion of IronPython > Betreff: Re: [IronPython] System, Version 2.0.5.0 > > The DSL package has the languages and DLR sources compiled against the silverlight CLR. The sources need to be compiled against the desktop CLR for it to work with 2.0.0.0. For the latest desktop IronPython you'd need to wait for IronPython beta 3 coming very soon. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ben Hall > Sent: Tuesday, June 10, 2008 3:49 PM > To: Discussion of IronPython > Subject: [IronPython] System, Version 2.0.5.0 > > Hello, > > I have just downloaded and upgraded my WinForms application to use the > latest Dynamic Languages for Silverlight Beta 2. I think I must be > confused, but the two DLR assemblies (Microsoft.Scripting.Core, > Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 and > Microsoft.Scripting, Version=2.0.5.0, Culture=neutral, > PublicKeyToken=31bf3856ad364e35) both reference System, Version > 2.0.5.0 - the one shipped with Silverlight and not System, Version > 2.0.0.0 as shipped with IronPython Beta 2. > > I expected the DLR assemblies to work in both WinForms and Silverlight. > > As such, when I try and execute IronPython code, I get the following exception. > > Unhandled Exception System.IO.FileNotFoundException: Could not load > file or assembly 'System, Version=2.0.5.0, Culture=neutral, > PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The > system cannot find the file specified. > File name: 'System, Version=2.0.5.0, Culture=neutral, > PublicKeyToken=7cec85d7bea7798e' > at IronPython.Compiler.Parser.Reset(SourceUnit sourceUnit, > PythonLanguageFeatures languageFeatures) > at IronPython.Compiler.Parser..ctor(Tokenizer tokenizer, ErrorSink > errorSink, ParserSink parserSink, PythonLanguageFeatures > languageFeatures) > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > PythonEngineOptions options, Boolean verbatim) > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > PythonEngineOptions options) > at IronPython.Runtime.PythonContext.ParseSourceCode(CompilerContext context) > at Microsoft.Scripting.SourceUnit.Parse(CompilerOptions options, > ErrorSink errorSink) > at Microsoft.Scripting.SourceUnit.Compile(CompilerOptions options, > ErrorSink errorSink) > at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) > at Microsoft.Scripting.SourceUnit.Execute(Scope scope) > at Microsoft.Scripting.Hosting.ScriptScope.Execute(String code) > at DLRHost.Engine.ScriptExecutor.ExecuteStatement(String code) in > E:\Source Control\DLRHost\trunk\src\DLRHost.Engine\ScriptExecutor.cs:line > 33 > > If someone could explain this to me, that would be great! > > Thanks > > Ben > Blog.BenHall.me.uk > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ivan at flanders.co.nz Wed Jun 11 10:59:31 2008 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Wed, 11 Jun 2008 20:59:31 +1200 Subject: [IronPython] System, Version 2.0.5.0 In-Reply-To: <676F9CCC1D1D3242BE4B133746E3807E49AA3E@XARA.cubido.linz> References: <676F9CCC1D1D3242BE4B133746E3807E49AA1C@XARA.cubido.linz> <676F9CCC1D1D3242BE4B133746E3807E49AA3E@XARA.cubido.linz> Message-ID: Well as it so happens I dont' know ;) I'd ask the MS guys if they want to flick me the source but i'm guessing that's very unlikely to happen. Perhaps somebody from MS could do us a compile of those things? Cheers Ivan On Wed, Jun 11, 2008 at 8:49 PM, Rainer Worbis wrote: > Thank you, I will try that. Is there any chance to integrate a version of > JScript into these Libraries? > > Rainer > > -----Urspr?ngliche Nachricht----- > Von: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] Im Auftrag von Ben Hall > Gesendet: Mittwoch, 11. Juni 2008 10:24 > An: Discussion of IronPython > Betreff: Re: [IronPython] System, Version 2.0.5.0 > > Not at the moment. Sounds like Beta 3 will be the next package, > hopefully IronRuby will be packaged at the same time (I have requested > a set of binaries already). > > To get this Dynamic silverlight package to compile for the desktop, > what you need to do is this: > 1) Add a new build configuration. > 2) For each project in the properties, you need to remove the > SILVERLIGHT compile flag (done on the Build tab of the properties). > 3) Update all the references for the .Net 2.0 assemblies (mscorlib, > system) to use .Net 2.0.0.0 and not Silverlight. > > When you compile, the code has special checks to see if the > SILVERLIGHT flag has been set, if it hasn't (because we removed it on > the properties) then that code isn't compiled into the release. As > such, it will work on the desktop. > > This step should have been done for us in Beta 3 so we can just > compile the code for desktop\silverlight based on our requirements. > > Hope this makes sense, > > Ben > > > On Wed, Jun 11, 2008 at 5:51 AM, Rainer Worbis wrote: > > Hallo, > > > > > > Is there an 'easy' to use package which includes IronPython, Ruby and > JScript for use with desktop applications - or an documentation how to > compile these things from an silverlight distributation? > > > > Rainer > > > > > > > > -----Urspr?ngliche Nachricht----- > > Von: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] Im Auftrag von Srivatsn Narayanan > > Gesendet: Mittwoch, 11. Juni 2008 00:54 > > An: Discussion of IronPython > > Betreff: Re: [IronPython] System, Version 2.0.5.0 > > > > The DSL package has the languages and DLR sources compiled against the > silverlight CLR. The sources need to be compiled against the desktop CLR for > it to work with 2.0.0.0. For the latest desktop IronPython you'd need to > wait for IronPython beta 3 coming very soon. > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Ben Hall > > Sent: Tuesday, June 10, 2008 3:49 PM > > To: Discussion of IronPython > > Subject: [IronPython] System, Version 2.0.5.0 > > > > Hello, > > > > I have just downloaded and upgraded my WinForms application to use the > > latest Dynamic Languages for Silverlight Beta 2. I think I must be > > confused, but the two DLR assemblies (Microsoft.Scripting.Core, > > Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 and > > Microsoft.Scripting, Version=2.0.5.0, Culture=neutral, > > PublicKeyToken=31bf3856ad364e35) both reference System, Version > > 2.0.5.0 - the one shipped with Silverlight and not System, Version > > 2.0.0.0 as shipped with IronPython Beta 2. > > > > I expected the DLR assemblies to work in both WinForms and Silverlight. > > > > As such, when I try and execute IronPython code, I get the following > exception. > > > > Unhandled Exception System.IO.FileNotFoundException: Could not load > > file or assembly 'System, Version=2.0.5.0, Culture=neutral, > > PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The > > system cannot find the file specified. > > File name: 'System, Version=2.0.5.0, Culture=neutral, > > PublicKeyToken=7cec85d7bea7798e' > > at IronPython.Compiler.Parser.Reset(SourceUnit sourceUnit, > > PythonLanguageFeatures languageFeatures) > > at IronPython.Compiler.Parser..ctor(Tokenizer tokenizer, ErrorSink > > errorSink, ParserSink parserSink, PythonLanguageFeatures > > languageFeatures) > > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > > PythonEngineOptions options, Boolean verbatim) > > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > > PythonEngineOptions options) > > at IronPython.Runtime.PythonContext.ParseSourceCode(CompilerContext > context) > > at Microsoft.Scripting.SourceUnit.Parse(CompilerOptions options, > > ErrorSink errorSink) > > at Microsoft.Scripting.SourceUnit.Compile(CompilerOptions options, > > ErrorSink errorSink) > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink > errorSink) > > at Microsoft.Scripting.SourceUnit.Execute(Scope scope) > > at Microsoft.Scripting.Hosting.ScriptScope.Execute(String code) > > at DLRHost.Engine.ScriptExecutor.ExecuteStatement(String code) in > > E:\Source Control\DLRHost\trunk\src\DLRHost.Engine\ScriptExecutor.cs:line > > 33 > > > > If someone could explain this to me, that would be great! > > > > Thanks > > > > Ben > > Blog.BenHall.me.uk > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > 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 helmut.orian at schema.de Wed Jun 11 13:05:40 2008 From: helmut.orian at schema.de (Orian, Helmut) Date: Wed, 11 Jun 2008 13:05:40 +0200 Subject: [IronPython] Hosting API and PlatformAdaptationLayer In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC40720D@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC40720D@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: hi Jimmy, yes, makes a lot of sense to me :-) already had my own classes derived from PAL and ScriptHost. i have just overseen the ScriptRuntimeSetup and its HostType property to register them. works now for me. Thanks, Helmut -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Jimmy Schementi Gesendet: Dienstag, 10. Juni 2008 21:59 An: Discussion of IronPython Betreff: Re: [IronPython] Hosting API and PlatformAdaptationLayer The public API to do this is ScriptRuntimeSetup.HostType; an example of using this is in Silverlight. Take a look at Microsoft.Scripting.Silverlight/BrowserPAL.cs and Microsoft.Scripting.Silverlight/BrowserScriptHost.cs. Here's the basics: class YourPAL : PlatforAdaptationLayer { static readonly YourPAL PAL = new YourPAL(); ... } class YourScriptHost : ScriptHost { ... public override PlatformAdaptationLayer PlatformAdaptationLayer { get { return YourPAL.PAL; } } } // In code that hosts the DLR: ScriptRuntimeSetup setup = new ScriptRuntimeSetup(true) setup.HostType = typeof(YourScriptHost) ScriptRuntime runtime = ScriptRuntime.Create(setup) ... Make sense? ~Jimmy > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Orian, Helmut > Sent: Tuesday, June 10, 2008 4:00 AM > To: users at lists.ironpython.com > Subject: [IronPython] Hosting API and PlatformAdaptationLayer > > At the moment I am hosting IronPython and IronRuby using the sources > from the Silverlight2beta1 SDK which I recompiled to work against .NET > 2.0 because it is the latest build of the DLR I found where both > projects work with a common Microsoft.Scripting.dll. > > We have a client-server architecture and all our config-files and > other script language files (like xsl and some own languages :-) are > stored and versioned in our central application server instead of a harddisk. > > For the initial python script I want to execute this was no problem, > but to get the import statement of python ('require' in ruby) to work > I implemented a class deriving from > Microsoft.Scripting.PlatformAdaptationLayer. This implementation > worked perfectly for me, but I have not found a way to bootstrap > ScriptRuntime and ScriptHost with my implementation by using the > current public API in Microsoft.Scripting. > > I had to use an own implementation derived from ScriptHost to inject > my derived PlatformAdaptationLayer instance with (ugly) reflection > into the ScriptRuntime. > > It would be nice if I could set/use my derived PlatformAdaptationLayer > instance by public API. > > > Thanks, > Helmut > > > ---------------------------------------------------------------------- > - > ---- > > An- und Abmeldung zur SCHEMA Mailingliste unter > http://www.schema.de/mail > > ---------------------------------------------------------------------- > - > ---- > > > _______________________________________________ > 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 curt at hagenlocher.org Wed Jun 11 14:07:17 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 11 Jun 2008 05:07:17 -0700 Subject: [IronPython] System, Version 2.0.5.0 In-Reply-To: References: <676F9CCC1D1D3242BE4B133746E3807E49AA1C@XARA.cubido.linz> <676F9CCC1D1D3242BE4B133746E3807E49AA3E@XARA.cubido.linz> Message-ID: Right now, the Javascript engine is "Silverlight only", I'm afraid. It's my understanding that this isn't a final decision, but I don't know what (or who) is driving it. I'll try to find out if there's any place you can register your interest in getting a version for the full CLR. On Wed, Jun 11, 2008 at 1:59 AM, Ivan Porto Carrero wrote: > Well as it so happens I dont' know ;) > > I'd ask the MS guys if they want to flick me the source but i'm guessing > that's very unlikely to happen. Perhaps somebody from MS could do us a > compile of those things? > > Cheers > Ivan > > > On Wed, Jun 11, 2008 at 8:49 PM, Rainer Worbis wrote: > >> Thank you, I will try that. Is there any chance to integrate a version of >> JScript into these Libraries? >> >> Rainer >> >> -----Urspr?ngliche Nachricht----- >> Von: users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] Im Auftrag von Ben Hall >> Gesendet: Mittwoch, 11. Juni 2008 10:24 >> An: Discussion of IronPython >> Betreff: Re: [IronPython] System, Version 2.0.5.0 >> >> Not at the moment. Sounds like Beta 3 will be the next package, >> hopefully IronRuby will be packaged at the same time (I have requested >> a set of binaries already). >> >> To get this Dynamic silverlight package to compile for the desktop, >> what you need to do is this: >> 1) Add a new build configuration. >> 2) For each project in the properties, you need to remove the >> SILVERLIGHT compile flag (done on the Build tab of the properties). >> 3) Update all the references for the .Net 2.0 assemblies (mscorlib, >> system) to use .Net 2.0.0.0 and not Silverlight. >> >> When you compile, the code has special checks to see if the >> SILVERLIGHT flag has been set, if it hasn't (because we removed it on >> the properties) then that code isn't compiled into the release. As >> such, it will work on the desktop. >> >> This step should have been done for us in Beta 3 so we can just >> compile the code for desktop\silverlight based on our requirements. >> >> Hope this makes sense, >> >> Ben >> >> >> On Wed, Jun 11, 2008 at 5:51 AM, Rainer Worbis >> wrote: >> > Hallo, >> > >> > >> > Is there an 'easy' to use package which includes IronPython, Ruby and >> JScript for use with desktop applications - or an documentation how to >> compile these things from an silverlight distributation? >> > >> > Rainer >> > >> > >> > >> > -----Urspr?ngliche Nachricht----- >> > Von: users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] Im Auftrag von Srivatsn Narayanan >> > Gesendet: Mittwoch, 11. Juni 2008 00:54 >> > An: Discussion of IronPython >> > Betreff: Re: [IronPython] System, Version 2.0.5.0 >> > >> > The DSL package has the languages and DLR sources compiled against the >> silverlight CLR. The sources need to be compiled against the desktop CLR for >> it to work with 2.0.0.0. For the latest desktop IronPython you'd need to >> wait for IronPython beta 3 coming very soon. >> > >> > -----Original Message----- >> > From: users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] On Behalf Of Ben Hall >> > Sent: Tuesday, June 10, 2008 3:49 PM >> > To: Discussion of IronPython >> > Subject: [IronPython] System, Version 2.0.5.0 >> > >> > Hello, >> > >> > I have just downloaded and upgraded my WinForms application to use the >> > latest Dynamic Languages for Silverlight Beta 2. I think I must be >> > confused, but the two DLR assemblies (Microsoft.Scripting.Core, >> > Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 and >> > Microsoft.Scripting, Version=2.0.5.0, Culture=neutral, >> > PublicKeyToken=31bf3856ad364e35) both reference System, Version >> > 2.0.5.0 - the one shipped with Silverlight and not System, Version >> > 2.0.0.0 as shipped with IronPython Beta 2. >> > >> > I expected the DLR assemblies to work in both WinForms and Silverlight. >> > >> > As such, when I try and execute IronPython code, I get the following >> exception. >> > >> > Unhandled Exception System.IO.FileNotFoundException: Could not load >> > file or assembly 'System, Version=2.0.5.0, Culture=neutral, >> > PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The >> > system cannot find the file specified. >> > File name: 'System, Version=2.0.5.0, Culture=neutral, >> > PublicKeyToken=7cec85d7bea7798e' >> > at IronPython.Compiler.Parser.Reset(SourceUnit sourceUnit, >> > PythonLanguageFeatures languageFeatures) >> > at IronPython.Compiler.Parser..ctor(Tokenizer tokenizer, ErrorSink >> > errorSink, ParserSink parserSink, PythonLanguageFeatures >> > languageFeatures) >> > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, >> > PythonEngineOptions options, Boolean verbatim) >> > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, >> > PythonEngineOptions options) >> > at IronPython.Runtime.PythonContext.ParseSourceCode(CompilerContext >> context) >> > at Microsoft.Scripting.SourceUnit.Parse(CompilerOptions options, >> > ErrorSink errorSink) >> > at Microsoft.Scripting.SourceUnit.Compile(CompilerOptions options, >> > ErrorSink errorSink) >> > at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink >> errorSink) >> > at Microsoft.Scripting.SourceUnit.Execute(Scope scope) >> > at Microsoft.Scripting.Hosting.ScriptScope.Execute(String code) >> > at DLRHost.Engine.ScriptExecutor.ExecuteStatement(String code) in >> > E:\Source >> Control\DLRHost\trunk\src\DLRHost.Engine\ScriptExecutor.cs:line >> > 33 >> > >> > If someone could explain this to me, that would be great! >> > >> > Thanks >> > >> > Ben >> > Blog.BenHall.me.uk >> > _______________________________________________ >> > Users mailing list >> > Users at lists.ironpython.com >> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > >> > _______________________________________________ >> > Users mailing list >> > Users at lists.ironpython.com >> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > _______________________________________________ >> > Users mailing list >> > Users at lists.ironpython.com >> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> 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 helmut.orian at schema.de Wed Jun 11 15:09:07 2008 From: helmut.orian at schema.de (Orian, Helmut) Date: Wed, 11 Jun 2008 15:09:07 +0200 Subject: [IronPython] Trouble calling a method on a .NET object Message-ID: I'm having trouble calling a method on one of my .NET objects. if you compile the following repro into a "test.dll": namespace Test { public interface ISomeInterface { string Greet(); } public abstract class Base {} public static class SomeFactory { public static object Get() { return new Concrete(); } } internal class Concrete : Base, ISomeInterface { public string Greet() { return "Hello world!"; } } } and try to use them: >>> import clr >>> clr.AddReference("test") >>> from Test import * >>> o = SomeFactory.Get() >>> print("Greet" in dir(o)) True >>> print(o.Greet()) Traceback (most recent call last): File "", line 1, in TypeError: expected ISomeInterface, got Base To me it looks like a bug regarding collection of polymorphic information on .NET types; or am I missing something? Thanks, Helmut --------------------------------------------------------------------------- An- und Abmeldung zur SCHEMA Mailingliste unter http://www.schema.de/mail --------------------------------------------------------------------------- From Jimmy.Schementi at microsoft.com Wed Jun 11 16:43:15 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 11 Jun 2008 07:43:15 -0700 Subject: [IronPython] System, Version 2.0.5.0 In-Reply-To: References: <676F9CCC1D1D3242BE4B133746E3807E49AA1C@XARA.cubido.linz> <676F9CCC1D1D3242BE4B133746E3807E49AA3E@XARA.cubido.linz> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC4B65F8@NA-EXMSG-C116.redmond.corp.microsoft.com> Yeah, the JScript story is kinda confusing ... I know. It was already included with the ASP.NET Futures release in 2007 (http://www.asp.net/Downloads/futures/), but only Silverlight since. Let me talk with the JScript guys to see what they think about spinning up more current desktop builds. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Wednesday, June 11, 2008 5:07 AM To: Discussion of IronPython Subject: Re: [IronPython] System, Version 2.0.5.0 Right now, the Javascript engine is "Silverlight only", I'm afraid. It's my understanding that this isn't a final decision, but I don't know what (or who) is driving it. I'll try to find out if there's any place you can register your interest in getting a version for the full CLR. On Wed, Jun 11, 2008 at 1:59 AM, Ivan Porto Carrero > wrote: Well as it so happens I dont' know ;) I'd ask the MS guys if they want to flick me the source but i'm guessing that's very unlikely to happen. Perhaps somebody from MS could do us a compile of those things? Cheers Ivan On Wed, Jun 11, 2008 at 8:49 PM, Rainer Worbis > wrote: Thank you, I will try that. Is there any chance to integrate a version of JScript into these Libraries? Rainer -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Ben Hall Gesendet: Mittwoch, 11. Juni 2008 10:24 An: Discussion of IronPython Betreff: Re: [IronPython] System, Version 2.0.5.0 Not at the moment. Sounds like Beta 3 will be the next package, hopefully IronRuby will be packaged at the same time (I have requested a set of binaries already). To get this Dynamic silverlight package to compile for the desktop, what you need to do is this: 1) Add a new build configuration. 2) For each project in the properties, you need to remove the SILVERLIGHT compile flag (done on the Build tab of the properties). 3) Update all the references for the .Net 2.0 assemblies (mscorlib, system) to use .Net 2.0.0.0 and not Silverlight. When you compile, the code has special checks to see if the SILVERLIGHT flag has been set, if it hasn't (because we removed it on the properties) then that code isn't compiled into the release. As such, it will work on the desktop. This step should have been done for us in Beta 3 so we can just compile the code for desktop\silverlight based on our requirements. Hope this makes sense, Ben On Wed, Jun 11, 2008 at 5:51 AM, Rainer Worbis > wrote: > Hallo, > > > Is there an 'easy' to use package which includes IronPython, Ruby and JScript for use with desktop applications - or an documentation how to compile these things from an silverlight distributation? > > Rainer > > > > -----Urspr?ngliche Nachricht----- > Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Srivatsn Narayanan > Gesendet: Mittwoch, 11. Juni 2008 00:54 > An: Discussion of IronPython > Betreff: Re: [IronPython] System, Version 2.0.5.0 > > The DSL package has the languages and DLR sources compiled against the silverlight CLR. The sources need to be compiled against the desktop CLR for it to work with 2.0.0.0. For the latest desktop IronPython you'd need to wait for IronPython beta 3 coming very soon. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ben Hall > Sent: Tuesday, June 10, 2008 3:49 PM > To: Discussion of IronPython > Subject: [IronPython] System, Version 2.0.5.0 > > Hello, > > I have just downloaded and upgraded my WinForms application to use the > latest Dynamic Languages for Silverlight Beta 2. I think I must be > confused, but the two DLR assemblies (Microsoft.Scripting.Core, > Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 and > Microsoft.Scripting, Version=2.0.5.0, Culture=neutral, > PublicKeyToken=31bf3856ad364e35) both reference System, Version > 2.0.5.0 - the one shipped with Silverlight and not System, Version > 2.0.0.0 as shipped with IronPython Beta 2. > > I expected the DLR assemblies to work in both WinForms and Silverlight. > > As such, when I try and execute IronPython code, I get the following exception. > > Unhandled Exception System.IO.FileNotFoundException: Could not load > file or assembly 'System, Version=2.0.5.0, Culture=neutral, > PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The > system cannot find the file specified. > File name: 'System, Version=2.0.5.0, Culture=neutral, > PublicKeyToken=7cec85d7bea7798e' > at IronPython.Compiler.Parser.Reset(SourceUnit sourceUnit, > PythonLanguageFeatures languageFeatures) > at IronPython.Compiler.Parser..ctor(Tokenizer tokenizer, ErrorSink > errorSink, ParserSink parserSink, PythonLanguageFeatures > languageFeatures) > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > PythonEngineOptions options, Boolean verbatim) > at IronPython.Compiler.Parser.CreateParser(CompilerContext context, > PythonEngineOptions options) > at IronPython.Runtime.PythonContext.ParseSourceCode(CompilerContext context) > at Microsoft.Scripting.SourceUnit.Parse(CompilerOptions options, > ErrorSink errorSink) > at Microsoft.Scripting.SourceUnit.Compile(CompilerOptions options, > ErrorSink errorSink) > at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) > at Microsoft.Scripting.SourceUnit.Execute(Scope scope) > at Microsoft.Scripting.Hosting.ScriptScope.Execute(String code) > at DLRHost.Engine.ScriptExecutor.ExecuteStatement(String code) in > E:\Source Control\DLRHost\trunk\src\DLRHost.Engine\ScriptExecutor.cs:line > 33 > > If someone could explain this to me, that would be great! > > Thanks > > Ben > Blog.BenHall.me.uk > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ 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 curt at hagenlocher.org Wed Jun 11 18:35:11 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 11 Jun 2008 09:35:11 -0700 Subject: [IronPython] Trouble calling a method on a .NET object In-Reply-To: References: Message-ID: Your code works as expected if you make the "Concrete" class public instead of internal. Please file this as an issue on CodePlex at http://www.codeplex.com/IronPython On Wed, Jun 11, 2008 at 6:09 AM, Orian, Helmut wrote: > I'm having trouble calling a method on one of my .NET objects. > > if you compile the following repro into a "test.dll": > > > namespace Test { > public interface ISomeInterface { > string Greet(); > } > > public abstract class Base {} > > public static class SomeFactory { > public static object Get() { > return new Concrete(); > } > } > > internal class Concrete : Base, ISomeInterface { > public string Greet() { > return "Hello world!"; > } > } > } > > > and try to use them: > > >>> import clr > >>> clr.AddReference("test") > >>> from Test import * > >>> o = SomeFactory.Get() > >>> print("Greet" in dir(o)) > True > >>> print(o.Greet()) > > Traceback (most recent call last): > File "", line 1, in > TypeError: expected ISomeInterface, got Base > > > To me it looks like a bug regarding collection of polymorphic > information on .NET types; > or am I missing something? > > > Thanks, > Helmut > > > > --------------------------------------------------------------------------- > > An- und Abmeldung zur SCHEMA Mailingliste unter http://www.schema.de/mail > > --------------------------------------------------------------------------- > > > _______________________________________________ > 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 brosembob at yahoo.com Wed Jun 11 19:24:59 2008 From: brosembob at yahoo.com (Bob Rosembob) Date: Wed, 11 Jun 2008 10:24:59 -0700 (PDT) Subject: [IronPython] Talk to Python script from C# app... Message-ID: <28351.58859.qm@web35506.mail.mud.yahoo.com> Hello there, I have a C# application and a 3rd party Python script that the application should run. The script is called periodical with?some arguments,?performs some calculations and returns the results.?I'm running Vista &?VS2005. ? What should I do to run the script from my application? I assume I need to install IronPython on my PC. How exactly should I do it? ? Thanks for your help. ? Bob -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Wed Jun 11 19:29:27 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 11 Jun 2008 18:29:27 +0100 Subject: [IronPython] Talk to Python script from C# app... In-Reply-To: <28351.58859.qm@web35506.mail.mud.yahoo.com> References: <28351.58859.qm@web35506.mail.mud.yahoo.com> Message-ID: <48500B77.10407@voidspace.org.uk> Hello Bob, The question is, do you want to run it in the same way you would launch any command line application from C# and collect the results from standard out - or do you want to embed IronPython and run the script 'inside' your application? If the former then you can use System.Process to launch the script with IronPython. You will need to download (rather than install) and launch the script with 'ipy.exe args...'. If the latter then how you do it depends on whether you use IronPython 1 or 2 and what exactly your use case is. Michael Foord http://www.ironpythoninaction.com/ Bob Rosembob wrote: > Hello there, > I have a C# application and a 3rd party Python script that the > application should run. The script is called periodical with some > arguments, performs some calculations and returns the results. I'm > running Vista & VS2005. > > What should I do to run the script from my application? I assume I > need to install IronPython on my PC. How exactly should I do it? > > Thanks for your help. > > Bob > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From ben2004uk at googlemail.com Wed Jun 11 21:23:50 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Wed, 11 Jun 2008 20:23:50 +0100 Subject: [IronPython] ScriptEngine.GetRegisteredExtensions() Message-ID: Hi, I have been using the latest release of the DLR (the one from yesterday) but the behaviour of GetRegisteredExtensions() seems to have changed (or is broke). I've got this test: [Test] public void GetSaveFilter_RegisteredTypes_String() { string expected = "IronPython 2.0 Beta|*.py"; LanguageSettings python = Helper.CreateIronPythonSettings(); DLREngineFactory factory = new DLREngineFactory(); ScriptEngine engine = factory.CreateEngine(python); EngineInformation info = new EngineInformation(engine); string actual = info.GetSaveFilter(); Assert.AreEqual(expected, actual); } With IP Beta 2, this worked fine, but since upgrading it now fails. The code is this: public string GetSaveFilter() { string filter = string.Empty; foreach (string ext in Engine.GetRegisteredExtensions()) { filter += string.Format("{0}|*{1}", Engine.LanguageDisplayName, ext); } return filter; } >From what I can tell, the code is dropping into GetRegisteredFileExtensions(LanguageContext context) which does a check to see if the LanguageContext is null, but it always seems to be null. if (kvp.Value.LanguageContext == context) { res.Add(kvp.Key); } Can anyone else confirm this? Its the same for GetRegisteredIdentifiers(). Thanks Ben Blog.BenHall.me.uk From curt at hagenlocher.org Wed Jun 11 22:22:00 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 11 Jun 2008 13:22:00 -0700 Subject: [IronPython] ScriptEngine.GetRegisteredExtensions() In-Reply-To: References: Message-ID: I can't see into any of the helpers you've defined. What do you get if you cut this down to the smallest possible program? public static void Main() { ScriptRuntime runtime = ScriptRuntime.Create(); ScriptEngine engine = runtime.GetEngine("py"); foreach (string s in engine.GetRegisteredExtensions()) { System.Console.WriteLine(s); } } On Wed, Jun 11, 2008 at 12:23 PM, Ben Hall wrote: > Hi, > > I have been using the latest release of the DLR (the one from > yesterday) but the behaviour of GetRegisteredExtensions() seems to > have changed (or is broke). > > I've got this test: > > [Test] > public void GetSaveFilter_RegisteredTypes_String() > { > string expected = "IronPython 2.0 Beta|*.py"; > LanguageSettings python = Helper.CreateIronPythonSettings(); > DLREngineFactory factory = new DLREngineFactory(); > ScriptEngine engine = factory.CreateEngine(python); > > EngineInformation info = new EngineInformation(engine); > string actual = info.GetSaveFilter(); > Assert.AreEqual(expected, actual); > } > > With IP Beta 2, this worked fine, but since upgrading it now fails. > The code is this: > > public string GetSaveFilter() > { > string filter = string.Empty; > foreach (string ext in Engine.GetRegisteredExtensions()) > { > filter += string.Format("{0}|*{1}", > Engine.LanguageDisplayName, ext); > } > > return filter; > } > > >From what I can tell, the code is dropping into > GetRegisteredFileExtensions(LanguageContext context) which does a > check to see if the LanguageContext is null, but it always seems to be > null. > if (kvp.Value.LanguageContext == context) { > res.Add(kvp.Key); > } > > Can anyone else confirm this? > > Its the same for GetRegisteredIdentifiers(). > > Thanks > > Ben > Blog.BenHall.me.uk > _______________________________________________ > 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 ben2004uk at googlemail.com Wed Jun 11 23:17:34 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Wed, 11 Jun 2008 22:17:34 +0100 Subject: [IronPython] ScriptEngine.GetRegisteredExtensions() In-Reply-To: References: Message-ID: Sorry - my code wasn't very helpful. The above code works fine, however I am creating the engine based on the type. The code demostrates the problem: ScriptRuntime runtime = ScriptRuntime.Create(); ScriptEngine engine = runtime.GetEngine(typeof(IronPython.Runtime.PythonContext)); foreach (string s in engine.GetRegisteredExtensions()) { System.Console.WriteLine(s); } Thanks Ben On Wed, Jun 11, 2008 at 9:22 PM, Curt Hagenlocher wrote: > I can't see into any of the helpers you've defined. What do you get if you > cut this down to the smallest possible program? > > public static void Main() { > ScriptRuntime runtime = ScriptRuntime.Create(); > ScriptEngine engine = runtime.GetEngine("py"); > foreach (string s in engine.GetRegisteredExtensions()) { > System.Console.WriteLine(s); > } > } > > On Wed, Jun 11, 2008 at 12:23 PM, Ben Hall wrote: >> >> Hi, >> >> I have been using the latest release of the DLR (the one from >> yesterday) but the behaviour of GetRegisteredExtensions() seems to >> have changed (or is broke). >> >> I've got this test: >> >> [Test] >> public void GetSaveFilter_RegisteredTypes_String() >> { >> string expected = "IronPython 2.0 Beta|*.py"; >> LanguageSettings python = Helper.CreateIronPythonSettings(); >> DLREngineFactory factory = new DLREngineFactory(); >> ScriptEngine engine = factory.CreateEngine(python); >> >> EngineInformation info = new EngineInformation(engine); >> string actual = info.GetSaveFilter(); >> Assert.AreEqual(expected, actual); >> } >> >> With IP Beta 2, this worked fine, but since upgrading it now fails. >> The code is this: >> >> public string GetSaveFilter() >> { >> string filter = string.Empty; >> foreach (string ext in Engine.GetRegisteredExtensions()) >> { >> filter += string.Format("{0}|*{1}", >> Engine.LanguageDisplayName, ext); >> } >> >> return filter; >> } >> >> >From what I can tell, the code is dropping into >> GetRegisteredFileExtensions(LanguageContext context) which does a >> check to see if the LanguageContext is null, but it always seems to be >> null. >> if (kvp.Value.LanguageContext == context) { >> res.Add(kvp.Key); >> } >> >> Can anyone else confirm this? >> >> Its the same for GetRegisteredIdentifiers(). >> >> Thanks >> >> Ben >> Blog.BenHall.me.uk >> _______________________________________________ >> 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 curt at hagenlocher.org Wed Jun 11 23:33:30 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 11 Jun 2008 14:33:30 -0700 Subject: [IronPython] ScriptEngine.GetRegisteredExtensions() In-Reply-To: References: Message-ID: The overload of GetEngine that you're using is slated to go away. Is there functionality you get out of doing it that way that you don't get by using the language code or file extension? On Wed, Jun 11, 2008 at 2:17 PM, Ben Hall wrote: > Sorry - my code wasn't very helpful. > > The above code works fine, however I am creating the engine based on > the type. The code demostrates the problem: > > ScriptRuntime runtime = ScriptRuntime.Create(); > ScriptEngine engine = > runtime.GetEngine(typeof(IronPython.Runtime.PythonContext)); > foreach (string s in engine.GetRegisteredExtensions()) > { > System.Console.WriteLine(s); > } > > Thanks > > Ben > > On Wed, Jun 11, 2008 at 9:22 PM, Curt Hagenlocher > wrote: > > I can't see into any of the helpers you've defined. What do you get if > you > > cut this down to the smallest possible program? > > > > public static void Main() { > > ScriptRuntime runtime = ScriptRuntime.Create(); > > ScriptEngine engine = runtime.GetEngine("py"); > > foreach (string s in engine.GetRegisteredExtensions()) { > > System.Console.WriteLine(s); > > } > > } > > > > On Wed, Jun 11, 2008 at 12:23 PM, Ben Hall > wrote: > >> > >> Hi, > >> > >> I have been using the latest release of the DLR (the one from > >> yesterday) but the behaviour of GetRegisteredExtensions() seems to > >> have changed (or is broke). > >> > >> I've got this test: > >> > >> [Test] > >> public void GetSaveFilter_RegisteredTypes_String() > >> { > >> string expected = "IronPython 2.0 Beta|*.py"; > >> LanguageSettings python = Helper.CreateIronPythonSettings(); > >> DLREngineFactory factory = new DLREngineFactory(); > >> ScriptEngine engine = factory.CreateEngine(python); > >> > >> EngineInformation info = new EngineInformation(engine); > >> string actual = info.GetSaveFilter(); > >> Assert.AreEqual(expected, actual); > >> } > >> > >> With IP Beta 2, this worked fine, but since upgrading it now fails. > >> The code is this: > >> > >> public string GetSaveFilter() > >> { > >> string filter = string.Empty; > >> foreach (string ext in Engine.GetRegisteredExtensions()) > >> { > >> filter += string.Format("{0}|*{1}", > >> Engine.LanguageDisplayName, ext); > >> } > >> > >> return filter; > >> } > >> > >> >From what I can tell, the code is dropping into > >> GetRegisteredFileExtensions(LanguageContext context) which does a > >> check to see if the LanguageContext is null, but it always seems to be > >> null. > >> if (kvp.Value.LanguageContext == context) { > >> res.Add(kvp.Key); > >> } > >> > >> Can anyone else confirm this? > >> > >> Its the same for GetRegisteredIdentifiers(). > >> > >> Thanks > >> > >> Ben > >> Blog.BenHall.me.uk > >> _______________________________________________ > >> 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 curt at hagenlocher.org Wed Jun 11 23:45:37 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 11 Jun 2008 14:45:37 -0700 Subject: [IronPython] Talk to Python script from C# app... In-Reply-To: <28351.58859.qm@web35506.mail.mud.yahoo.com> References: <28351.58859.qm@web35506.mail.mud.yahoo.com> Message-ID: In addition to the questions that Michael posed, I'd add the following: Do you know if this 3rd-party script has been tested with IronPython already? And does it use any C-based Python extensions? IronPython is awesome and everyone should use it. And I would have said the same thing even before I was hired to work on it by Microsoft :). But if you're dealing with a script that you didn't write and aren't maintaining, and if your needs can be met by launching the script as though it were a command-line application, then quite frankly you might find it to be significantly easier to run the script through CPython. If you can provide us with a few more of the details of the use case, then I'm sure we can provide more specific advice. And if you do choose to go down the IronPython path, then you can pretty well count on this community to help you figure things out. On Wed, Jun 11, 2008 at 10:24 AM, Bob Rosembob wrote: > Hello there, > I have a C# application and a 3rd party Python script that the application > should run. The script is called periodical with some arguments, performs > some calculations and returns the results. I'm running Vista & VS2005. > > What should I do to run the script from my application? I assume I need to > install IronPython on my PC. How exactly should I do it? > > Thanks for your help. > > Bob > > > _______________________________________________ > 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 ben2004uk at googlemail.com Wed Jun 11 23:53:28 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Wed, 11 Jun 2008 22:53:28 +0100 Subject: [IronPython] ScriptEngine.GetRegisteredExtensions() In-Reply-To: References: Message-ID: Oh! Can't remember the reason why I went for the type over the file extension. But anyway, what I'm doing it manually loading in the language assemblies, finding the LanguageContext type (I know the name from an XML config file) and passing that in. I guess I could just have the file extension in the XML. My only concern is that when other languages come along, how do they register their file extension with my ScriptRuntime? I've loaded their assemblies into my appdomain, is there any additional logic required? Using the type, I was confident this wouldn't be a problem (guess thats why I went that route). It tries to get the language context from _languageIds, which is populated via RegisterLanguageContext. That seems to get called via the _languageProviders collection. This seems to have all cheeky hardcoded everything I was passing in dynamically (well, based on the XML). I can't see how I could dynamically load in a DLR language and create an engine just via the file extension. If there is a way, please let me know. I hope that all makes sense (wrote while debugging DLR code) Thanks Ben On Wed, Jun 11, 2008 at 10:33 PM, Curt Hagenlocher wrote: > The overload of GetEngine that you're using is slated to go away. Is there > functionality you get out of doing it that way that you don't get by using > the language code or file extension? > > On Wed, Jun 11, 2008 at 2:17 PM, Ben Hall wrote: >> >> Sorry - my code wasn't very helpful. >> >> The above code works fine, however I am creating the engine based on >> the type. The code demostrates the problem: >> >> ScriptRuntime runtime = ScriptRuntime.Create(); >> ScriptEngine engine = >> runtime.GetEngine(typeof(IronPython.Runtime.PythonContext)); >> foreach (string s in engine.GetRegisteredExtensions()) >> { >> System.Console.WriteLine(s); >> } >> >> Thanks >> >> Ben >> >> On Wed, Jun 11, 2008 at 9:22 PM, Curt Hagenlocher >> wrote: >> > I can't see into any of the helpers you've defined. What do you get if >> > you >> > cut this down to the smallest possible program? >> > >> > public static void Main() { >> > ScriptRuntime runtime = ScriptRuntime.Create(); >> > ScriptEngine engine = runtime.GetEngine("py"); >> > foreach (string s in engine.GetRegisteredExtensions()) { >> > System.Console.WriteLine(s); >> > } >> > } >> > >> > On Wed, Jun 11, 2008 at 12:23 PM, Ben Hall >> > wrote: >> >> >> >> Hi, >> >> >> >> I have been using the latest release of the DLR (the one from >> >> yesterday) but the behaviour of GetRegisteredExtensions() seems to >> >> have changed (or is broke). >> >> >> >> I've got this test: >> >> >> >> [Test] >> >> public void GetSaveFilter_RegisteredTypes_String() >> >> { >> >> string expected = "IronPython 2.0 Beta|*.py"; >> >> LanguageSettings python = Helper.CreateIronPythonSettings(); >> >> DLREngineFactory factory = new DLREngineFactory(); >> >> ScriptEngine engine = factory.CreateEngine(python); >> >> >> >> EngineInformation info = new EngineInformation(engine); >> >> string actual = info.GetSaveFilter(); >> >> Assert.AreEqual(expected, actual); >> >> } >> >> >> >> With IP Beta 2, this worked fine, but since upgrading it now fails. >> >> The code is this: >> >> >> >> public string GetSaveFilter() >> >> { >> >> string filter = string.Empty; >> >> foreach (string ext in Engine.GetRegisteredExtensions()) >> >> { >> >> filter += string.Format("{0}|*{1}", >> >> Engine.LanguageDisplayName, ext); >> >> } >> >> >> >> return filter; >> >> } >> >> >> >> >From what I can tell, the code is dropping into >> >> GetRegisteredFileExtensions(LanguageContext context) which does a >> >> check to see if the LanguageContext is null, but it always seems to be >> >> null. >> >> if (kvp.Value.LanguageContext == context) { >> >> res.Add(kvp.Key); >> >> } >> >> >> >> Can anyone else confirm this? >> >> >> >> Its the same for GetRegisteredIdentifiers(). >> >> >> >> Thanks >> >> >> >> Ben >> >> Blog.BenHall.me.uk >> >> _______________________________________________ >> >> Users mailing list >> >> Users at lists.ironpython.com >> >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > >> > >> > _______________________________________________ >> > Users mailing list >> > Users at lists.ironpython.com >> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > >> > >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From timr at probo.com Thu Jun 12 00:19:16 2008 From: timr at probo.com (Tim Roberts) Date: Wed, 11 Jun 2008 15:19:16 -0700 Subject: [IronPython] Talk to Python script from C# app... In-Reply-To: References: Message-ID: <48504F64.8050908@probo.com> On Wed, 11 Jun 2008 10:24:59 -0700 (PDT), Bob Rosembob wrote: > Hello there, > I have a C# application and a 3rd party Python script that the application should run. The script is called periodical with some arguments, performs some calculations and returns the results. I'm running Vista & VS2005. > > What should I do to run the script from my application? I assume I need to install IronPython on my PC. How exactly should I do it? > The FIRST question to ask is whether this is really an IronPython script, or is it just a traditional C Python script, and you happened to come here because a Google search intersected "python" and "managed" and sent you here? At this point, the vast majority of "3rd party Python scripts" are C Python scripts. If the script uses modules that are common to both implementations, then you could use either one. If the script needs C/C++ modules, or standard library routines that aren't part of IronPython, then you might need to download and install a traditional Python distribution and use System.Process to launch it. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From curt at hagenlocher.org Thu Jun 12 00:22:40 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 11 Jun 2008 15:22:40 -0700 Subject: [IronPython] ScriptEngine.GetRegisteredExtensions() In-Reply-To: References: Message-ID: When you create a ScriptRuntime, you can pass in a ScriptRuntimeSetup object that specifies additional language providers to load. Perhaps this is less automatic than you'd like, but if you were going to load those assemblies into your appdomain anyway, it's just taking the extra step of looking in that assembly for a class derived from LanguageContext. On Wed, Jun 11, 2008 at 2:53 PM, Ben Hall wrote: > Oh! > > Can't remember the reason why I went for the type over the file > extension. But anyway, what I'm doing it manually loading in the > language assemblies, finding the LanguageContext type (I know the name > from an XML config file) and passing that in. > > I guess I could just have the file extension in the XML. My only > concern is that when other languages come along, how do they register > their file extension with my ScriptRuntime? > > I've loaded their assemblies into my appdomain, is there any > additional logic required? Using the type, I was confident this > wouldn't be a problem (guess thats why I went that route). > > It tries to get the language context from _languageIds, which is > populated via RegisterLanguageContext. That seems to get called via > the _languageProviders collection. This seems to have all cheeky > hardcoded everything I was passing in dynamically (well, based on the > XML). > > I can't see how I could dynamically load in a DLR language and create > an engine just via the file extension. If there is a way, please let > me know. > > I hope that all makes sense (wrote while debugging DLR code) > > Thanks > > Ben > > > On Wed, Jun 11, 2008 at 10:33 PM, Curt Hagenlocher > wrote: > > The overload of GetEngine that you're using is slated to go away. Is > there > > functionality you get out of doing it that way that you don't get by > using > > the language code or file extension? > > > > On Wed, Jun 11, 2008 at 2:17 PM, Ben Hall > wrote: > >> > >> Sorry - my code wasn't very helpful. > >> > >> The above code works fine, however I am creating the engine based on > >> the type. The code demostrates the problem: > >> > >> ScriptRuntime runtime = ScriptRuntime.Create(); > >> ScriptEngine engine = > >> runtime.GetEngine(typeof(IronPython.Runtime.PythonContext)); > >> foreach (string s in engine.GetRegisteredExtensions()) > >> { > >> System.Console.WriteLine(s); > >> } > >> > >> Thanks > >> > >> Ben > >> > >> On Wed, Jun 11, 2008 at 9:22 PM, Curt Hagenlocher > > >> wrote: > >> > I can't see into any of the helpers you've defined. What do you get > if > >> > you > >> > cut this down to the smallest possible program? > >> > > >> > public static void Main() { > >> > ScriptRuntime runtime = ScriptRuntime.Create(); > >> > ScriptEngine engine = runtime.GetEngine("py"); > >> > foreach (string s in engine.GetRegisteredExtensions()) { > >> > System.Console.WriteLine(s); > >> > } > >> > } > >> > > >> > On Wed, Jun 11, 2008 at 12:23 PM, Ben Hall > >> > wrote: > >> >> > >> >> Hi, > >> >> > >> >> I have been using the latest release of the DLR (the one from > >> >> yesterday) but the behaviour of GetRegisteredExtensions() seems to > >> >> have changed (or is broke). > >> >> > >> >> I've got this test: > >> >> > >> >> [Test] > >> >> public void GetSaveFilter_RegisteredTypes_String() > >> >> { > >> >> string expected = "IronPython 2.0 Beta|*.py"; > >> >> LanguageSettings python = > Helper.CreateIronPythonSettings(); > >> >> DLREngineFactory factory = new DLREngineFactory(); > >> >> ScriptEngine engine = factory.CreateEngine(python); > >> >> > >> >> EngineInformation info = new EngineInformation(engine); > >> >> string actual = info.GetSaveFilter(); > >> >> Assert.AreEqual(expected, actual); > >> >> } > >> >> > >> >> With IP Beta 2, this worked fine, but since upgrading it now fails. > >> >> The code is this: > >> >> > >> >> public string GetSaveFilter() > >> >> { > >> >> string filter = string.Empty; > >> >> foreach (string ext in Engine.GetRegisteredExtensions()) > >> >> { > >> >> filter += string.Format("{0}|*{1}", > >> >> Engine.LanguageDisplayName, ext); > >> >> } > >> >> > >> >> return filter; > >> >> } > >> >> > >> >> >From what I can tell, the code is dropping into > >> >> GetRegisteredFileExtensions(LanguageContext context) which does a > >> >> check to see if the LanguageContext is null, but it always seems to > be > >> >> null. > >> >> if (kvp.Value.LanguageContext == context) { > >> >> res.Add(kvp.Key); > >> >> } > >> >> > >> >> Can anyone else confirm this? > >> >> > >> >> Its the same for GetRegisteredIdentifiers(). > >> >> > >> >> Thanks > >> >> > >> >> Ben > >> >> Blog.BenHall.me.uk > >> >> _______________________________________________ > >> >> Users mailing list > >> >> Users at lists.ironpython.com > >> >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >> > > >> > > >> > _______________________________________________ > >> > Users mailing list > >> > Users at lists.ironpython.com > >> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >> > > >> > > >> _______________________________________________ > >> Users mailing list > >> Users at lists.ironpython.com > >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > _______________________________________________ > 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 ben2004uk at googlemail.com Thu Jun 12 00:32:31 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Wed, 11 Jun 2008 23:32:31 +0100 Subject: [IronPython] ScriptEngine.GetRegisteredExtensions() In-Reply-To: References: Message-ID: Oh I see!!! Just wrote a quick sample and I think that will be fine. Not as easy as before, but should still be ok. Thanks for your help. Ben On Wed, Jun 11, 2008 at 11:22 PM, Curt Hagenlocher wrote: > When you create a ScriptRuntime, you can pass in a ScriptRuntimeSetup object > that specifies additional language providers to load. Perhaps this is less > automatic than you'd like, but if you were going to load those assemblies > into your appdomain anyway, it's just taking the extra step of looking in > that assembly for a class derived from LanguageContext. > > On Wed, Jun 11, 2008 at 2:53 PM, Ben Hall wrote: >> >> Oh! >> >> Can't remember the reason why I went for the type over the file >> extension. But anyway, what I'm doing it manually loading in the >> language assemblies, finding the LanguageContext type (I know the name >> from an XML config file) and passing that in. >> >> I guess I could just have the file extension in the XML. My only >> concern is that when other languages come along, how do they register >> their file extension with my ScriptRuntime? >> >> I've loaded their assemblies into my appdomain, is there any >> additional logic required? Using the type, I was confident this >> wouldn't be a problem (guess thats why I went that route). >> >> It tries to get the language context from _languageIds, which is >> populated via RegisterLanguageContext. That seems to get called via >> the _languageProviders collection. This seems to have all cheeky >> hardcoded everything I was passing in dynamically (well, based on the >> XML). >> >> I can't see how I could dynamically load in a DLR language and create >> an engine just via the file extension. If there is a way, please let >> me know. >> >> I hope that all makes sense (wrote while debugging DLR code) >> >> Thanks >> >> Ben >> >> >> On Wed, Jun 11, 2008 at 10:33 PM, Curt Hagenlocher >> wrote: >> > The overload of GetEngine that you're using is slated to go away. Is >> > there >> > functionality you get out of doing it that way that you don't get by >> > using >> > the language code or file extension? >> > >> > On Wed, Jun 11, 2008 at 2:17 PM, Ben Hall >> > wrote: >> >> >> >> Sorry - my code wasn't very helpful. >> >> >> >> The above code works fine, however I am creating the engine based on >> >> the type. The code demostrates the problem: >> >> >> >> ScriptRuntime runtime = ScriptRuntime.Create(); >> >> ScriptEngine engine = >> >> runtime.GetEngine(typeof(IronPython.Runtime.PythonContext)); >> >> foreach (string s in engine.GetRegisteredExtensions()) >> >> { >> >> System.Console.WriteLine(s); >> >> } >> >> >> >> Thanks >> >> >> >> Ben >> >> >> >> On Wed, Jun 11, 2008 at 9:22 PM, Curt Hagenlocher >> >> >> >> wrote: >> >> > I can't see into any of the helpers you've defined. What do you get >> >> > if >> >> > you >> >> > cut this down to the smallest possible program? >> >> > >> >> > public static void Main() { >> >> > ScriptRuntime runtime = ScriptRuntime.Create(); >> >> > ScriptEngine engine = runtime.GetEngine("py"); >> >> > foreach (string s in engine.GetRegisteredExtensions()) { >> >> > System.Console.WriteLine(s); >> >> > } >> >> > } >> >> > >> >> > On Wed, Jun 11, 2008 at 12:23 PM, Ben Hall >> >> > wrote: >> >> >> >> >> >> Hi, >> >> >> >> >> >> I have been using the latest release of the DLR (the one from >> >> >> yesterday) but the behaviour of GetRegisteredExtensions() seems to >> >> >> have changed (or is broke). >> >> >> >> >> >> I've got this test: >> >> >> >> >> >> [Test] >> >> >> public void GetSaveFilter_RegisteredTypes_String() >> >> >> { >> >> >> string expected = "IronPython 2.0 Beta|*.py"; >> >> >> LanguageSettings python = >> >> >> Helper.CreateIronPythonSettings(); >> >> >> DLREngineFactory factory = new DLREngineFactory(); >> >> >> ScriptEngine engine = factory.CreateEngine(python); >> >> >> >> >> >> EngineInformation info = new EngineInformation(engine); >> >> >> string actual = info.GetSaveFilter(); >> >> >> Assert.AreEqual(expected, actual); >> >> >> } >> >> >> >> >> >> With IP Beta 2, this worked fine, but since upgrading it now fails. >> >> >> The code is this: >> >> >> >> >> >> public string GetSaveFilter() >> >> >> { >> >> >> string filter = string.Empty; >> >> >> foreach (string ext in Engine.GetRegisteredExtensions()) >> >> >> { >> >> >> filter += string.Format("{0}|*{1}", >> >> >> Engine.LanguageDisplayName, ext); >> >> >> } >> >> >> >> >> >> return filter; >> >> >> } >> >> >> >> >> >> >From what I can tell, the code is dropping into >> >> >> GetRegisteredFileExtensions(LanguageContext context) which does a >> >> >> check to see if the LanguageContext is null, but it always seems to >> >> >> be >> >> >> null. >> >> >> if (kvp.Value.LanguageContext == context) { >> >> >> res.Add(kvp.Key); >> >> >> } >> >> >> >> >> >> Can anyone else confirm this? >> >> >> >> >> >> Its the same for GetRegisteredIdentifiers(). >> >> >> >> >> >> Thanks >> >> >> >> >> >> Ben >> >> >> Blog.BenHall.me.uk >> >> >> _______________________________________________ >> >> >> Users mailing list >> >> >> Users at lists.ironpython.com >> >> >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > >> >> > >> >> > _______________________________________________ >> >> > Users mailing list >> >> > Users at lists.ironpython.com >> >> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > >> >> > >> >> _______________________________________________ >> >> Users mailing list >> >> Users at lists.ironpython.com >> >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > >> > >> > _______________________________________________ >> > Users mailing list >> > Users at lists.ironpython.com >> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > >> > >> _______________________________________________ >> 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 brosembob at yahoo.com Thu Jun 12 00:40:34 2008 From: brosembob at yahoo.com (Bob Rosembob) Date: Wed, 11 Jun 2008 15:40:34 -0700 (PDT) Subject: [IronPython] Talk to Python script from C# app... Message-ID: <602912.65172.qm@web35504.mail.mud.yahoo.com> Thank you?Michael and Curt for your quick response. I got the script working using the following logic: ? private ...ProcessP; P = P.OutputDataReceived += P.ErrorDataReceived += P.StartInfo.UseShellExecute = P.StartInfo.RedirectStandardOutput = P.StartInfo.RedirectStandardError = P.StartInfo.CreateNoWindow = P.StartInfo.FileName = @python.ToString(); P.StartInfo.Arguments = P.Start(); P.BeginOutputReadLine(); P.BeginErrorReadLine();stringpython = @"C:\Python25\python.exe";stringpyscript = @"IronPython\cycle_LR.py";newProcess();newDataReceivedEventHandler(OnOutputDataReceived);newDataReceivedEventHandler(OnErrorReceived);false;true;true;true;"-u "+ pyscript.ToString() + @" IronPython\cycle.ini"; ? As you probably guessed I installed latest Python 2.5.2 on my machine. Now, do I need to include Python 2.5.2 into my deployment package and install?it on the user's PC or I can some how embed it into my application? ? >>If the former then you can use System.Process to launch the script with >>IronPython. You will need to download (rather than install) and launch >>the script with 'ipy.exe args...'. ? Wouldn't this approach be simpler, since I don't have to install python on user's PC? How exactly can I run ipy.exe with the args? Curt, The script that I have to use was created in 2004 and probably was not tested with IronPython. The guy who created it left the company and nobody modified the script since. Thank you very much, Bob ? ? ----- Original Message ---- From: Michael Foord To: Discussion of IronPython Sent: Wednesday, June 11, 2008 1:29:27 PM Subject: Re: [IronPython] Talk to Python script from C# app... Hello Bob, The question is, do you want to run it in the same way you would launch any command line application from C# and collect the results from standard out - or do you want to embed IronPython and run the script 'inside' your application? If the former then you can use System.Process to launch the script with IronPython. You will need to download (rather than install) and launch the script with 'ipy.exe args...'. If the latter then how you do it depends on whether you use IronPython 1 or 2 and what exactly your use case is. Michael Foord http://www.ironpythoninaction.com/ Bob Rosembob wrote: > Hello there, > I have a C# application and a 3rd party Python script that the > application should run. The script is called periodical with some > arguments, performs some calculations and returns the results. I'm > running Vista & VS2005. >? > What should I do to run the script from my application? I assume I > need to install IronPython on my PC. How exactly should I do it? >? > Thanks for your help. >? > Bob > > ------------------------------------------------------------------------ > > _______________________________________________ > 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 jonathan at slenders.be Thu Jun 12 01:09:01 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Thu, 12 Jun 2008 01:09:01 +0200 Subject: [IronPython] Python Pages -- web application stack (like django, rails, ...) Message-ID: Hi all, I'm working on a web application framework in Python, and just uploaded the first release. Now I quote from my own README. What it actually does is: - Provide an easy way to embed Python code into HTML, similar to PHP, JPS and other server side languages. - Make reusing HTML very easy. It uses concepts like master pages and including of other pages as a control. This is a very rich template mechanism. - when pages act like web controls for other pages, they are simply available as a member variable of the other pages. - It contains a built-in HTTP/1.1 web server but also supports CGI. - Uses clean URLs. There are no .page extensions, and suffixes are available as a variable. For instance, if there's a page /test.page, then the URL /test/abc will render /test.page, but receive the suffix /abc. This is totally not a new concept, but just very easy to use. - Output filters for post processing of the generated XHTML tree. - URLs will always be relative to the page where they've been generated. This makes it very easy for included pages to use URLs relative to their own even if their in a totally different directory. (This mechanism requires an output filter.) - The render engine has built-in debug functionality. The current web based debugger isn't yet ready to use, but the back-end has already been implemented. The target audience is at the moment mainly for programmers, because the front-end (which I considered less important until now) is uncomplete. The core has been extensively tested and works pretty well, but some minory features are missing and therefore I consider the whole alpha quality. I'm constantly trying to get everything work in IronPython because that's definitely a great bonus. Until now, it doesn't run in IronPython because it executes part of the pages though eval while the globals/locals for these parts are each time passed on the next eval call. (bugs has been submitted on codeplex, see user:jonathanslenders) It does however work already with Silverlight. A page can dynamically build a xap file with Python code in. Thanks to Harry Pierson for the tip! Because I'm really new to Silverlight and don't know much about it's capabilities, some research needs to be done, to get the best of this integration. -- But the concept works very well. To give you all an idea of the layout of such pages: One page (a master) may look like this. <%!page output="xhtml" filters="resolve_uris,highlight_code" %> <%!content placeholder="Main" %> <%!placeholder id="head" %> <%!placeholder id="content" %> and another may implement his placeholders. This one does some math. Note the modified python syntax. My compiler compiles these pages to regular python classes. <%!page master="/Master" external="true" %> <%!content placeholder="head" %> Hello world page <%!content placeholder="content" %>

Let's count to 10:

    <% for i in range(0,10): %>
  • <%= i %>
  • <% endfor; %>
<% def factorial(i): if i == 0: return 1; else: return i * factorial(i - 1); endif; enddef; %>

The factorial of 10 is <%= factorial(10) %>

And the Silverlight control: <%!page master="/controls/silverlight-xap" external="true" %> <%!content name="python" %> from System.Windows import Application from System.Windows.Controls import Canvas xaml = Application.Current.LoadRootVisual(Canvas(), "app.xaml") xaml.textblock.Text = 'Hello world from IronPython' <%!content name="xaml" %> Hello world from XAML The source code is available here: http://code.google.com/p/python-pages/ I hope someone thinks this is interesting. Jonathan -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Thu Jun 12 01:51:57 2008 From: timr at probo.com (Tim Roberts) Date: Wed, 11 Jun 2008 16:51:57 -0700 Subject: [IronPython] Python Pages -- web application stack (like django, rails, ...) In-Reply-To: References: Message-ID: <4850651D.2040405@probo.com> On Thu, 12 Jun 2008 01:09:01 +0200, "Jonathan Slenders" > I'm working on a web application framework in Python, and just uploaded the > first release. > > Now I quote from my own README. What it actually does is: > > - Provide an easy way to embed Python code into HTML, similar to PHP, JPS > and other server side languages. > - Make reusing HTML very easy. It uses concepts like master pages and > including of other pages as a control. This is a very rich template > mechanism. > ... > May I ask what motivated you to create this from scratch? There are a number of excellent Python web application frameworks available today, several of which have syntax and functionality almost exactly like yours. I'm not trying to say you shouldn't do such a thing, but people in the world at large already complain there are too many web frameworks for Python. I'm just wondering why you didn't choose one of the existing frameworks that was close to what you wanted, and become a contributor to that. Was there something you thought was fundamentally missing from the others? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From jonathan at slenders.be Thu Jun 12 02:18:58 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Thu, 12 Jun 2008 02:18:58 +0200 Subject: [IronPython] Python Pages -- web application stack (like django, rails, ...) In-Reply-To: <4850651D.2040405@probo.com> References: <4850651D.2040405@probo.com> Message-ID: 2008/6/12 Tim Roberts : > On Thu, 12 Jun 2008 01:09:01 +0200, "Jonathan Slenders" < > jonathan at slenders.be> > >> I'm working on a web application framework in Python, and just uploaded >> the >> first release. >> >> Now I quote from my own README. What it actually does is: >> >> - Provide an easy way to embed Python code into HTML, similar to PHP, JPS >> and other server side languages. >> - Make reusing HTML very easy. It uses concepts like master pages and >> including of other pages as a control. This is a very rich template >> mechanism. >> ... >> >> > > May I ask what motivated you to create this from scratch? There are a > number of excellent Python web application frameworks available today, > several of which have syntax and functionality almost exactly like yours. > > I'm not trying to say you shouldn't do such a thing, but people in the > world at large already complain there are too many web frameworks for > Python. I'm just wondering why you didn't choose one of the existing > frameworks that was close to what you wanted, and become a contributor to > that. Was there something you thought was fundamentally missing from the > others? > Dear Tim, You should know that I've been working on this project for about a year and a half. Apart from Django, I didn't know even one framework that I liked during this development. (Actually, at the start I didn't know about Django, later on I did and realised it was good but had my reasons not to use it. I'm not going to discuss it now.) All that time it's just been the back-end for my personal web site - I had never the intend to publish it. But the framework became gradually more and more extensive and since a half year I realized that it was well designed and could compete with others. Some of my best friends are very active Django users, and when I showed my framework, they also said that it was pretty similar to that. If you know that many Python web frameworks, I'd really like to hear about it. (I've seen several, yes, but some were very outdated and and not maintained anymore) Because I don't know much of them it's hard to say what I missed. But what I wanted was: - query parameters should be available as variables, but they shouldn't be unpacked by default as was in PHP years ago (I want to declare the variables that should be accepted) - It *should* work perfectly well without database. (at the start of this project, my hosting had no database) - code should be reusable with master pages like ASP.net does - when a master page is stored in another directory than the url's (" From jonathan at slenders.be Thu Jun 12 02:36:25 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Thu, 12 Jun 2008 02:36:25 +0200 Subject: [IronPython] Python Pages -- web application stack (like django, rails, ...) In-Reply-To: References: <4850651D.2040405@probo.com> Message-ID: 2008/6/12 Jonathan Slenders : > > > 2008/6/12 Tim Roberts : > >> On Thu, 12 Jun 2008 01:09:01 +0200, "Jonathan Slenders" < >> jonathan at slenders.be> >> >>> I'm working on a web application framework in Python, and just uploaded >>> the >>> first release. >>> >>> Now I quote from my own README. What it actually does is: >>> >>> - Provide an easy way to embed Python code into HTML, similar to PHP, JPS >>> and other server side languages. >>> - Make reusing HTML very easy. It uses concepts like master pages and >>> including of other pages as a control. This is a very rich template >>> mechanism. >>> ... >>> >>> >> >> May I ask what motivated you to create this from scratch? There are a >> number of excellent Python web application frameworks available today, >> several of which have syntax and functionality almost exactly like yours. >> >> I'm not trying to say you shouldn't do such a thing, but people in the >> world at large already complain there are too many web frameworks for >> Python. I'm just wondering why you didn't choose one of the existing >> frameworks that was close to what you wanted, and become a contributor to >> that. Was there something you thought was fundamentally missing from the >> others? >> > > Dear Tim, > > You should know that I've been working on this project for about a year and > a half. Apart from Django, I didn't know even one framework that I liked > during this development. (Actually, at the start I didn't know about Django, > later on I did and realised it was good but had my reasons not to use it. > I'm not going to discuss it now.) > > All that time it's just been the back-end for my personal web site - I had > never the intend to publish it. But the framework became gradually more and > more extensive and since a half year I realized that it was well designed > and could compete with others. > Some of my best friends are very active Django users, and when I showed my > framework, they also said that it was pretty similar to that. > > If you know that many Python web frameworks, I'd really like to hear about > it. (I've seen several, yes, but some were very outdated and and not > maintained anymore) > Because I don't know much of them it's hard to say what I missed. But what > I wanted was: > > - query parameters should be available as variables, but they shouldn't be > unpacked by default as was in PHP years ago (I want to declare the variables > that should be accepted) > - It *should* work perfectly well without database. (at the start of this > project, my hosting had no database) > - code should be reusable with master pages like ASP.net does > - when a master page is stored in another directory than the url's (" href=...".) should be rewritten in a way so that they are always reusable to > the page from where the are generated > - form input fields should be available as objects. > > Again, I didn't know any framework that does all this. Django needs a > database (not?) and the others which I found were crap, sorry.... > > Jonathan > OK, I have to take my word back. Django can run without database. But still, it's totally different, it has a custom template language, while I'm actually using Python itself als template language. Pylons -- what I just found -- also seems to have a custom (and thus limited) template language. I think this is unique, isn't it? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Thu Jun 12 07:53:06 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 11 Jun 2008 22:53:06 -0700 Subject: [IronPython] Python Pages -- web application stack (like django, rails, ...) In-Reply-To: References: <4850651D.2040405@probo.com> , Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC43268B@NA-EXMSG-C116.redmond.corp.microsoft.com> Awesome about the Silverlight integration! I'll check it out soon and let you know what I think =) About the templating language; there's a good reason why other frameworks don't use python as the templating language ... because of significant white-space. We did this in the ASP.NET futures release though (http://www.microsoft.com/downloads/details.aspx?FamilyId=A5189BCB-EF81-4C12-9733-E294D13A58E6&displaylang=en), and it's less than ideal. You use endif, enddef, endfor, etc, for scope-ending keywords, which basically changes the language and makes it *not* Python. So, if I were you I'd watch out by calling it Python. That's just my $0.02 though ... anyone else agree? ~js ________________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Jonathan Slenders [jonathan at slenders.be] Sent: Wednesday, June 11, 2008 5:36 PM To: Discussion of IronPython Subject: Re: [IronPython] Python Pages -- web application stack (like django, rails, ...) 2008/6/12 Jonathan Slenders >: 2008/6/12 Tim Roberts >: On Thu, 12 Jun 2008 01:09:01 +0200, "Jonathan Slenders" > I'm working on a web application framework in Python, and just uploaded the first release. Now I quote from my own README. What it actually does is: - Provide an easy way to embed Python code into HTML, similar to PHP, JPS and other server side languages. - Make reusing HTML very easy. It uses concepts like master pages and including of other pages as a control. This is a very rich template mechanism. ... May I ask what motivated you to create this from scratch? There are a number of excellent Python web application frameworks available today, several of which have syntax and functionality almost exactly like yours. I'm not trying to say you shouldn't do such a thing, but people in the world at large already complain there are too many web frameworks for Python. I'm just wondering why you didn't choose one of the existing frameworks that was close to what you wanted, and become a contributor to that. Was there something you thought was fundamentally missing from the others? Dear Tim, You should know that I've been working on this project for about a year and a half. Apart from Django, I didn't know even one framework that I liked during this development. (Actually, at the start I didn't know about Django, later on I did and realised it was good but had my reasons not to use it. I'm not going to discuss it now.) All that time it's just been the back-end for my personal web site - I had never the intend to publish it. But the framework became gradually more and more extensive and since a half year I realized that it was well designed and could compete with others. Some of my best friends are very active Django users, and when I showed my framework, they also said that it was pretty similar to that. If you know that many Python web frameworks, I'd really like to hear about it. (I've seen several, yes, but some were very outdated and and not maintained anymore) Because I don't know much of them it's hard to say what I missed. But what I wanted was: - query parameters should be available as variables, but they shouldn't be unpacked by default as was in PHP years ago (I want to declare the variables that should be accepted) - It *should* work perfectly well without database. (at the start of this project, my hosting had no database) - code should be reusable with master pages like ASP.net does - when a master page is stored in another directory than the url's (" References: Message-ID: hi again, this was just a repro. I can not change the visibility of the "Concrete" class. The interface and the "Base" class are the public API of this assembly. I will file a bug on codeplex. Thanks and keep up the great work, Helmut ________________________________ Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Curt Hagenlocher Gesendet: Mittwoch, 11. Juni 2008 18:35 An: Discussion of IronPython Betreff: Re: [IronPython] Trouble calling a method on a .NET object Your code works as expected if you make the "Concrete" class public instead of internal. Please file this as an issue on CodePlex at http://www.codeplex.com/IronPython On Wed, Jun 11, 2008 at 6:09 AM, Orian, Helmut wrote: I'm having trouble calling a method on one of my .NET objects. if you compile the following repro into a "test.dll": namespace Test { public interface ISomeInterface { string Greet(); } public abstract class Base {} public static class SomeFactory { public static object Get() { return new Concrete(); } } internal class Concrete : Base, ISomeInterface { public string Greet() { return "Hello world!"; } } } and try to use them: >>> import clr >>> clr.AddReference("test") >>> from Test import * >>> o = SomeFactory.Get() >>> print("Greet" in dir(o)) True >>> print(o.Greet()) Traceback (most recent call last): File "", line 1, in TypeError: expected ISomeInterface, got Base To me it looks like a bug regarding collection of polymorphic information on .NET types; or am I missing something? Thanks, Helmut ------------------------------------------------------------------------ --- An- und Abmeldung zur SCHEMA Mailingliste unter http://www.schema.de/mail ------------------------------------------------------------------------ --- _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Thu Jun 12 11:40:42 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 12 Jun 2008 10:40:42 +0100 Subject: [IronPython] Python Pages -- web application stack (like django, rails, ...) In-Reply-To: References: <4850651D.2040405@probo.com> Message-ID: <4850EF1A.9070106@voidspace.org.uk> The Silverlight integration is a *great* idea - but there really are a lot of Python web frameworks and template languages out there. I'm afraid realistically you're unlikely to get more than a handful of users - but if you enjoy coding it then there is no reason to stop. You might have more people *using* your code if you build good Silverlight support for one of the other web frameworks though. Web frameworks: Django Turbogears Pylons PSP (Python Server Pages - with Python as a templating language I believe) Karrigell web.py CherrPy (really an application server) Zope and Plone Webware Twisted and Nevow Quixote or Asyncore Spyce (also uses Python as a templating language) Porcupine Skunkweb There are also plenty of templating languages: Stan (used by Nevow) Genshi Cheetah Mako ZPT (Zope) SimpleTal (another Zope one) Kid Django template language PTL (Python templating language used by Quixote) Clearsilver (written in C with bindings for many languages) PyMeld Actually I disagree that yours uses Python - it uses something that looks a bit like Python... I've never found indentation to be a problem in templating with Python. I (of course) have my own templating system that uses unadorned Python in templates - and I use it for rest2web (generate static html pages for a website from text source and templates) and Firedrop2 (Python blog client). You can see the templating system documented here: http://www.voidspace.org.uk/python/rest2web/templating.html All the best, Michael Foord http://www.ironpythoninaction.com/ Jonathan Slenders wrote: > > > 2008/6/12 Jonathan Slenders >: > > > > 2008/6/12 Tim Roberts >: > > On Thu, 12 Jun 2008 01:09:01 +0200, "Jonathan Slenders" > > > > I'm working on a web application framework in Python, and > just uploaded the > first release. > > Now I quote from my own README. What it actually does is: > > - Provide an easy way to embed Python code into HTML, > similar to PHP, JPS > and other server side languages. > - Make reusing HTML very easy. It uses concepts like > master pages and > including of other pages as a control. This is a very > rich template > mechanism. > ... > > > > May I ask what motivated you to create this from scratch? > There are a number of excellent Python web application > frameworks available today, several of which have syntax and > functionality almost exactly like yours. > > I'm not trying to say you shouldn't do such a thing, but > people in the world at large already complain there are too > many web frameworks for Python. I'm just wondering why you > didn't choose one of the existing frameworks that was close to > what you wanted, and become a contributor to that. Was there > something you thought was fundamentally missing from the others? > > > Dear Tim, > > You should know that I've been working on this project for about a > year and a half. Apart from Django, I didn't know even one > framework that I liked during this development. (Actually, at the > start I didn't know about Django, later on I did and realised it > was good but had my reasons not to use it. I'm not going to > discuss it now.) > > All that time it's just been the back-end for my personal web site > - I had never the intend to publish it. But the framework became > gradually more and more extensive and since a half year I realized > that it was well designed and could compete with others. > Some of my best friends are very active Django users, and when I > showed my framework, they also said that it was pretty similar to > that. > > If you know that many Python web frameworks, I'd really like to > hear about it. (I've seen several, yes, but some were very > outdated and and not maintained anymore) > Because I don't know much of them it's hard to say what I missed. > But what I wanted was: > > - query parameters should be available as variables, but they > shouldn't be unpacked by default as was in PHP years ago (I want > to declare the variables that should be accepted) > - It *should* work perfectly well without database. (at the start > of this project, my hosting had no database) > - code should be reusable with master pages like ASP.net does > - when a master page is stored in another directory than the url's > (" always reusable to the page from where the are generated > - form input fields should be available as objects. > > Again, I didn't know any framework that does all this. Django > needs a database (not?) and the others which I found were crap, > sorry.... > > Jonathan > > > > OK, I have to take my word back. Django can run without database. But > still, it's totally different, it has a custom template language, > while I'm actually using Python itself als template language. Pylons > -- what I just found -- also seems to have a custom (and thus limited) > template language. I think this is unique, isn't it? > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From me at alcidesfonseca.com Thu Jun 12 12:11:03 2008 From: me at alcidesfonseca.com (Alcides Fonseca) Date: Thu, 12 Jun 2008 11:11:03 +0100 Subject: [IronPython] Django Roadmap (Alternative Implementations support) Message-ID: <763B603B-F4E4-415B-A6AF-4E40B901CF93@alcidesfonseca.com> > 9. Fix all known bugs preventing Django from running on alternate > Python > implementations. In practice this means fixing any bugs filed > before 1.0 beta > from people working on running Django on an alternate VM. From Django's Roadmap: com/group/django-developers/browse_thread/ thread/5ce124e7526dad I don't know if is important for IPy devs to run django as it is for IRuby's but it is a cool oportunity to get Django on IronPython :) Alcides Fonseca -------------- next part -------------- An HTML attachment was scrubbed... URL: From beppler at gmail.com Thu Jun 12 14:23:39 2008 From: beppler at gmail.com (Carlos Alberto Costa Beppler) Date: Thu, 12 Jun 2008 09:23:39 -0300 Subject: [IronPython] Python Pages -- web application stack (like django, rails, ...) In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC43268B@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4850651D.2040405@probo.com> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC43268B@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Look at the template module from the web.py (www.webpy.org). It is based on python and uses identation to mark blocks. 2008/6/12 Jimmy Schementi : > Awesome about the Silverlight integration! I'll check it out soon and let you know what I think =) > > About the templating language; there's a good reason why other frameworks don't use python as the templating language ... because of significant white-space. We did this in the ASP.NET futures release though (http://www.microsoft.com/downloads/details.aspx?FamilyId=A5189BCB-EF81-4C12-9733-E294D13A58E6&displaylang=en), and it's less than ideal. You use endif, enddef, endfor, etc, for scope-ending keywords, which basically changes the language and makes it *not* Python. So, if I were you I'd watch out by calling it Python. That's just my $0.02 though ... anyone else agree? > > ~js > ________________________________________ > From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Jonathan Slenders [jonathan at slenders.be] > Sent: Wednesday, June 11, 2008 5:36 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Python Pages -- web application stack (like django, rails, ...) > > 2008/6/12 Jonathan Slenders >: > > > 2008/6/12 Tim Roberts >: > > On Thu, 12 Jun 2008 01:09:01 +0200, "Jonathan Slenders" > > I'm working on a web application framework in Python, and just uploaded the > first release. > > Now I quote from my own README. What it actually does is: > > - Provide an easy way to embed Python code into HTML, similar to PHP, JPS > and other server side languages. > - Make reusing HTML very easy. It uses concepts like master pages and > including of other pages as a control. This is a very rich template > mechanism. > ... > > > May I ask what motivated you to create this from scratch? There are a number of excellent Python web application frameworks available today, several of which have syntax and functionality almost exactly like yours. > > I'm not trying to say you shouldn't do such a thing, but people in the world at large already complain there are too many web frameworks for Python. I'm just wondering why you didn't choose one of the existing frameworks that was close to what you wanted, and become a contributor to that. Was there something you thought was fundamentally missing from the others? > > Dear Tim, > > You should know that I've been working on this project for about a year and a half. Apart from Django, I didn't know even one framework that I liked during this development. (Actually, at the start I didn't know about Django, later on I did and realised it was good but had my reasons not to use it. I'm not going to discuss it now.) > > All that time it's just been the back-end for my personal web site - I had never the intend to publish it. But the framework became gradually more and more extensive and since a half year I realized that it was well designed and could compete with others. > Some of my best friends are very active Django users, and when I showed my framework, they also said that it was pretty similar to that. > > If you know that many Python web frameworks, I'd really like to hear about it. (I've seen several, yes, but some were very outdated and and not maintained anymore) > Because I don't know much of them it's hard to say what I missed. But what I wanted was: > > - query parameters should be available as variables, but they shouldn't be unpacked by default as was in PHP years ago (I want to declare the variables that should be accepted) > - It *should* work perfectly well without database. (at the start of this project, my hosting had no database) > - code should be reusable with master pages like ASP.net does > - when a master page is stored in another directory than the url's (" - form input fields should be available as objects. > > Again, I didn't know any framework that does all this. Django needs a database (not?) and the others which I found were crap, sorry.... > > Jonathan > > > OK, I have to take my word back. Django can run without database. But still, it's totally different, it has a custom template language, while I'm actually using Python itself als template language. Pylons -- what I just found -- also seems to have a custom (and thus limited) template language. I think this is unique, isn't it? > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From timr at probo.com Thu Jun 12 20:07:30 2008 From: timr at probo.com (Tim Roberts) Date: Thu, 12 Jun 2008 11:07:30 -0700 Subject: [IronPython] Python Pages -- web application stack (like django, rails, ...) In-Reply-To: References: Message-ID: <485165E2.30909@probo.com> On Thu, 12 Jun 2008 02:18:58 +0200, "Jonathan Slenders" wrote:" > 2008/6/12 Tim Roberts : >> > >> > May I ask what motivated you to create this from scratch? There are a >> > number of excellent Python web application frameworks available today, >> > several of which have syntax and functionality almost exactly like yours > If you know that many Python web frameworks, I'd really like to hear about > it. (I've seen several, yes, but some were very outdated and and not > maintained anymore) > Because I don't know much of them it's hard to say what I missed. "Several" is a very dramatic understatement. * Django * Pylons * TurboGears * Zope * Karrigell * SkunkWeb * Webware * CherryPy * web2py * Albatross * Aquarium * Python Servlet Engine * Quixote * Snakelets * WebStack And that's still not the complete list. That's why I asked the question. I almost didn't ask, because I didn't want to sound like I was suppressing innovation, but I have to believe it would be better for the community as a whole to embrace and enhance one of the existing packages, rather than start over from scratch. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From cemasoniv at gmail.com Thu Jun 12 20:19:59 2008 From: cemasoniv at gmail.com (Charles Mason) Date: Thu, 12 Jun 2008 14:19:59 -0400 Subject: [IronPython] Python Pages -- web application stack (like django, rails, ...) In-Reply-To: <4850EF1A.9070106@voidspace.org.uk> References: <4850651D.2040405@probo.com> <4850EF1A.9070106@voidspace.org.uk> Message-ID: <3290753a0806121119i23f39d23w4e1419cee55afad9@mail.gmail.com> On Thu, Jun 12, 2008 at 5:40 AM, Michael Foord wrote: > > There are also plenty of templating languages: > > Stan (used by Nevow) > Genshi > Cheetah > Mako > ZPT (Zope) > SimpleTal (another Zope one) > Kid > Django template language > PTL (Python templating language used by Quixote) > Clearsilver (written in C with bindings for many languages) > PyMeld > Anyone want to take a stab at why there are so many? It seems trivial to me. I know I will be ridiculed for my example, but this is what I use on my personal webserver: def PrintTemplate(file, templatedict): buf = open(config.Root + "/templates/" + file).read() regex = re.compile( r"{{{(.*?)}}}", re.MULTILINE | re.DOTALL ) templatedict = copy.copy( templatedict ) templatedict.update( config.DefaultDict ) pos = 0 for find in re.finditer( regex, buf ): sys.stdout.write( buf[ pos : find.start(0) ] ) pos = find.end(0) py = find.group(1) exec( py, templatedict ) else: if pos < len( buf ): sys.stdout.write( buf[ pos: ] ) Now, people are very likely to tell me about how bad it is to use exec, but since I'm the one programming the page, I know what's going through it. In essence, this *is* a python template system. C -------------- next part -------------- An HTML attachment was scrubbed... URL: From sh at defuze.org Thu Jun 12 20:22:53 2008 From: sh at defuze.org (Sylvain Hellegouarch) Date: Thu, 12 Jun 2008 20:22:53 +0200 Subject: [IronPython] Python Pages -- web application stack (like django, rails, ...) In-Reply-To: <485165E2.30909@probo.com> References: <485165E2.30909@probo.com> Message-ID: <4851697D.7070504@defuze.org> Tim Roberts a ?crit : > On Thu, 12 Jun 2008 02:18:58 +0200, "Jonathan Slenders" > wrote:" >> 2008/6/12 Tim Roberts : >>> > >>> > May I ask what motivated you to create this from scratch? There are a >>> > number of excellent Python web application frameworks available today, >>> > several of which have syntax and functionality almost exactly like >>> yours >> If you know that many Python web frameworks, I'd really like to hear >> about >> it. (I've seen several, yes, but some were very outdated and and not >> maintained anymore) >> Because I don't know much of them it's hard to say what I missed. > > "Several" is a very dramatic understatement. > * Django > * Pylons > * TurboGears > * Zope > * Karrigell > * SkunkWeb > * Webware > * CherryPy > * web2py > * Albatross > * Aquarium > * Python Servlet Engine > * Quixote > * Snakelets > * WebStack > > And that's still not the complete list. That's why I asked the > question. I almost didn't ask, because I didn't want to sound like I > was suppressing innovation, but I have to believe it would be better for > the community as a whole to embrace and enhance one of the existing > packages, rather than start over from scratch. > I find better for a community to have a few large projects acting like locomotives for the rest. That's exactly what happens with Python and the web. Among the products you've mentioned, today's main actors are probably Django and Zope. They have demonstrated, and still do, that Python is a good environment for long term, powerful and dynamic projects. A platform a company can rely on. The others demonstrate that the community still strives for innovation and can challenge the estblishment. I find that attitude quite sane. Having the whole community focused on one single project doesn't make it better. I wouldn't say Ruby on Rails is that better because there is hardly any competition in the Ruby world for it. - Sylvain From bill at monkey.org Thu Jun 12 20:30:50 2008 From: bill at monkey.org (Bill Merrill) Date: Thu, 12 Jun 2008 14:30:50 -0400 Subject: [IronPython] Python Pages -- web application stack (like django, rails, ...) In-Reply-To: <3290753a0806121119i23f39d23w4e1419cee55afad9@mail.gmail.com> References: <4850651D.2040405@probo.com> <4850EF1A.9070106@voidspace.org.uk> <3290753a0806121119i23f39d23w4e1419cee55afad9@mail.gmail.com> Message-ID: <1DC4663F-D4E9-49F1-884E-D881F9AF67CE@monkey.org> This is exactly why there are so many. -Bill On Jun 12, 2008, at 2:19 PM, Charles Mason wrote: > > Anyone want to take a stab at why there are so many? It seems > trivial to me. I know I will be ridiculed for my example, but this > is what I use on my personal webserver: > > def PrintTemplate(file, templatedict): > buf = open(config.Root + "/templates/" + file).read() > regex = re.compile( r"{{{(.*?)}}}", re.MULTILINE | re.DOTALL ) > > templatedict = copy.copy( templatedict ) > templatedict.update( config.DefaultDict ) > > pos = 0 > for find in re.finditer( regex, buf ): > sys.stdout.write( buf[ pos : find.start(0) ] ) > pos = find.end(0) > > py = find.group(1) > exec( py, templatedict ) > else: > if pos < len( buf ): > sys.stdout.write( buf[ pos: ] ) > > > Now, people are very likely to tell me about how bad it is to use > exec, but since I'm the one programming the page, I know what's > going through it. > > In essence, this *is* a python template system. > > C > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Thu Jun 12 20:47:02 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 12 Jun 2008 11:47:02 -0700 Subject: [IronPython] Python Pages -- web application stack (like django, rails, ...) In-Reply-To: <4850EF1A.9070106@voidspace.org.uk> References: <4850651D.2040405@probo.com> <4850EF1A.9070106@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC4B6D58@NA-EXMSG-C116.redmond.corp.microsoft.com> Integration between Silverlight and web frameworks for IronRuby and IronPython is definitely an awesome thing. John and I showed this stuff with Rails at RailsConf (we're working on getting that announced; let me know if you interested in it and I can send stuff your way), and Dino did something with Django at the past PyCon. ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Thursday, June 12, 2008 2:41 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Python Pages -- web application stack (like > django, rails, ...) > > The Silverlight integration is a *great* idea - but there really are a > lot of Python web frameworks and template languages out there. I'm > afraid realistically you're unlikely to get more than a handful of > users > - but if you enjoy coding it then there is no reason to stop. > > You might have more people *using* your code if you build good > Silverlight support for one of the other web frameworks though. > > Web frameworks: > > Django > Turbogears > Pylons > PSP (Python Server Pages - with Python as a templating language I > believe) > Karrigell > web.py > CherrPy (really an application server) > Zope and Plone > Webware > Twisted and Nevow > Quixote or Asyncore > Spyce (also uses Python as a templating language) > Porcupine > Skunkweb > > There are also plenty of templating languages: > > Stan (used by Nevow) > Genshi > Cheetah > Mako > ZPT (Zope) > SimpleTal (another Zope one) > Kid > Django template language > PTL (Python templating language used by Quixote) > Clearsilver (written in C with bindings for many languages) > PyMeld > > Actually I disagree that yours uses Python - it uses something that > looks a bit like Python... > > I've never found indentation to be a problem in templating with Python. > I (of course) have my own templating system that uses unadorned Python > in templates - and I use it for rest2web (generate static html pages > for > a website from text source and templates) and Firedrop2 (Python blog > client). You can see the templating system documented here: > > http://www.voidspace.org.uk/python/rest2web/templating.html > > All the best, > > Michael Foord > http://www.ironpythoninaction.com/ > > > > Jonathan Slenders wrote: > > > > > > 2008/6/12 Jonathan Slenders > >: > > > > > > > > 2008/6/12 Tim Roberts >: > > > > On Thu, 12 Jun 2008 01:09:01 +0200, "Jonathan Slenders" > > > > > > > I'm working on a web application framework in Python, and > > just uploaded the > > first release. > > > > Now I quote from my own README. What it actually does is: > > > > - Provide an easy way to embed Python code into HTML, > > similar to PHP, JPS > > and other server side languages. > > - Make reusing HTML very easy. It uses concepts like > > master pages and > > including of other pages as a control. This is a very > > rich template > > mechanism. > > ... > > > > > > > > May I ask what motivated you to create this from scratch? > > There are a number of excellent Python web application > > frameworks available today, several of which have syntax and > > functionality almost exactly like yours. > > > > I'm not trying to say you shouldn't do such a thing, but > > people in the world at large already complain there are too > > many web frameworks for Python. I'm just wondering why you > > didn't choose one of the existing frameworks that was close > to > > what you wanted, and become a contributor to that. Was there > > something you thought was fundamentally missing from the > others? > > > > > > Dear Tim, > > > > You should know that I've been working on this project for about > a > > year and a half. Apart from Django, I didn't know even one > > framework that I liked during this development. (Actually, at the > > start I didn't know about Django, later on I did and realised it > > was good but had my reasons not to use it. I'm not going to > > discuss it now.) > > > > All that time it's just been the back-end for my personal web > site > > - I had never the intend to publish it. But the framework became > > gradually more and more extensive and since a half year I > realized > > that it was well designed and could compete with others. > > Some of my best friends are very active Django users, and when I > > showed my framework, they also said that it was pretty similar to > > that. > > > > If you know that many Python web frameworks, I'd really like to > > hear about it. (I've seen several, yes, but some were very > > outdated and and not maintained anymore) > > Because I don't know much of them it's hard to say what I missed. > > But what I wanted was: > > > > - query parameters should be available as variables, but they > > shouldn't be unpacked by default as was in PHP years ago (I want > > to declare the variables that should be accepted) > > - It *should* work perfectly well without database. (at the start > > of this project, my hosting had no database) > > - code should be reusable with master pages like ASP.net does > > - when a master page is stored in another directory than the > url's > > (" > always reusable to the page from where the are generated > > - form input fields should be available as objects. > > > > Again, I didn't know any framework that does all this. Django > > needs a database (not?) and the others which I found were crap, > > sorry.... > > > > Jonathan > > > > > > > > OK, I have to take my word back. Django can run without database. But > > still, it's totally different, it has a custom template language, > > while I'm actually using Python itself als template language. Pylons > > -- what I just found -- also seems to have a custom (and thus > limited) > > template language. I think this is unique, isn't it? > > > > > > > > --------------------------------------------------------------------- > --- > > > > _______________________________________________ > > 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 jonathan at slenders.be Thu Jun 12 21:13:49 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Thu, 12 Jun 2008 21:13:49 +0200 Subject: [IronPython] Python Pages -- web application stack (like django, rails, ...) In-Reply-To: <485165E2.30909@probo.com> References: <485165E2.30909@probo.com> Message-ID: 2008/6/12 Tim Roberts : > On Thu, 12 Jun 2008 02:18:58 +0200, "Jonathan Slenders" < > jonathan at slenders.be> wrote:" > >> 2008/6/12 Tim Roberts : >> >>> > >>> > May I ask what motivated you to create this from scratch? There are a >>> > number of excellent Python web application frameworks available today, >>> > several of which have syntax and functionality almost exactly like >>> yours >>> >> If you know that many Python web frameworks, I'd really like to hear about >> it. (I've seen several, yes, but some were very outdated and and not >> maintained anymore) >> Because I don't know much of them it's hard to say what I missed. >> > > "Several" is a very dramatic understatement. > * Django > * Pylons > * TurboGears > * Zope > * Karrigell > * SkunkWeb > * Webware > * CherryPy > * web2py > * Albatross > * Aquarium > * Python Servlet Engine > * Quixote > * Snakelets > * WebStack > > And that's still not the complete list. That's why I asked the question. > I almost didn't ask, because I didn't want to sound like I was suppressing > innovation, but I have to believe it would be better for the community as a > whole to embrace and enhance one of the existing packages, rather than start > over from scratch. > > -- > Tim Roberts, timr at probo.com > Providenza & Boekelheide, Inc. You mentioned some from which I've never heard about.. It's partly true that one project would be better, but I think that users need a choice. The reason I started this was because at that time I wasn't satisfied of all the frameworks that I found (note that I didn't do much research) on the web and it was not too much work to start my own framework. I know plenty of web developers who code their website in raw PHP, just because they want to have their own 'framework' they perfectly fits in their situation, and does only the things that they want. Most web pages are really simple concerning functionality. Further, I'm a big fan om modular programming, for me it feels like some web frameworks try to do just to much. They say "you should use MVC, you should use our templating language, our database abstraction layer, our AJAX widget set, etcetera...". It's much better to keep all this separate. Not only because very few developers need *all* these components, but even less want exactly this combination. What I'm trying to do is, just making a small layer right above Python, enough to run an unmodified static HTML website, or a website with embedded python code if you like to. It does low level concepts like handling sessions and generating the output headers. Further I add some features to simplefy things which are anyway part of any website. (clean URLs, includes, ...) Probably this is more or less the same level as PHP. For users who don't have enough on that, they will run on top of that layer a content management system (e.g. cmsmadesimple) or other higher level framwork. (but they don't have to!) And that kind of users will run on top of that their website. Users who need a database abstraction layer but no CMS should use a library for that. A DAL shouln't be exclusively part of a web framework. It should be a module that can be used in both a desktop application and a web app. So this kind of users can simply use the database layer which matches best in their situation. People who need AJAX can use a random AJAX library (this can even be platform independent if it's javascript-only.). Some of you who are against this kind of modular programming may argue that a beginner doesn't now about enough to choose which library he'd need to do what. But a beginner won't use this kind of functionality anyway. Which user of phpmadesimple didn't ever code a raw PHP side before? In my opinion, it's perfectly doable to use a basic low level layer, that's extremely friendly but just doesn't have too much functionality and those who need build on top of this with components of their own choice. The framework I've been working on does not yet much, but when it is more stable, it certainly becomes a very clean and flexible layer to build any website or CMS on top. Jimmy wrote: > Integration between Silverlight and web frameworks for IronRuby and > IronPython is definitely an awesome thing. John and I showed this stuff with > Rails at RailsConf (we're working on getting that announced; let me know if > you interested in it and I can send stuff your way), and Dino did something > with Django at the past PyCon. > Thank you, I am definitely interested. But I'm still a student and now in the middle of examinations. I will contact you about this within a month. By the way, to continue my previous paragraph. This silverlight integration runs on top of the core framework. The silverlight control is simply a page that contains code to generate the XAP file based on ironpython code, delivered by other pages. I still need to look what the best way is to get most of the silverlight integration. Initially, this wasn't my highest priority, but for sure, this becomes what I'll work on after the core is stable, usable and cross platform. PS: why do people spend years trying to juggle 5 balls or ride a unicycle, while it's been done million times before. Because it's fun of course! ( Yes, I can juggle, and do off-road unicycling too :) ) Now back to my studies... I may be away till the end of the month. And for the IronPython folk, go on with your great work! -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Thu Jun 12 21:18:09 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 12 Jun 2008 12:18:09 -0700 Subject: [IronPython] Talk to Python script from C# app... In-Reply-To: <602912.65172.qm@web35504.mail.mud.yahoo.com> References: <602912.65172.qm@web35504.mail.mud.yahoo.com> Message-ID: Whether it's CPython or IronPython, you're going to have to deploy something to the user's PC if you want to run a Python program there. IronPython doesn't have any kind of installer; you just copy its modules over with your application. But your program almost certainly makes use of parts of the standard CPython library, which you'd then have to copy over as well. Even though CPython has an installer under Windows, I suspect you can still do an "xcopy deployment" of it to most machines provided that you also grab a copy of Python25.dll from the Windows directory. To try with IronPython, You can run ipy.exe the same way as you're running python.exe. But you'd want to try this from a command prompt first before going to the trouble of changing your C# program. On Wed, Jun 11, 2008 at 3:40 PM, Bob Rosembob wrote: > Thank you Michael and Curt for your quick response. > I got the script working using the following logic: > > > > private > Process P; > > ... > > string python = @"C:\Python25\python.exe"; > > string pyscript = @"IronPython\cycle_LR.py"; > > P = > new Process(); > > P.OutputDataReceived += > new DataReceivedEventHandler(OnOutputDataReceived); > > P.ErrorDataReceived += > new DataReceivedEventHandler(OnErrorReceived); > > P.StartInfo.UseShellExecute = > false; > > P.StartInfo.RedirectStandardOutput = > true; > > P.StartInfo.RedirectStandardError = > true; > > P.StartInfo.CreateNoWindow = > true; > > P.StartInfo.FileName = @python.ToString(); > > P.StartInfo.Arguments = > "-u " + pyscript.ToString() + @" IronPython\cycle.ini"; > > P.Start(); > > P.BeginOutputReadLine(); > > P.BeginErrorReadLine(); > > > As you probably guessed I installed latest Python 2.5.2 on my machine. > > Now, do I need to include Python 2.5.2 into my deployment package and > install it on the user's PC or I can some how embed it into my application? > > > > >>If the former then you can use System.Process to launch the script with > >>IronPython. You will need to download (rather than install) and launch > >>the script with 'ipy.exe args...'. > > > > Wouldn't this approach be simpler, since I don't have to install python on > user's PC? How exactly can I run ipy.exe with the args? > > Curt, > > The script that I have to use was created in 2004 and probably was not > tested with IronPython. The guy who created it left the company and nobody > modified the script since. > > > Thank you very much, > > Bob > > > > > ----- Original Message ---- > From: Michael Foord > To: Discussion of IronPython > Sent: Wednesday, June 11, 2008 1:29:27 PM > Subject: Re: [IronPython] Talk to Python script from C# app... > > Hello Bob, > > The question is, do you want to run it in the same way you would launch > any command line application from C# and collect the results from > standard out - or do you want to embed IronPython and run the script > 'inside' your application? > > If the former then you can use System.Process to launch the script with > IronPython. You will need to download (rather than install) and launch > the script with 'ipy.exe args...'. > > If the latter then how you do it depends on whether you use IronPython 1 > or 2 and what exactly your use case is. > > Michael Foord > http://www.ironpythoninaction.com/ > > Bob Rosembob wrote: > > Hello there, > > I have a C# application and a 3rd party Python script that the > > application should run. The script is called periodical with some > > arguments, performs some calculations and returns the results. I'm > > running Vista & VS2005. > > > > What should I do to run the script from my application? I assume I > > need to install IronPython on my PC. How exactly should I do it? > > > > Thanks for your help. > > > > Bob > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > 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 learn.ironpython at gmail.com Thu Jun 12 22:04:01 2008 From: learn.ironpython at gmail.com (Huzaifa Gain) Date: Thu, 12 Jun 2008 13:04:01 -0700 Subject: [IronPython] Python Exception In-Reply-To: <719e81ff0806121218n68847dd9i54f1907ed4290acb@mail.gmail.com> References: <719e81ff0806121218n68847dd9i54f1907ed4290acb@mail.gmail.com> Message-ID: <719e81ff0806121304i2bba37d5mc453252a330a0dcf@mail.gmail.com> I am embedding Ironpython code into C# code and my C# code is using a COM component which i am using into Python code. Please suggest me what would be the best approach to handle exceptions. Showing Line # and column # in exception message for the embedded python code is a must. -------------- next part -------------- An HTML attachment was scrubbed... URL: From learn.ironpython at gmail.com Thu Jun 12 22:17:23 2008 From: learn.ironpython at gmail.com (Huzaifa Gain) Date: Thu, 12 Jun 2008 13:17:23 -0700 (PDT) Subject: [IronPython] Ironpython exception Message-ID: <17808285.post@talk.nabble.com> I am embedding Ironpython code into C# code and my C# code is using a COM component which i am using into Python code. Please suggest me what would be the best approach to handle exceptions. Showing Line # and column # in exception message for the embedded python code is a must. -- View this message in context: http://www.nabble.com/Ironpython-exception-tp17808285p17808285.html Sent from the IronPython mailing list archive at Nabble.com. From falcon at uwyo.edu Fri Jun 13 04:29:54 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Thu, 12 Jun 2008 20:29:54 -0600 Subject: [IronPython] Partial classes Message-ID: Our company has a scripting/macro system. Functions are stored in a database and at runtime we generate python classes. For a form we have multiple functions declared. We want to use IronPython studio to emit the python classes to a file to be debugged. Is it possible to build a partial class so that we can have one file per function. file function324.py partial class Form76: def function324.py file function325.py partial class Form76 def function324.py file base325.py #do not edit anything in this file! changes will not be saved! Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Fri Jun 13 05:01:41 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 12 Jun 2008 20:01:41 -0700 Subject: [IronPython] Ironpython exception In-Reply-To: <17808285.post@talk.nabble.com> References: <17808285.post@talk.nabble.com> Message-ID: <7AD436E4270DD54A94238001769C2227012BC9F4F84E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Basically you want to call FormatException and get back the formatted exception string. That'll get you the same formatted exception we give at the console. In 1.x this is PythonEngine.FormatException. In 2.x it's ScriptEngine.FormatException. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Huzaifa Gain Sent: Thursday, June 12, 2008 1:17 PM To: users at lists.ironpython.com Subject: [IronPython] Ironpython exception I am embedding Ironpython code into C# code and my C# code is using a COM component which i am using into Python code. Please suggest me what would be the best approach to handle exceptions. Showing Line # and column # in exception message for the embedded python code is a must. -- View this message in context: http://www.nabble.com/Ironpython-exception-tp17808285p17808285.html Sent from the IronPython mailing list archive at Nabble.com. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From curt at hagenlocher.org Fri Jun 13 05:04:25 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 12 Jun 2008 20:04:25 -0700 Subject: [IronPython] Partial classes In-Reply-To: References: Message-ID: The Python language doesn't support partial classes, but you can probably achieve something similar by using multiple inheritance. That is, put each function into a separate class and then create an aggregate class that derives from each of them. >>> class A(object): ... def test1(self): ... print 'test1' ... >>> class B(object): ... def test2(self): ... print 'test2' ... >>> class C(A, B): ... def __init__(self): ... self.test1() ... self.test2() ... >>> C() test1 test2 >>> There are generally certain "gotchas" to look out for with multiple inheritance, but provided that you're not using the same method names across multiple base classes -- including special names like __init__ -- you shouldn't run into any of them. On Thu, Jun 12, 2008 at 7:29 PM, Michael Stephens wrote: > Our company has a scripting/macro system. Functions are stored in a > database and at runtime we generate python classes. For a form we have > multiple functions declared. We want to use IronPython studio to emit the > python classes to a file to be debugged. Is it possible to build a partial > class so that we can have one file per function. > > file function324.py > partial class Form76: > def function324.py > > file function325.py > partial class Form76 > def function324.py > > file base325.py > #do not edit anything in this file! changes will not be saved! > > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.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 fuzzyman at voidspace.org.uk Fri Jun 13 14:22:35 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 13 Jun 2008 13:22:35 +0100 Subject: [IronPython] Partial classes In-Reply-To: References: Message-ID: <4852668B.7020603@voidspace.org.uk> Michael Stephens wrote: > Our company has a scripting/macro system. Functions are stored in a > database and at runtime we generate python classes. For a form we > have multiple functions declared. We want to use IronPython studio to > emit the python classes to a file to be debugged. Is it possible to > build a partial class so that we can have one file per function. Emit them as one file per function. Then have one file that imports them all and constructs a dictionary mapping function name to imported function. You can turn it into a class by calling: new_class = type(name, (object,), dict_of_functions) type is the default metaclass, and responsible for creating new classes. Every function will be a method of the new class. Michael Foord http://www.ironpythoninaction.com/ > > file function324.py > partial class Form76: > def function324.py > > file function325.py > partial class Form76 > def function324.py > > file base325.py > #do not edit anything in this file! changes will not be saved! > > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From ronnie.maor at gmail.com Fri Jun 13 15:53:51 2008 From: ronnie.maor at gmail.com (Ronnie Maor) Date: Fri, 13 Jun 2008 16:53:51 +0300 Subject: [IronPython] Partial classes In-Reply-To: <4852668B.7020603@voidspace.org.uk> References: <4852668B.7020603@voidspace.org.uk> Message-ID: <2fd6b9d0806130653i27220568gabf5edd4b4cd4b4d@mail.gmail.com> you can also add methods to an existing class like this: class A(object): ... def foo(self,x,y): ... A.foo = foo On Fri, Jun 13, 2008 at 3:22 PM, Michael Foord wrote: > Michael Stephens wrote: > >> Our company has a scripting/macro system. Functions are stored in a >> database and at runtime we generate python classes. For a form we have >> multiple functions declared. We want to use IronPython studio to emit the >> python classes to a file to be debugged. Is it possible to build a partial >> class so that we can have one file per function. >> > > Emit them as one file per function. Then have one file that imports them > all and constructs a dictionary mapping function name to imported function. > You can turn it into a class by calling: > > new_class = type(name, (object,), dict_of_functions) > > type is the default metaclass, and responsible for creating new classes. > Every function will be a method of the new class. > > Michael Foord > http://www.ironpythoninaction.com/ > > > >> file function324.py >> partial class Form76: >> def function324.py >> >> file function325.py >> partial class Form76 >> def function324.py >> >> file base325.py >> #do not edit anything in this file! changes will not be saved! >> >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu or 89iroc at gmail.com > 89iroc at gmail.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 jdhardy at gmail.com Fri Jun 13 16:01:34 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 13 Jun 2008 08:01:34 -0600 Subject: [IronPython] CodePlex #7132 (cStringIO 1-arg .read() and .readlines() broken) Message-ID: Hi, I don't know how close 2.0b3 is, but is it too late to request that this one gets fixed -- speciifcally, the .read(-1) case? It breaks cgi.py's FieldStorage class, which is used by many Python web applications (anything built on Paste or CherryPy, for starters). It's a trivial one-line fix, but it has a huge impact. Any chance to get it resolved ASAP? http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=7132 -Jeff From dinov at exchange.microsoft.com Fri Jun 13 17:55:54 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 13 Jun 2008 08:55:54 -0700 Subject: [IronPython] CodePlex #7132 (cStringIO 1-arg .read() and .readlines() broken) In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227012BC9F4F8A5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> It won't make it into beta 3 - we've actually already snapped the beta 3 build and started the final test pass over it. It's definitely near the top of the list to fix though so it'll probably be fixed early in beta 4. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Hardy Sent: Friday, June 13, 2008 7:02 AM To: Discussion of IronPython Subject: [IronPython] CodePlex #7132 (cStringIO 1-arg .read() and .readlines() broken) Hi, I don't know how close 2.0b3 is, but is it too late to request that this one gets fixed -- speciifcally, the .read(-1) case? It breaks cgi.py's FieldStorage class, which is used by many Python web applications (anything built on Paste or CherryPy, for starters). It's a trivial one-line fix, but it has a huge impact. Any chance to get it resolved ASAP? http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=7132 -Jeff _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From brosembob at yahoo.com Fri Jun 13 19:30:00 2008 From: brosembob at yahoo.com (Bob Rosembob) Date: Fri, 13 Jun 2008 10:30:00 -0700 (PDT) Subject: [IronPython] Talk to Python script from C# app... Message-ID: <708967.74315.qm@web35507.mail.mud.yahoo.com> Curt, I?copied all the files (app.exe + cycle.py + python.exe + python25.dll) to another PC, which doesn't have Python installed, and ran it. I got error saying that it can't import string module (No module named string). Any ideas? Thanks, Bob ----- Original Message ---- From: Curt Hagenlocher To: Discussion of IronPython Sent: Thursday, June 12, 2008 3:18:09 PM Subject: Re: [IronPython] Talk to Python script from C# app... Whether it's CPython or IronPython, you're going to have to deploy something to the user's PC if you want to run a Python program there.? IronPython doesn't have any kind of installer; you just copy its modules over with your application.? But your program almost certainly makes use of parts of the standard CPython library, which you'd then have to copy over as well. ? Even though CPython has an installer under Windows, I suspect you can still do an "xcopy deployment" of it to most machines provided that you also grab a copy of Python25.dll from the Windows directory. To try with IronPython, You can run ipy.exe the same way as you're running python.exe.? But you'd want to try this from a command prompt first before going to the trouble of changing your C# program. On Wed, Jun 11, 2008 at 3:40 PM, Bob Rosembob wrote: Thank you?Michael and Curt for your quick response. I got the script working using the following logic: ? privateProcessP; ... stringpython = @"C:\Python25\python.exe"; stringpyscript = @"IronPython\cycle_LR.py"; P = newProcess(); P.OutputDataReceived += newDataReceivedEventHandler(OnOutputDataReceived); P.ErrorDataReceived += newDataReceivedEventHandler(OnErrorReceived); P.StartInfo.UseShellExecute = false; P.StartInfo.RedirectStandardOutput = true; P.StartInfo.RedirectStandardError = true; P.StartInfo.CreateNoWindow = true; P.StartInfo.FileName = @python.ToString(); P.StartInfo.Arguments = "-u "+ pyscript.ToString() + @" IronPython\cycle.ini"; P.Start(); P.BeginOutputReadLine(); P.BeginErrorReadLine(); ? As you probably guessed I installed latest Python 2.5.2 on my machine. Now, do I need to include Python 2.5.2 into my deployment package and install?it on the user's PC or I can some how embed it into my application? ? >>If the former then you can use System.Process to launch the script with >>IronPython. You will need to download (rather than install) and launch >>the script with 'ipy.exe args...'. ? Wouldn't this approach be simpler, since I don't have to install python on user's PC? How exactly can I run ipy.exe with the args? Curt, The script that I have to use was created in 2004 and probably was not tested with IronPython. The guy who created it left the company and nobody modified the script since. Thank you very much, Bob ? ? ----- Original Message ---- From: Michael Foord To: Discussion of IronPython Sent: Wednesday, June 11, 2008 1:29:27 PM Subject: Re: [IronPython] Talk to Python script from C# app... Hello Bob, The question is, do you want to run it in the same way you would launch any command line application from C# and collect the results from standard out - or do you want to embed IronPython and run the script 'inside' your application? If the former then you can use System.Process to launch the script with IronPython. You will need to download (rather than install) and launch the script with 'ipy.exe args...'. If the latter then how you do it depends on whether you use IronPython 1 or 2 and what exactly your use case is. Michael Foord http://www.ironpythoninaction.com/ Bob Rosembob wrote: > Hello there, > I have a C# application and a 3rd party Python script that the > application should run. The script is called periodical with some > arguments, performs some calculations and returns the results. I'm > running Vista & VS2005. >? > What should I do to run the script from my application? I assume I > need to install IronPython on my PC. How exactly should I do it? >? > Thanks for your help. >? > Bob > > ------------------------------------------------------------------------ > > _______________________________________________ > 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 simon.dahlbacka at gmail.com Fri Jun 13 19:38:52 2008 From: simon.dahlbacka at gmail.com (Simon Dahlbacka) Date: Fri, 13 Jun 2008 20:38:52 +0300 Subject: [IronPython] Talk to Python script from C# app... In-Reply-To: <708967.74315.qm@web35507.mail.mud.yahoo.com> References: <708967.74315.qm@web35507.mail.mud.yahoo.com> Message-ID: <57124720806131038p515c18a2ub3f4ba24bd7eec9f@mail.gmail.com> As Curt already told you: "But your program almost certainly makes use of parts of the standard CPython library, which you'd then have to copy over as well." On Fri, Jun 13, 2008 at 8:30 PM, Bob Rosembob wrote: > Curt, > I copied all the files (app.exe + cycle.py + python.exe + python25.dll) to > another PC, which doesn't have Python installed, and ran it. I got error > saying that it can't import string module (No module named string). Any > ideas? > > Thanks, > Bob > > ----- Original Message ---- > From: Curt Hagenlocher > To: Discussion of IronPython > Sent: Thursday, June 12, 2008 3:18:09 PM > Subject: Re: [IronPython] Talk to Python script from C# app... > > Whether it's CPython or IronPython, you're going to have to deploy > something to the user's PC if you want to run a Python program there. > IronPython doesn't have any kind of installer; you just copy its modules > over with your application. But your program almost certainly makes use of > parts of the standard CPython library, which you'd then have to copy over as > well. > > Even though CPython has an installer under Windows, I suspect you can still > do an "xcopy deployment" of it to most machines provided that you also grab > a copy of Python25.dll from the Windows directory. > To try with IronPython, > You can run ipy.exe the same way as you're running python.exe. But you'd > want to try this from a command prompt first before going to the trouble of > changing your C# program. > On Wed, Jun 11, 2008 at 3:40 PM, Bob Rosembob wrote: > >> Thank you Michael and Curt for your quick response. >> I got the script working using the following logic: >> >> >> >> private >> Process P; >> >> ... >> >> string python = @"C:\Python25\python.exe"; >> >> string pyscript = @"IronPython\cycle_LR.py"; >> >> P = >> new Process(); >> >> P.OutputDataReceived += >> new DataReceivedEventHandler(OnOutputDataReceived); >> >> P.ErrorDataReceived += >> new DataReceivedEventHandler(OnErrorReceived); >> >> P.StartInfo.UseShellExecute = >> false; >> >> P.StartInfo.RedirectStandardOutput = >> true; >> >> P.StartInfo.RedirectStandardError = >> true; >> >> P.StartInfo.CreateNoWindow = >> true; >> >> P.StartInfo.FileName = @python.ToString(); >> >> P.StartInfo.Arguments = >> "-u " + pyscript.ToString() + @" IronPython\cycle.ini"; >> >> P.Start(); >> >> P.BeginOutputReadLine(); >> >> P.BeginErrorReadLine(); >> >> >> As you probably guessed I installed latest Python 2.5.2 on my machine. >> >> Now, do I need to include Python 2.5.2 into my deployment package and >> install it on the user's PC or I can some how embed it into my application? >> >> >> >> >>If the former then you can use System.Process to launch the script with >> >>IronPython. You will need to download (rather than install) and launch >> >>the script with 'ipy.exe args...'. >> >> >> >> Wouldn't this approach be simpler, since I don't have to install python on >> user's PC? How exactly can I run ipy.exe with the args? >> >> Curt, >> >> The script that I have to use was created in 2004 and probably was not >> tested with IronPython. The guy who created it left the company and nobody >> modified the script since. >> >> >> Thank you very much, >> >> Bob >> >> >> >> >> ----- Original Message ---- >> From: Michael Foord >> To: Discussion of IronPython >> Sent: Wednesday, June 11, 2008 1:29:27 PM >> Subject: Re: [IronPython] Talk to Python script from C# app... >> >> Hello Bob, >> >> The question is, do you want to run it in the same way you would launch >> any command line application from C# and collect the results from >> standard out - or do you want to embed IronPython and run the script >> 'inside' your application? >> >> If the former then you can use System.Process to launch the script with >> IronPython. You will need to download (rather than install) and launch >> the script with 'ipy.exe args...'. >> >> If the latter then how you do it depends on whether you use IronPython 1 >> or 2 and what exactly your use case is. >> >> Michael Foord >> http://www.ironpythoninaction.com/ >> >> Bob Rosembob wrote: >> > Hello there, >> > I have a C# application and a 3rd party Python script that the >> > application should run. The script is called periodical with some >> > arguments, performs some calculations and returns the results. I'm >> > running Vista & VS2005. >> > >> > What should I do to run the script from my application? I assume I >> > need to install IronPython on my PC. How exactly should I do it? >> > >> > Thanks for your help. >> > >> > Bob >> > >> > ------------------------------------------------------------------------ >> > >> > _______________________________________________ >> > Users mailing list >> > Users at lists.ironpython.com >> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Fri Jun 13 19:51:23 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 13 Jun 2008 10:51:23 -0700 Subject: [IronPython] Talk to Python script from C# app... In-Reply-To: <708967.74315.qm@web35507.mail.mud.yahoo.com> References: <708967.74315.qm@web35507.mail.mud.yahoo.com> Message-ID: There will be a "string.py" in the lib directory of your Python 2.5 installation. You may need other files from this directory as well. On Fri, Jun 13, 2008 at 10:30 AM, Bob Rosembob wrote: > Curt, > I copied all the files (app.exe + cycle.py + python.exe + python25.dll) to > another PC, which doesn't have Python installed, and ran it. I got error > saying that it can't import string module (No module named string). Any > ideas? > > Thanks, > Bob > > ----- Original Message ---- > From: Curt Hagenlocher > To: Discussion of IronPython > Sent: Thursday, June 12, 2008 3:18:09 PM > Subject: Re: [IronPython] Talk to Python script from C# app... > > Whether it's CPython or IronPython, you're going to have to deploy > something to the user's PC if you want to run a Python program there. > IronPython doesn't have any kind of installer; you just copy its modules > over with your application. But your program almost certainly makes use of > parts of the standard CPython library, which you'd then have to copy over as > well. > > Even though CPython has an installer under Windows, I suspect you can still > do an "xcopy deployment" of it to most machines provided that you also grab > a copy of Python25.dll from the Windows directory. > To try with IronPython, > You can run ipy.exe the same way as you're running python.exe. But you'd > want to try this from a command prompt first before going to the trouble of > changing your C# program. > On Wed, Jun 11, 2008 at 3:40 PM, Bob Rosembob wrote: > >> Thank you Michael and Curt for your quick response. >> I got the script working using the following logic: >> >> >> >> private >> Process P; >> >> ... >> >> string python = @"C:\Python25\python.exe"; >> >> string pyscript = @"IronPython\cycle_LR.py"; >> >> P = >> new Process(); >> >> P.OutputDataReceived += >> new DataReceivedEventHandler(OnOutputDataReceived); >> >> P.ErrorDataReceived += >> new DataReceivedEventHandler(OnErrorReceived); >> >> P.StartInfo.UseShellExecute = >> false; >> >> P.StartInfo.RedirectStandardOutput = >> true; >> >> P.StartInfo.RedirectStandardError = >> true; >> >> P.StartInfo.CreateNoWindow = >> true; >> >> P.StartInfo.FileName = @python.ToString(); >> >> P.StartInfo.Arguments = >> "-u " + pyscript.ToString() + @" IronPython\cycle.ini"; >> >> P.Start(); >> >> P.BeginOutputReadLine(); >> >> P.BeginErrorReadLine(); >> >> >> As you probably guessed I installed latest Python 2.5.2 on my machine. >> >> Now, do I need to include Python 2.5.2 into my deployment package and >> install it on the user's PC or I can some how embed it into my application? >> >> >> >> >>If the former then you can use System.Process to launch the script with >> >>IronPython. You will need to download (rather than install) and launch >> >>the script with 'ipy.exe args...'. >> >> >> >> Wouldn't this approach be simpler, since I don't have to install python on >> user's PC? How exactly can I run ipy.exe with the args? >> >> Curt, >> >> The script that I have to use was created in 2004 and probably was not >> tested with IronPython. The guy who created it left the company and nobody >> modified the script since. >> >> >> Thank you very much, >> >> Bob >> >> >> >> >> ----- Original Message ---- >> From: Michael Foord >> To: Discussion of IronPython >> Sent: Wednesday, June 11, 2008 1:29:27 PM >> Subject: Re: [IronPython] Talk to Python script from C# app... >> >> Hello Bob, >> >> The question is, do you want to run it in the same way you would launch >> any command line application from C# and collect the results from >> standard out - or do you want to embed IronPython and run the script >> 'inside' your application? >> >> If the former then you can use System.Process to launch the script with >> IronPython. You will need to download (rather than install) and launch >> the script with 'ipy.exe args...'. >> >> If the latter then how you do it depends on whether you use IronPython 1 >> or 2 and what exactly your use case is. >> >> Michael Foord >> http://www.ironpythoninaction.com/ >> >> Bob Rosembob wrote: >> > Hello there, >> > I have a C# application and a 3rd party Python script that the >> > application should run. The script is called periodical with some >> > arguments, performs some calculations and returns the results. I'm >> > running Vista & VS2005. >> > >> > What should I do to run the script from my application? I assume I >> > need to install IronPython on my PC. How exactly should I do it? >> > >> > Thanks for your help. >> > >> > Bob >> > >> > ------------------------------------------------------------------------ >> > >> > _______________________________________________ >> > Users mailing list >> > Users at lists.ironpython.com >> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Fri Jun 13 21:54:47 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Fri, 13 Jun 2008 13:54:47 -0600 Subject: [IronPython] CodePlex #7132 (cStringIO 1-arg .read() and .readlines() broken) In-Reply-To: <7AD436E4270DD54A94238001769C2227012BC9F4F8A5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227012BC9F4F8A5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Thanks, Dino. On Fri, Jun 13, 2008 at 9:55 AM, Dino Viehland wrote: > It won't make it into beta 3 - we've actually already snapped the beta 3 build and started the final test pass over it. > > It's definitely near the top of the list to fix though so it'll probably be fixed early in beta 4. > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Hardy > Sent: Friday, June 13, 2008 7:02 AM > To: Discussion of IronPython > Subject: [IronPython] CodePlex #7132 (cStringIO 1-arg .read() and .readlines() broken) > > Hi, > I don't know how close 2.0b3 is, but is it too late to request that > this one gets fixed -- speciifcally, the .read(-1) case? It breaks > cgi.py's FieldStorage class, which is used by many Python web > applications (anything built on Paste or CherryPy, for starters). It's > a trivial one-line fix, but it has a huge impact. Any chance to get it > resolved ASAP? > > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=7132 > > -Jeff > _______________________________________________ > 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 dan.eloff at gmail.com Sat Jun 14 00:01:46 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Fri, 13 Jun 2008 17:01:46 -0500 Subject: [IronPython] Setting tb_next Message-ID: <4817b6fc0806131501x52beb941n3621a614ddc7021f@mail.gmail.com> It's readonly in Python, and that's the way it's meant to be. But I'm porting Jinja2 to IronPython (Silverlight hopefully) and Jinja uses ctypes to dig deep into CPython's guts and make a function for setting tb_next on traceback objects. Playing by the same dirty, no holds barred rules, is there a way to set tb_next on traceback objects in IronPython? Thanks, -Dan From riltim at gmail.com Sat Jun 14 00:16:07 2008 From: riltim at gmail.com (Tim Riley) Date: Fri, 13 Jun 2008 18:16:07 -0400 Subject: [IronPython] Setting tb_next In-Reply-To: <4817b6fc0806131501x52beb941n3621a614ddc7021f@mail.gmail.com> References: <4817b6fc0806131501x52beb941n3621a614ddc7021f@mail.gmail.com> Message-ID: Could you use something like Cecil for this? On 6/13/08, Dan Eloff wrote: > It's readonly in Python, and that's the way it's meant to be. But I'm > porting Jinja2 to IronPython (Silverlight hopefully) and Jinja uses > ctypes to dig deep into CPython's guts and make a function for setting > tb_next on traceback objects. Playing by the same dirty, no holds > barred rules, is there a way to set tb_next on traceback objects in > IronPython? > > Thanks, > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Sent from Gmail for mobile | mobile.google.com From dinov at exchange.microsoft.com Sat Jun 14 00:24:44 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 13 Jun 2008 15:24:44 -0700 Subject: [IronPython] Setting tb_next In-Reply-To: References: <4817b6fc0806131501x52beb941n3621a614ddc7021f@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012BC9F4F9CB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I'd imagine Cecil would work but it might be overkill - you could just use .NET reflection: try: raise Exception() except: import sys tb = sys.exc_info()[2] tbtype = type(tb) import clr import System clr.GetClrType(tbtype).GetField('_next', System.Reflection.BindingFlags.NonPublic|System.Reflection.BindingFlags.Instance).SetValue(tb, None) Just replace None w/ the value you want to set it to. For 1.x change '_next' to 'next'. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tim Riley Sent: Friday, June 13, 2008 3:16 PM To: Discussion of IronPython Subject: Re: [IronPython] Setting tb_next Could you use something like Cecil for this? On 6/13/08, Dan Eloff wrote: > It's readonly in Python, and that's the way it's meant to be. But I'm > porting Jinja2 to IronPython (Silverlight hopefully) and Jinja uses > ctypes to dig deep into CPython's guts and make a function for setting > tb_next on traceback objects. Playing by the same dirty, no holds > barred rules, is there a way to set tb_next on traceback objects in > IronPython? > > Thanks, > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Sent from Gmail for mobile | mobile.google.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From brosembob at yahoo.com Sat Jun 14 00:28:10 2008 From: brosembob at yahoo.com (Bob Rosembob) Date: Fri, 13 Jun 2008 15:28:10 -0700 (PDT) Subject: [IronPython] Talk to Python script from C# app... Message-ID: <674510.22746.qm@web35505.mail.mud.yahoo.com> I added bunch of files (.py), one at the time, before I could run the script and it works now. Do I need to include them into my installer and just copy them on the user's machine or I'll have to do something more then that? Thanks for your help, Bob ----- Original Message ---- From: Curt Hagenlocher To: Discussion of IronPython Sent: Friday, June 13, 2008 1:51:23 PM Subject: Re: [IronPython] Talk to Python script from C# app... There will be a "string.py" in the lib directory of your Python 2.5 installation.? You may need other files from this directory as well.? On Fri, Jun 13, 2008 at 10:30 AM, Bob Rosembob wrote: Curt, I?copied all the files (app.exe + cycle.py + python.exe + python25.dll) to another PC, which doesn't have Python installed, and ran it. I got error saying that it can't import string module (No module named string). Any ideas? ? Thanks, Bob ----- Original Message ---- From: Curt Hagenlocher To: Discussion of IronPython Sent: Thursday, June 12, 2008 3:18:09 PM Subject: Re: [IronPython] Talk to Python script from C# app... Whether it's CPython or IronPython, you're going to have to deploy something to the user's PC if you want to run a Python program there.? IronPython doesn't have any kind of installer; you just copy its modules over with your application.? But your program almost certainly makes use of parts of the standard CPython library, which you'd then have to copy over as well. ? Even though CPython has an installer under Windows, I suspect you can still do an "xcopy deployment" of it to most machines provided that you also grab a copy of Python25.dll from the Windows directory. To try with IronPython, You can run ipy.exe the same way as you're running python.exe.? But you'd want to try this from a command prompt first before going to the trouble of changing your C# program. On Wed, Jun 11, 2008 at 3:40 PM, Bob Rosembob wrote: Thank you?Michael and Curt for your quick response. I got the script working using the following logic: ? privateProcessP; ... stringpython = @"C:\Python25\python.exe"; stringpyscript = @"IronPython\cycle_LR.py"; P = newProcess(); P.OutputDataReceived += newDataReceivedEventHandler(OnOutputDataReceived); P.ErrorDataReceived += newDataReceivedEventHandler(OnErrorReceived); P.StartInfo.UseShellExecute = false; P.StartInfo.RedirectStandardOutput = true; P.StartInfo.RedirectStandardError = true; P.StartInfo.CreateNoWindow = true; P.StartInfo.FileName = @python.ToString(); P.StartInfo.Arguments = "-u "+ pyscript.ToString() + @" IronPython\cycle.ini"; P.Start(); P.BeginOutputReadLine(); P.BeginErrorReadLine(); ? As you probably guessed I installed latest Python 2.5.2 on my machine. Now, do I need to include Python 2.5.2 into my deployment package and install?it on the user's PC or I can some how embed it into my application? ? >>If the former then you can use System.Process to launch the script with >>IronPython. You will need to download (rather than install) and launch >>the script with 'ipy.exe args...'. ? Wouldn't this approach be simpler, since I don't have to install python on user's PC? How exactly can I run ipy.exe with the args? Curt, The script that I have to use was created in 2004 and probably was not tested with IronPython. The guy who created it left the company and nobody modified the script since. Thank you very much, Bob ? ? ----- Original Message ---- From: Michael Foord To: Discussion of IronPython Sent: Wednesday, June 11, 2008 1:29:27 PM Subject: Re: [IronPython] Talk to Python script from C# app... Hello Bob, The question is, do you want to run it in the same way you would launch any command line application from C# and collect the results from standard out - or do you want to embed IronPython and run the script 'inside' your application? If the former then you can use System.Process to launch the script with IronPython. You will need to download (rather than install) and launch the script with 'ipy.exe args...'. If the latter then how you do it depends on whether you use IronPython 1 or 2 and what exactly your use case is. Michael Foord http://www.ironpythoninaction.com/ Bob Rosembob wrote: > Hello there, > I have a C# application and a 3rd party Python script that the > application should run. The script is called periodical with some > arguments, performs some calculations and returns the results. I'm > running Vista & VS2005. >? > What should I do to run the script from my application? I assume I > need to install IronPython on my PC. How exactly should I do it? >? > Thanks for your help. >? > Bob > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >? _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Sat Jun 14 00:38:11 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 13 Jun 2008 15:38:11 -0700 Subject: [IronPython] Talk to Python script from C# app... In-Reply-To: <674510.22746.qm@web35505.mail.mud.yahoo.com> References: <674510.22746.qm@web35505.mail.mud.yahoo.com> Message-ID: If this test worked, you should be able to just copy them onto the users' machine -- manually or using an installer. On Fri, Jun 13, 2008 at 3:28 PM, Bob Rosembob wrote: > I added bunch of files (.py), one at the time, before I could run the > script and it works now. > Do I need to include them into my installer and just copy them on the > user's machine or I'll have to do something more then that? > > Thanks for your help, > Bob > > ----- Original Message ---- > From: Curt Hagenlocher > To: Discussion of IronPython > Sent: Friday, June 13, 2008 1:51:23 PM > Subject: Re: [IronPython] Talk to Python script from C# app... > > There will be a "string.py" in the lib directory of your Python 2.5 > installation. You may need other files from this directory as well. > > On Fri, Jun 13, 2008 at 10:30 AM, Bob Rosembob > wrote: > >> Curt, >> I copied all the files (app.exe + cycle.py + python.exe + python25.dll) >> to another PC, which doesn't have Python installed, and ran it. I got error >> saying that it can't import string module (No module named string). Any >> ideas? >> >> Thanks, >> Bob >> >> ----- Original Message ---- >> From: Curt Hagenlocher >> To: Discussion of IronPython >> Sent: Thursday, June 12, 2008 3:18:09 PM >> Subject: Re: [IronPython] Talk to Python script from C# app... >> >> Whether it's CPython or IronPython, you're going to have to deploy >> something to the user's PC if you want to run a Python program there. >> IronPython doesn't have any kind of installer; you just copy its modules >> over with your application. But your program almost certainly makes use of >> parts of the standard CPython library, which you'd then have to copy over as >> well. >> >> Even though CPython has an installer under Windows, I suspect you can >> still do an "xcopy deployment" of it to most machines provided that you also >> grab a copy of Python25.dll from the Windows directory. >> To try with IronPython, >> You can run ipy.exe the same way as you're running python.exe. But you'd >> want to try this from a command prompt first before going to the trouble of >> changing your C# program. >> On Wed, Jun 11, 2008 at 3:40 PM, Bob Rosembob >> wrote: >> >>> Thank you Michael and Curt for your quick response. >>> I got the script working using the following logic: >>> >>> >>> >>> private >>> Process P; >>> >>> ... >>> >>> string python = @"C:\Python25\python.exe"; >>> >>> string pyscript = @"IronPython\cycle_LR.py"; >>> >>> P = >>> new Process(); >>> >>> P.OutputDataReceived += >>> new DataReceivedEventHandler(OnOutputDataReceived); >>> >>> P.ErrorDataReceived += >>> new DataReceivedEventHandler(OnErrorReceived); >>> >>> P.StartInfo.UseShellExecute = >>> false; >>> >>> P.StartInfo.RedirectStandardOutput = >>> true; >>> >>> P.StartInfo.RedirectStandardError = >>> true; >>> >>> P.StartInfo.CreateNoWindow = >>> true; >>> >>> P.StartInfo.FileName = @python.ToString(); >>> >>> P.StartInfo.Arguments = >>> "-u " + pyscript.ToString() + @" IronPython\cycle.ini"; >>> >>> P.Start(); >>> >>> P.BeginOutputReadLine(); >>> >>> P.BeginErrorReadLine(); >>> >>> >>> As you probably guessed I installed latest Python 2.5.2 on my machine. >>> >>> Now, do I need to include Python 2.5.2 into my deployment package and >>> install it on the user's PC or I can some how embed it into my application? >>> >>> >>> >>> >>If the former then you can use System.Process to launch the script with >>> >>> >>IronPython. You will need to download (rather than install) and launch >>> >>the script with 'ipy.exe args...'. >>> >>> >>> >>> Wouldn't this approach be simpler, since I don't have to install python >>> on user's PC? How exactly can I run ipy.exe with the args? >>> >>> Curt, >>> >>> The script that I have to use was created in 2004 and probably was not >>> tested with IronPython. The guy who created it left the company and nobody >>> modified the script since. >>> >>> >>> Thank you very much, >>> >>> Bob >>> >>> >>> >>> >>> ----- Original Message ---- >>> From: Michael Foord >>> To: Discussion of IronPython >>> Sent: Wednesday, June 11, 2008 1:29:27 PM >>> Subject: Re: [IronPython] Talk to Python script from C# app... >>> >>> Hello Bob, >>> >>> The question is, do you want to run it in the same way you would launch >>> any command line application from C# and collect the results from >>> standard out - or do you want to embed IronPython and run the script >>> 'inside' your application? >>> >>> If the former then you can use System.Process to launch the script with >>> IronPython. You will need to download (rather than install) and launch >>> the script with 'ipy.exe args...'. >>> >>> If the latter then how you do it depends on whether you use IronPython 1 >>> or 2 and what exactly your use case is. >>> >>> Michael Foord >>> http://www.ironpythoninaction.com/ >>> >>> Bob Rosembob wrote: >>> > Hello there, >>> > I have a C# application and a 3rd party Python script that the >>> > application should run. The script is called periodical with some >>> > arguments, performs some calculations and returns the results. I'm >>> > running Vista & VS2005. >>> > >>> > What should I do to run the script from my application? I assume I >>> > need to install IronPython on my PC. How exactly should I do it? >>> > >>> > Thanks for your help. >>> > >>> > Bob >>> > >>> > >>> ------------------------------------------------------------------------ >>> > >>> > _______________________________________________ >>> > Users mailing list >>> > Users at lists.ironpython.com >>> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> > >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > _______________________________________________ > 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 srivatsn at microsoft.com Sat Jun 14 00:56:27 2008 From: srivatsn at microsoft.com (Srivatsn Narayanan) Date: Fri, 13 Jun 2008 15:56:27 -0700 Subject: [IronPython] Announcing IronPython 2.0 Beta3 Message-ID: Hello IronPython Community, I'm pleased to announce IronPython 2.0 Beta 3. We have fixed around 34 bugs in this release (~16 of them reported on Codeplex and ~18 reported internally). Apart from the bug fixes, this release contains the following improvements: * We have worked on perf - specifically generators, exception handling, and shootout perf have improved. We are aware of some late-breaking degrades which we expect to fix by the next release. * An auto-templating feature has been added to the Dynamic Language Runtime which should improve performance in highly dynamic scenarios. * cmath and _winreg modules have been implemented. There is a change in packaging this time. The Dynamic Silverlight sources and binaries, compatible with Silverlight 2 Beta 2, are now included in this release. This makes the package a single place to get both the desktop and Silverlight versions of IronPython. The Visual Studio solution file (IronPython.sln) has been updated to build under "Silverlight Release" and "Silverlight Debug" configurations as well. Please note that this requires Silverlight 2 Beta 2 to build properly. IronPython2005.sln is no longer part of the package as was mentioned in the last beta release notes. This means that Visual Studio 2008/.NET 3.5 is required to build IronPython.sln. Ofcourse /toolsversion:2.0 flag can still be passed to msbuild and hence IronPython can be built to run against .NET 2.0 runtime as well. The following codeplex workitems have been closed since IronPython 2.0 Beta 2: * nt.access is missing Closed Issue Medium Jun 2 at 7:24 PM * Trivial: throw WindowsError (with 'errno' of 17) when nt.mkdir called on pre-existing directory * '_' is in the result of dir() after first expression evaluation * -X:MTA option not supported by IP 2.0A * expresion-1 if condition else expresion-2 working incorrectly * Python Parser class is internal * PythonType.HasGetAttribute property does not detect inherited implementation. * _winreg is not implemented * SyntaxError(...).__dict__ is not a dict * Using 'with' statment with IDisposable .NET type doesn't work * IronPython forces objects in sys.meta_path to be new-style classes * imp.load_module("os", ...) broken * DUPLICATE: Run ipyw .exe ( Iron Python 2 Beta 2 ) * REJECTED: Can't create & return nested function from CreateDelegate * id returns Int64 not int or long * Overriding properties has strange syntax We'd like to thank everyone in the community who reported these bugs: py_sunil, jhardy, awilkins, oldman, and 05031972, Ronnie Maor, Jonathan Amsterdam, sanxiyn, jackeyoo, Thane Plummer, Vizcayno Tamparantan, Michael Foord, Alex Henderson We've also closed these bugs that were reported internally: * Trivial: Exception messages are not directed to sys.stderr * Python25: new exception hierarchy * when base class provide over one ctor function,IronPython can not distinguish them just like Cpython do. * AttributeError: 'file' object has no attribute 'truncate' * ImportError: No module named xxsubtype * cmath module isn't implemented (complex arithmetic) * long("0X20",16) throws ValueError: invalid integer number literal * ImportError: No module named _winreg * dir(*()) returns something unexpected * "print a_super_object" throws TypeError * old style class constructed with an unpacked tuple containing a single None barfs * DLR crashes with stack overflow when ironpython.dll is missing * Enable turning whole object models dynamic in IronPython * Trivial: There is no "_md5" module in IronPython2.0 when run the file of test_hmac.py * TypeError: don't know how to disassemble code objects * sys.meta_path is not implemented * calling setattr got an error . * issubclass(Exception,object) return different result against Ironpython and Cpython You can download IronPython 2.0 Beta 3 at: http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=12988 The IronPython Team IMPORTANT NOTES ToyScript, a small scripting language built on top of the DLR, is merely a DLR sample and not some new scripting language Microsoft has created. Also, ToyScript is not intended to be distributed with IronPython on a permanent basis. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Sat Jun 14 01:02:41 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Fri, 13 Jun 2008 18:02:41 -0500 Subject: [IronPython] Setting tb_next In-Reply-To: <7AD436E4270DD54A94238001769C2227012BC9F4F9CB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0806131501x52beb941n3621a614ddc7021f@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012BC9F4F9CB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0806131602o2cd493f0j5a90b77374754720@mail.gmail.com> That's looks easy, except it won't work in Silverlight. You can only access public members in Silverlight, even via reflection. Do I have any options in Silverlight? Thanks, -Dan On Fri, Jun 13, 2008 at 5:24 PM, Dino Viehland wrote: > I'd imagine Cecil would work but it might be overkill - you could just use .NET reflection: > > try: > raise Exception() > except: > import sys > tb = sys.exc_info()[2] > > tbtype = type(tb) > > import clr > import System > clr.GetClrType(tbtype).GetField('_next', System.Reflection.BindingFlags.NonPublic|System.Reflection.BindingFlags.Instance).SetValue(tb, None) > > Just replace None w/ the value you want to set it to. For 1.x change '_next' to 'next'. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tim Riley > Sent: Friday, June 13, 2008 3:16 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Setting tb_next > > Could you use something like Cecil for this? > > > > On 6/13/08, Dan Eloff wrote: >> It's readonly in Python, and that's the way it's meant to be. But I'm >> porting Jinja2 to IronPython (Silverlight hopefully) and Jinja uses >> ctypes to dig deep into CPython's guts and make a function for setting >> tb_next on traceback objects. Playing by the same dirty, no holds >> barred rules, is there a way to set tb_next on traceback objects in >> IronPython? >> >> Thanks, >> -Dan >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > > -- > Sent from Gmail for mobile | mobile.google.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From fuzzyman at voidspace.org.uk Sat Jun 14 01:04:42 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 14 Jun 2008 00:04:42 +0100 Subject: [IronPython] Setting tb_next In-Reply-To: <4817b6fc0806131602o2cd493f0j5a90b77374754720@mail.gmail.com> References: <4817b6fc0806131501x52beb941n3621a614ddc7021f@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012BC9F4F9CB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0806131602o2cd493f0j5a90b77374754720@mail.gmail.com> Message-ID: <4852FD0A.5050405@voidspace.org.uk> Dan Eloff wrote: > That's looks easy, except it won't work in Silverlight. You can only > access public members in Silverlight, even via reflection. Do I have > any options in Silverlight? > Why on *earth* does Jinja need to do that? It's truly horrible. Python is a dynamic enough language that there are hundreds of way achieving even the strangest of behaviour without resorting to stupidity like that. Bug them to change it... Michael Foord > Thanks, > -Dan > > On Fri, Jun 13, 2008 at 5:24 PM, Dino Viehland > wrote: > >> I'd imagine Cecil would work but it might be overkill - you could just use .NET reflection: >> >> try: >> raise Exception() >> except: >> import sys >> tb = sys.exc_info()[2] >> >> tbtype = type(tb) >> >> import clr >> import System >> clr.GetClrType(tbtype).GetField('_next', System.Reflection.BindingFlags.NonPublic|System.Reflection.BindingFlags.Instance).SetValue(tb, None) >> >> Just replace None w/ the value you want to set it to. For 1.x change '_next' to 'next'. >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tim Riley >> Sent: Friday, June 13, 2008 3:16 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Setting tb_next >> >> Could you use something like Cecil for this? >> >> >> >> On 6/13/08, Dan Eloff wrote: >> >>> It's readonly in Python, and that's the way it's meant to be. But I'm >>> porting Jinja2 to IronPython (Silverlight hopefully) and Jinja uses >>> ctypes to dig deep into CPython's guts and make a function for setting >>> tb_next on traceback objects. Playing by the same dirty, no holds >>> barred rules, is there a way to set tb_next on traceback objects in >>> IronPython? >>> >>> Thanks, >>> -Dan >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >> -- >> Sent from Gmail for mobile | mobile.google.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Sat Jun 14 01:06:36 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 14 Jun 2008 00:06:36 +0100 Subject: [IronPython] Announcing IronPython 2.0 Beta3 In-Reply-To: References: Message-ID: <4852FD7C.7020100@voidspace.org.uk> Congratulations guys! Many thanks. Onto 1.1.2 next... :-) I've just finished chapter 14 of IronPython in Action. The next chapter is the last one, and is on embedding IronPython. I've been looking forward to writing this. The chances of seeing the book finished in my lifetime are increasing... Michael Foord http://www.ironpythoninaction.com/ Srivatsn Narayanan wrote: > > Hello IronPython Community, > > I?m pleased to announce IronPython 2.0 *Beta 3*. We have fixed around > 34 bugs in this release (~16 of them reported on Codeplex and ~18 > reported internally). Apart from the bug fixes, this release contains > the following improvements: > > ? We have worked on perf ? specifically generators, exception > handling, and shootout perf have improved. We are aware of some > late-breaking degrades which we expect to fix by the next release. > > ? An auto-templating feature has been added to the Dynamic Language > Runtime which should improve performance in highly dynamic scenarios. > > ? cmath and _winreg modules have been implemented. > > There is a change in packaging this time. The Dynamic Silverlight > sources and binaries, compatible with Silverlight 2 Beta 2, are now > included in this release. This makes the package a single place to get > both the desktop and Silverlight versions of IronPython. The Visual > Studio solution file (IronPython.sln) has been updated to build under > ?Silverlight Release? and ?Silverlight Debug? configurations as well. > Please note that this requires Silverlight 2 Beta 2 to build properly. > > IronPython2005.sln is no longer part of the package as was mentioned > in the last beta release notes. This means that Visual Studio > 2008/.NET 3.5 is required to build IronPython.sln. Ofcourse > /toolsversion:2.0 flag can still be passed to msbuild and hence > IronPython can be built to run against .NET 2.0 runtime as well. > > The following codeplex workitems have been closed since IronPython 2.0 > Beta 2: > > ? nt.access is missing Closed Issue Medium Jun 2 at 7:24 PM > > ? Trivial: throw WindowsError (with 'errno' of 17) when nt.mkdir > called on pre-existing directory > > ? '_' is in the result of dir() after first expression evaluation > > ? -X:MTA option not supported by IP 2.0A > > ? expresion-1 if condition else expresion-2 working incorrectly > > ? Python Parser class is internal > > ? PythonType.HasGetAttribute property does not detect inherited > implementation. > > ? _winreg is not implemented > > ? SyntaxError(...).__dict__ is not a dict > > ? Using 'with' statment with IDisposable .NET type doesn't work > > ? IronPython forces objects in sys.meta_path to be new-style classes > > ? imp.load_module("os", ...) broken > > ? DUPLICATE: Run ipyw .exe ( Iron Python 2 Beta 2 ) > > ? REJECTED: Can't create & return nested function from CreateDelegate > > ? id returns Int64 not int or long > > ? Overriding properties has strange syntax > > We?d like to thank everyone in the community who reported these bugs: > py_sunil, jhardy, awilkins, oldman, and 05031972, Ronnie Maor, > Jonathan Amsterdam, sanxiyn, jackeyoo, Thane Plummer, Vizcayno > Tamparantan, Michael Foord, Alex Henderson > > We?ve also closed these bugs that were reported internally: > > ? Trivial: Exception messages are not directed to sys.stderr > > ? Python25: new exception hierarchy > > ? when base class provide over one ctor function,IronPython can not > distinguish them just like Cpython do. > > ? AttributeError: 'file' object has no attribute 'truncate' > > ? ImportError: No module named xxsubtype > > ? cmath module isn't implemented (complex arithmetic) > > ? long("0X20",16) throws ValueError: invalid integer number literal > > ? ImportError: No module named _winreg > > ? dir(*()) returns something unexpected > > ? "print a_super_object" throws TypeError > > ? old style class constructed with an unpacked tuple containing a > single None barfs > > ? DLR crashes with stack overflow when ironpython.dll is missing > > ? Enable turning whole object models dynamic in IronPython > > ? Trivial: There is no "_md5" module in IronPython2.0 when run the > file of test_hmac.py > > ? TypeError: don't know how to disassemble code objects > > ? sys.meta_path is not implemented > > ? calling setattr got an error . > > ? issubclass(Exception,object) return different result against > Ironpython and Cpython > > You can download IronPython 2.0 Beta 3 at: > http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=12988 > > The IronPython Team > > IMPORTANT NOTES > > ToyScript, a small scripting language built on top of the DLR, is > merely a DLR sample and not some new scripting language Microsoft has > created. Also, ToyScript is not intended to be distributed with > IronPython on a permanent basis. > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From dinov at exchange.microsoft.com Sat Jun 14 01:10:59 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 13 Jun 2008 16:10:59 -0700 Subject: [IronPython] Setting tb_next In-Reply-To: <4817b6fc0806131602o2cd493f0j5a90b77374754720@mail.gmail.com> References: <4817b6fc0806131501x52beb941n3621a614ddc7021f@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012BC9F4F9CB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0806131602o2cd493f0j5a90b77374754720@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012BC9F4F9EB@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Oh, sorry, I overlooked the Silverlight part. There's no way to do this there :( -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Friday, June 13, 2008 4:03 PM To: Discussion of IronPython Subject: Re: [IronPython] Setting tb_next That's looks easy, except it won't work in Silverlight. You can only access public members in Silverlight, even via reflection. Do I have any options in Silverlight? Thanks, -Dan On Fri, Jun 13, 2008 at 5:24 PM, Dino Viehland wrote: > I'd imagine Cecil would work but it might be overkill - you could just use .NET reflection: > > try: > raise Exception() > except: > import sys > tb = sys.exc_info()[2] > > tbtype = type(tb) > > import clr > import System > clr.GetClrType(tbtype).GetField('_next', System.Reflection.BindingFlags.NonPublic|System.Reflection.BindingFlags.Instance).SetValue(tb, None) > > Just replace None w/ the value you want to set it to. For 1.x change '_next' to 'next'. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tim Riley > Sent: Friday, June 13, 2008 3:16 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Setting tb_next > > Could you use something like Cecil for this? > > > > On 6/13/08, Dan Eloff wrote: >> It's readonly in Python, and that's the way it's meant to be. But I'm >> porting Jinja2 to IronPython (Silverlight hopefully) and Jinja uses >> ctypes to dig deep into CPython's guts and make a function for setting >> tb_next on traceback objects. Playing by the same dirty, no holds >> barred rules, is there a way to set tb_next on traceback objects in >> IronPython? >> >> Thanks, >> -Dan >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > > -- > Sent from Gmail for mobile | mobile.google.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Sat Jun 14 08:36:55 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sat, 14 Jun 2008 01:36:55 -0500 Subject: [IronPython] _ast Module Message-ID: <4817b6fc0806132336m1dc8b89dr3ba45e353fadcc7c@mail.gmail.com> Since Jinja appears to be non-trivial to run in Silverlight, I'm also looking into Mako. Unfortunately, it looks like I hit another brick wall. Mako uses the _ast module, which is not available in IronPython as far as I'm aware. Is the ast module in fepy related to this at all? I'm out of options here too, aren't I? Thanks, -Dan From fuzzyman at voidspace.org.uk Sat Jun 14 11:36:08 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 14 Jun 2008 10:36:08 +0100 Subject: [IronPython] _ast Module In-Reply-To: <4817b6fc0806132336m1dc8b89dr3ba45e353fadcc7c@mail.gmail.com> References: <4817b6fc0806132336m1dc8b89dr3ba45e353fadcc7c@mail.gmail.com> Message-ID: <48539108.2080002@voidspace.org.uk> Hello Dan, The ast module in Fepy works, but as far as I know it targets the IronPython 1 AST. It shouldn't be too hard to update it for IronPython 2 though. What happens when you try it? Michael Foord Dan Eloff wrote: > Since Jinja appears to be non-trivial to run in Silverlight, I'm also > looking into Mako. Unfortunately, it looks like I hit another brick > wall. Mako uses the _ast module, which is not available in IronPython > as far as I'm aware. Is the ast module in fepy related to this at all? > I'm out of options here too, aren't I? > > Thanks, > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Sat Jun 14 12:51:29 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 14 Jun 2008 11:51:29 +0100 Subject: [IronPython] Announcing IronPython 2.0 Beta3 In-Reply-To: References: Message-ID: <4853A2B1.7010703@voidspace.org.uk> Hey guys. Are the binaries for Silverlight in this release the *same* as the ones available in the Silverlight Dynamic Languages SDK - or are they more up to date? Thanks Michael Foord Srivatsn Narayanan wrote: > > Hello IronPython Community, > > I?m pleased to announce IronPython 2.0 *Beta 3*. We have fixed around > 34 bugs in this release (~16 of them reported on Codeplex and ~18 > reported internally). Apart from the bug fixes, this release contains > the following improvements: > > ? We have worked on perf ? specifically generators, exception > handling, and shootout perf have improved. We are aware of some > late-breaking degrades which we expect to fix by the next release. > > ? An auto-templating feature has been added to the Dynamic Language > Runtime which should improve performance in highly dynamic scenarios. > > ? cmath and _winreg modules have been implemented. > > There is a change in packaging this time. The Dynamic Silverlight > sources and binaries, compatible with Silverlight 2 Beta 2, are now > included in this release. This makes the package a single place to get > both the desktop and Silverlight versions of IronPython. The Visual > Studio solution file (IronPython.sln) has been updated to build under > ?Silverlight Release? and ?Silverlight Debug? configurations as well. > Please note that this requires Silverlight 2 Beta 2 to build properly. > > IronPython2005.sln is no longer part of the package as was mentioned > in the last beta release notes. This means that Visual Studio > 2008/.NET 3.5 is required to build IronPython.sln. Ofcourse > /toolsversion:2.0 flag can still be passed to msbuild and hence > IronPython can be built to run against .NET 2.0 runtime as well. > > The following codeplex workitems have been closed since IronPython 2.0 > Beta 2: > > ? nt.access is missing Closed Issue Medium Jun 2 at 7:24 PM > > ? Trivial: throw WindowsError (with 'errno' of 17) when nt.mkdir > called on pre-existing directory > > ? '_' is in the result of dir() after first expression evaluation > > ? -X:MTA option not supported by IP 2.0A > > ? expresion-1 if condition else expresion-2 working incorrectly > > ? Python Parser class is internal > > ? PythonType.HasGetAttribute property does not detect inherited > implementation. > > ? _winreg is not implemented > > ? SyntaxError(...).__dict__ is not a dict > > ? Using 'with' statment with IDisposable .NET type doesn't work > > ? IronPython forces objects in sys.meta_path to be new-style classes > > ? imp.load_module("os", ...) broken > > ? DUPLICATE: Run ipyw .exe ( Iron Python 2 Beta 2 ) > > ? REJECTED: Can't create & return nested function from CreateDelegate > > ? id returns Int64 not int or long > > ? Overriding properties has strange syntax > > We?d like to thank everyone in the community who reported these bugs: > py_sunil, jhardy, awilkins, oldman, and 05031972, Ronnie Maor, > Jonathan Amsterdam, sanxiyn, jackeyoo, Thane Plummer, Vizcayno > Tamparantan, Michael Foord, Alex Henderson > > We?ve also closed these bugs that were reported internally: > > ? Trivial: Exception messages are not directed to sys.stderr > > ? Python25: new exception hierarchy > > ? when base class provide over one ctor function,IronPython can not > distinguish them just like Cpython do. > > ? AttributeError: 'file' object has no attribute 'truncate' > > ? ImportError: No module named xxsubtype > > ? cmath module isn't implemented (complex arithmetic) > > ? long("0X20",16) throws ValueError: invalid integer number literal > > ? ImportError: No module named _winreg > > ? dir(*()) returns something unexpected > > ? "print a_super_object" throws TypeError > > ? old style class constructed with an unpacked tuple containing a > single None barfs > > ? DLR crashes with stack overflow when ironpython.dll is missing > > ? Enable turning whole object models dynamic in IronPython > > ? Trivial: There is no "_md5" module in IronPython2.0 when run the > file of test_hmac.py > > ? TypeError: don't know how to disassemble code objects > > ? sys.meta_path is not implemented > > ? calling setattr got an error . > > ? issubclass(Exception,object) return different result against > Ironpython and Cpython > > You can download IronPython 2.0 Beta 3 at: > http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=12988 > > The IronPython Team > > IMPORTANT NOTES > > ToyScript, a small scripting language built on top of the DLR, is > merely a DLR sample and not some new scripting language Microsoft has > created. Also, ToyScript is not intended to be distributed with > IronPython on a permanent basis. > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From sanxiyn at gmail.com Sat Jun 14 13:37:42 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sat, 14 Jun 2008 20:37:42 +0900 Subject: [IronPython] _ast Module In-Reply-To: <4817b6fc0806132336m1dc8b89dr3ba45e353fadcc7c@mail.gmail.com> References: <4817b6fc0806132336m1dc8b89dr3ba45e353fadcc7c@mail.gmail.com> Message-ID: <5b0248170806140437p8e75f5ao95fc23472ede3348@mail.gmail.com> 2008/6/14 Dan Eloff : > Since Jinja appears to be non-trivial to run in Silverlight, I'm also > looking into Mako. Unfortunately, it looks like I hit another brick > wall. Mako uses the _ast module, which is not available in IronPython > as far as I'm aware. Is the ast module in fepy related to this at all? > I'm out of options here too, aren't I? No, FePy's ast module creates AST nodes defined in compiler.ast module, not _ast module. -- Seo Sanghyeon From jdhardy at gmail.com Sat Jun 14 15:59:05 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Sat, 14 Jun 2008 07:59:05 -0600 Subject: [IronPython] _ast Module In-Reply-To: <4817b6fc0806132336m1dc8b89dr3ba45e353fadcc7c@mail.gmail.com> References: <4817b6fc0806132336m1dc8b89dr3ba45e353fadcc7c@mail.gmail.com> Message-ID: There's also Genshi, but that requires the same 'compiler' module support as Mako, IIRC. FePy's ast module didn't work with IronPython 2 the last time I checked, but it has been a while. -Jeff On Sat, Jun 14, 2008 at 12:36 AM, Dan Eloff wrote: > Since Jinja appears to be non-trivial to run in Silverlight, I'm also > looking into Mako. Unfortunately, it looks like I hit another brick > wall. Mako uses the _ast module, which is not available in IronPython > as far as I'm aware. Is the ast module in fepy related to this at all? > I'm out of options here too, aren't I? > > Thanks, > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From jdhardy at gmail.com Sat Jun 14 19:47:52 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Sat, 14 Jun 2008 11:47:52 -0600 Subject: [IronPython] Application Compatibility Documentation on ironpython.info Message-ID: Hi all, I've carved out a section of the ironpython.info wiki to document the compatibility of various python applications (SCons, Trac, etc) and libraries (Genshi, compiler, etc.). There are links off the Contents page, and the direct links are: * http://www.ironpython.info/index.php/Application_Compatibility * http://www.ironpython.info/index.php/Web_Application_Compatibility * http://www.ironpython.info/index.php/Standard_Library_Compatibility * http://www.ironpython.info/index.php/Third-Party_Library_Compatibility I hope others will chip in as well so that this information can be centralized and prevent duplicated effort. -Jeff From srivatsn at microsoft.com Sat Jun 14 19:51:24 2008 From: srivatsn at microsoft.com (Srivatsn Narayanan) Date: Sat, 14 Jun 2008 10:51:24 -0700 Subject: [IronPython] Announcing IronPython 2.0 Beta3 In-Reply-To: <4853A2B1.7010703@voidspace.org.uk> References: <4853A2B1.7010703@voidspace.org.uk> Message-ID: This build was snapped two days after the sdlsdk build. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, June 14, 2008 3:51 AM To: Discussion of IronPython Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 Hey guys. Are the binaries for Silverlight in this release the *same* as the ones available in the Silverlight Dynamic Languages SDK - or are they more up to date? Thanks Michael Foord Srivatsn Narayanan wrote: > > Hello IronPython Community, > > I'm pleased to announce IronPython 2.0 *Beta 3*. We have fixed around > 34 bugs in this release (~16 of them reported on Codeplex and ~18 > reported internally). Apart from the bug fixes, this release contains > the following improvements: > > * We have worked on perf - specifically generators, exception > handling, and shootout perf have improved. We are aware of some > late-breaking degrades which we expect to fix by the next release. > > * An auto-templating feature has been added to the Dynamic Language > Runtime which should improve performance in highly dynamic scenarios. > > * cmath and _winreg modules have been implemented. > > There is a change in packaging this time. The Dynamic Silverlight > sources and binaries, compatible with Silverlight 2 Beta 2, are now > included in this release. This makes the package a single place to get > both the desktop and Silverlight versions of IronPython. The Visual > Studio solution file (IronPython.sln) has been updated to build under > "Silverlight Release" and "Silverlight Debug" configurations as well. > Please note that this requires Silverlight 2 Beta 2 to build properly. > > IronPython2005.sln is no longer part of the package as was mentioned > in the last beta release notes. This means that Visual Studio > 2008/.NET 3.5 is required to build IronPython.sln. Ofcourse > /toolsversion:2.0 flag can still be passed to msbuild and hence > IronPython can be built to run against .NET 2.0 runtime as well. > > The following codeplex workitems have been closed since IronPython 2.0 > Beta 2: > > * nt.access is missing Closed Issue Medium Jun 2 at 7:24 PM > > * Trivial: throw WindowsError (with 'errno' of 17) when nt.mkdir > called on pre-existing directory > > * '_' is in the result of dir() after first expression evaluation > > * -X:MTA option not supported by IP 2.0A > > * expresion-1 if condition else expresion-2 working incorrectly > > * Python Parser class is internal > > * PythonType.HasGetAttribute property does not detect inherited > implementation. > > * _winreg is not implemented > > * SyntaxError(...).__dict__ is not a dict > > * Using 'with' statment with IDisposable .NET type doesn't work > > * IronPython forces objects in sys.meta_path to be new-style classes > > * imp.load_module("os", ...) broken > > * DUPLICATE: Run ipyw .exe ( Iron Python 2 Beta 2 ) > > * REJECTED: Can't create & return nested function from CreateDelegate > > * id returns Int64 not int or long > > * Overriding properties has strange syntax > > We'd like to thank everyone in the community who reported these bugs: > py_sunil, jhardy, awilkins, oldman, and 05031972, Ronnie Maor, > Jonathan Amsterdam, sanxiyn, jackeyoo, Thane Plummer, Vizcayno > Tamparantan, Michael Foord, Alex Henderson > > We've also closed these bugs that were reported internally: > > * Trivial: Exception messages are not directed to sys.stderr > > * Python25: new exception hierarchy > > * when base class provide over one ctor function,IronPython can not > distinguish them just like Cpython do. > > * AttributeError: 'file' object has no attribute 'truncate' > > * ImportError: No module named xxsubtype > > * cmath module isn't implemented (complex arithmetic) > > * long("0X20",16) throws ValueError: invalid integer number literal > > * ImportError: No module named _winreg > > * dir(*()) returns something unexpected > > * "print a_super_object" throws TypeError > > * old style class constructed with an unpacked tuple containing a > single None barfs > > * DLR crashes with stack overflow when ironpython.dll is missing > > * Enable turning whole object models dynamic in IronPython > > * Trivial: There is no "_md5" module in IronPython2.0 when run the > file of test_hmac.py > > * TypeError: don't know how to disassemble code objects > > * sys.meta_path is not implemented > > * calling setattr got an error . > > * issubclass(Exception,object) return different result against > Ironpython and Cpython > > You can download IronPython 2.0 Beta 3 at: > http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=12988 > > The IronPython Team > > IMPORTANT NOTES > > ToyScript, a small scripting language built on top of the DLR, is > merely a DLR sample and not some new scripting language Microsoft has > created. Also, ToyScript is not intended to be distributed with > IronPython on a permanent basis. > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Sat Jun 14 19:55:06 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 14 Jun 2008 18:55:06 +0100 Subject: [IronPython] Announcing IronPython 2.0 Beta3 In-Reply-To: References: <4853A2B1.7010703@voidspace.org.uk> Message-ID: <485405FA.9000502@voidspace.org.uk> Srivatsn Narayanan wrote: > This build was snapped two days after the sdlsdk build. > Hehe. Is that a yes or a no... it sounds like a 'nearly'. :-) Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, June 14, 2008 3:51 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 > > Hey guys. > > Are the binaries for Silverlight in this release the *same* as the ones > available in the Silverlight Dynamic Languages SDK - or are they more up > to date? > > Thanks > > Michael Foord > > Srivatsn Narayanan wrote: > >> Hello IronPython Community, >> >> I'm pleased to announce IronPython 2.0 *Beta 3*. We have fixed around >> 34 bugs in this release (~16 of them reported on Codeplex and ~18 >> reported internally). Apart from the bug fixes, this release contains >> the following improvements: >> >> * We have worked on perf - specifically generators, exception >> handling, and shootout perf have improved. We are aware of some >> late-breaking degrades which we expect to fix by the next release. >> >> * An auto-templating feature has been added to the Dynamic Language >> Runtime which should improve performance in highly dynamic scenarios. >> >> * cmath and _winreg modules have been implemented. >> >> There is a change in packaging this time. The Dynamic Silverlight >> sources and binaries, compatible with Silverlight 2 Beta 2, are now >> included in this release. This makes the package a single place to get >> both the desktop and Silverlight versions of IronPython. The Visual >> Studio solution file (IronPython.sln) has been updated to build under >> "Silverlight Release" and "Silverlight Debug" configurations as well. >> Please note that this requires Silverlight 2 Beta 2 to build properly. >> >> IronPython2005.sln is no longer part of the package as was mentioned >> in the last beta release notes. This means that Visual Studio >> 2008/.NET 3.5 is required to build IronPython.sln. Ofcourse >> /toolsversion:2.0 flag can still be passed to msbuild and hence >> IronPython can be built to run against .NET 2.0 runtime as well. >> >> The following codeplex workitems have been closed since IronPython 2.0 >> Beta 2: >> >> * nt.access is missing Closed Issue Medium Jun 2 at 7:24 PM >> >> * Trivial: throw WindowsError (with 'errno' of 17) when nt.mkdir >> called on pre-existing directory >> >> * '_' is in the result of dir() after first expression evaluation >> >> * -X:MTA option not supported by IP 2.0A >> >> * expresion-1 if condition else expresion-2 working incorrectly >> >> * Python Parser class is internal >> >> * PythonType.HasGetAttribute property does not detect inherited >> implementation. >> >> * _winreg is not implemented >> >> * SyntaxError(...).__dict__ is not a dict >> >> * Using 'with' statment with IDisposable .NET type doesn't work >> >> * IronPython forces objects in sys.meta_path to be new-style classes >> >> * imp.load_module("os", ...) broken >> >> * DUPLICATE: Run ipyw .exe ( Iron Python 2 Beta 2 ) >> >> * REJECTED: Can't create & return nested function from CreateDelegate >> >> * id returns Int64 not int or long >> >> * Overriding properties has strange syntax >> >> We'd like to thank everyone in the community who reported these bugs: >> py_sunil, jhardy, awilkins, oldman, and 05031972, Ronnie Maor, >> Jonathan Amsterdam, sanxiyn, jackeyoo, Thane Plummer, Vizcayno >> Tamparantan, Michael Foord, Alex Henderson >> >> We've also closed these bugs that were reported internally: >> >> * Trivial: Exception messages are not directed to sys.stderr >> >> * Python25: new exception hierarchy >> >> * when base class provide over one ctor function,IronPython can not >> distinguish them just like Cpython do. >> >> * AttributeError: 'file' object has no attribute 'truncate' >> >> * ImportError: No module named xxsubtype >> >> * cmath module isn't implemented (complex arithmetic) >> >> * long("0X20",16) throws ValueError: invalid integer number literal >> >> * ImportError: No module named _winreg >> >> * dir(*()) returns something unexpected >> >> * "print a_super_object" throws TypeError >> >> * old style class constructed with an unpacked tuple containing a >> single None barfs >> >> * DLR crashes with stack overflow when ironpython.dll is missing >> >> * Enable turning whole object models dynamic in IronPython >> >> * Trivial: There is no "_md5" module in IronPython2.0 when run the >> file of test_hmac.py >> >> * TypeError: don't know how to disassemble code objects >> >> * sys.meta_path is not implemented >> >> * calling setattr got an error . >> >> * issubclass(Exception,object) return different result against >> Ironpython and Cpython >> >> You can download IronPython 2.0 Beta 3 at: >> http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=12988 >> >> The IronPython Team >> >> IMPORTANT NOTES >> >> ToyScript, a small scripting language built on top of the DLR, is >> merely a DLR sample and not some new scripting language Microsoft has >> created. Also, ToyScript is not intended to be distributed with >> IronPython on a permanent basis. >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From srivatsn at microsoft.com Sat Jun 14 20:05:15 2008 From: srivatsn at microsoft.com (Srivatsn Narayanan) Date: Sat, 14 Jun 2008 11:05:15 -0700 Subject: [IronPython] Announcing IronPython 2.0 Beta3 In-Reply-To: <485405FA.9000502@voidspace.org.uk> References: <4853A2B1.7010703@voidspace.org.uk> <485405FA.9000502@voidspace.org.uk> Message-ID: That's a nearly but no :) A few checkins were made to IPy/DLR in the two days. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, June 14, 2008 10:55 AM To: Discussion of IronPython Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 Srivatsn Narayanan wrote: > This build was snapped two days after the sdlsdk build. > Hehe. Is that a yes or a no... it sounds like a 'nearly'. :-) Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, June 14, 2008 3:51 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 > > Hey guys. > > Are the binaries for Silverlight in this release the *same* as the ones > available in the Silverlight Dynamic Languages SDK - or are they more up > to date? > > Thanks > > Michael Foord > > Srivatsn Narayanan wrote: > >> Hello IronPython Community, >> >> I'm pleased to announce IronPython 2.0 *Beta 3*. We have fixed around >> 34 bugs in this release (~16 of them reported on Codeplex and ~18 >> reported internally). Apart from the bug fixes, this release contains >> the following improvements: >> >> * We have worked on perf - specifically generators, exception >> handling, and shootout perf have improved. We are aware of some >> late-breaking degrades which we expect to fix by the next release. >> >> * An auto-templating feature has been added to the Dynamic Language >> Runtime which should improve performance in highly dynamic scenarios. >> >> * cmath and _winreg modules have been implemented. >> >> There is a change in packaging this time. The Dynamic Silverlight >> sources and binaries, compatible with Silverlight 2 Beta 2, are now >> included in this release. This makes the package a single place to get >> both the desktop and Silverlight versions of IronPython. The Visual >> Studio solution file (IronPython.sln) has been updated to build under >> "Silverlight Release" and "Silverlight Debug" configurations as well. >> Please note that this requires Silverlight 2 Beta 2 to build properly. >> >> IronPython2005.sln is no longer part of the package as was mentioned >> in the last beta release notes. This means that Visual Studio >> 2008/.NET 3.5 is required to build IronPython.sln. Ofcourse >> /toolsversion:2.0 flag can still be passed to msbuild and hence >> IronPython can be built to run against .NET 2.0 runtime as well. >> >> The following codeplex workitems have been closed since IronPython 2.0 >> Beta 2: >> >> * nt.access is missing Closed Issue Medium Jun 2 at 7:24 PM >> >> * Trivial: throw WindowsError (with 'errno' of 17) when nt.mkdir >> called on pre-existing directory >> >> * '_' is in the result of dir() after first expression evaluation >> >> * -X:MTA option not supported by IP 2.0A >> >> * expresion-1 if condition else expresion-2 working incorrectly >> >> * Python Parser class is internal >> >> * PythonType.HasGetAttribute property does not detect inherited >> implementation. >> >> * _winreg is not implemented >> >> * SyntaxError(...).__dict__ is not a dict >> >> * Using 'with' statment with IDisposable .NET type doesn't work >> >> * IronPython forces objects in sys.meta_path to be new-style classes >> >> * imp.load_module("os", ...) broken >> >> * DUPLICATE: Run ipyw .exe ( Iron Python 2 Beta 2 ) >> >> * REJECTED: Can't create & return nested function from CreateDelegate >> >> * id returns Int64 not int or long >> >> * Overriding properties has strange syntax >> >> We'd like to thank everyone in the community who reported these bugs: >> py_sunil, jhardy, awilkins, oldman, and 05031972, Ronnie Maor, >> Jonathan Amsterdam, sanxiyn, jackeyoo, Thane Plummer, Vizcayno >> Tamparantan, Michael Foord, Alex Henderson >> >> We've also closed these bugs that were reported internally: >> >> * Trivial: Exception messages are not directed to sys.stderr >> >> * Python25: new exception hierarchy >> >> * when base class provide over one ctor function,IronPython can not >> distinguish them just like Cpython do. >> >> * AttributeError: 'file' object has no attribute 'truncate' >> >> * ImportError: No module named xxsubtype >> >> * cmath module isn't implemented (complex arithmetic) >> >> * long("0X20",16) throws ValueError: invalid integer number literal >> >> * ImportError: No module named _winreg >> >> * dir(*()) returns something unexpected >> >> * "print a_super_object" throws TypeError >> >> * old style class constructed with an unpacked tuple containing a >> single None barfs >> >> * DLR crashes with stack overflow when ironpython.dll is missing >> >> * Enable turning whole object models dynamic in IronPython >> >> * Trivial: There is no "_md5" module in IronPython2.0 when run the >> file of test_hmac.py >> >> * TypeError: don't know how to disassemble code objects >> >> * sys.meta_path is not implemented >> >> * calling setattr got an error . >> >> * issubclass(Exception,object) return different result against >> Ironpython and Cpython >> >> You can download IronPython 2.0 Beta 3 at: >> http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=12988 >> >> The IronPython Team >> >> IMPORTANT NOTES >> >> ToyScript, a small scripting language built on top of the DLR, is >> merely a DLR sample and not some new scripting language Microsoft has >> created. Also, ToyScript is not intended to be distributed with >> IronPython on a permanent basis. >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Sat Jun 14 20:07:26 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 14 Jun 2008 19:07:26 +0100 Subject: [IronPython] Announcing IronPython 2.0 Beta3 In-Reply-To: References: <4853A2B1.7010703@voidspace.org.uk> <485405FA.9000502@voidspace.org.uk> Message-ID: <485408DE.7050906@voidspace.org.uk> Srivatsn Narayanan wrote: > That's a nearly but no :) A few checkins were made to IPy/DLR in the two days. > Ok - thanks. It does seem slightly confusing that to work with the latest version of IronPython for Silverlight we need to download the sldsdk (which includes IronPython) - and then another version of IronPython. As they are now separate, would it make sense to offer a version of the SDK with just the tools and templates? Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, June 14, 2008 10:55 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 > > Srivatsn Narayanan wrote: > >> This build was snapped two days after the sdlsdk build. >> >> > > Hehe. Is that a yes or a no... it sounds like a 'nearly'. :-) > > Michael > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Saturday, June 14, 2008 3:51 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 >> >> Hey guys. >> >> Are the binaries for Silverlight in this release the *same* as the ones >> available in the Silverlight Dynamic Languages SDK - or are they more up >> to date? >> >> Thanks >> >> Michael Foord >> >> Srivatsn Narayanan wrote: >> >> >>> Hello IronPython Community, >>> >>> I'm pleased to announce IronPython 2.0 *Beta 3*. We have fixed around >>> 34 bugs in this release (~16 of them reported on Codeplex and ~18 >>> reported internally). Apart from the bug fixes, this release contains >>> the following improvements: >>> >>> * We have worked on perf - specifically generators, exception >>> handling, and shootout perf have improved. We are aware of some >>> late-breaking degrades which we expect to fix by the next release. >>> >>> * An auto-templating feature has been added to the Dynamic Language >>> Runtime which should improve performance in highly dynamic scenarios. >>> >>> * cmath and _winreg modules have been implemented. >>> >>> There is a change in packaging this time. The Dynamic Silverlight >>> sources and binaries, compatible with Silverlight 2 Beta 2, are now >>> included in this release. This makes the package a single place to get >>> both the desktop and Silverlight versions of IronPython. The Visual >>> Studio solution file (IronPython.sln) has been updated to build under >>> "Silverlight Release" and "Silverlight Debug" configurations as well. >>> Please note that this requires Silverlight 2 Beta 2 to build properly. >>> >>> IronPython2005.sln is no longer part of the package as was mentioned >>> in the last beta release notes. This means that Visual Studio >>> 2008/.NET 3.5 is required to build IronPython.sln. Ofcourse >>> /toolsversion:2.0 flag can still be passed to msbuild and hence >>> IronPython can be built to run against .NET 2.0 runtime as well. >>> >>> The following codeplex workitems have been closed since IronPython 2.0 >>> Beta 2: >>> >>> * nt.access is missing Closed Issue Medium Jun 2 at 7:24 PM >>> >>> * Trivial: throw WindowsError (with 'errno' of 17) when nt.mkdir >>> called on pre-existing directory >>> >>> * '_' is in the result of dir() after first expression evaluation >>> >>> * -X:MTA option not supported by IP 2.0A >>> >>> * expresion-1 if condition else expresion-2 working incorrectly >>> >>> * Python Parser class is internal >>> >>> * PythonType.HasGetAttribute property does not detect inherited >>> implementation. >>> >>> * _winreg is not implemented >>> >>> * SyntaxError(...).__dict__ is not a dict >>> >>> * Using 'with' statment with IDisposable .NET type doesn't work >>> >>> * IronPython forces objects in sys.meta_path to be new-style classes >>> >>> * imp.load_module("os", ...) broken >>> >>> * DUPLICATE: Run ipyw .exe ( Iron Python 2 Beta 2 ) >>> >>> * REJECTED: Can't create & return nested function from CreateDelegate >>> >>> * id returns Int64 not int or long >>> >>> * Overriding properties has strange syntax >>> >>> We'd like to thank everyone in the community who reported these bugs: >>> py_sunil, jhardy, awilkins, oldman, and 05031972, Ronnie Maor, >>> Jonathan Amsterdam, sanxiyn, jackeyoo, Thane Plummer, Vizcayno >>> Tamparantan, Michael Foord, Alex Henderson >>> >>> We've also closed these bugs that were reported internally: >>> >>> * Trivial: Exception messages are not directed to sys.stderr >>> >>> * Python25: new exception hierarchy >>> >>> * when base class provide over one ctor function,IronPython can not >>> distinguish them just like Cpython do. >>> >>> * AttributeError: 'file' object has no attribute 'truncate' >>> >>> * ImportError: No module named xxsubtype >>> >>> * cmath module isn't implemented (complex arithmetic) >>> >>> * long("0X20",16) throws ValueError: invalid integer number literal >>> >>> * ImportError: No module named _winreg >>> >>> * dir(*()) returns something unexpected >>> >>> * "print a_super_object" throws TypeError >>> >>> * old style class constructed with an unpacked tuple containing a >>> single None barfs >>> >>> * DLR crashes with stack overflow when ironpython.dll is missing >>> >>> * Enable turning whole object models dynamic in IronPython >>> >>> * Trivial: There is no "_md5" module in IronPython2.0 when run the >>> file of test_hmac.py >>> >>> * TypeError: don't know how to disassemble code objects >>> >>> * sys.meta_path is not implemented >>> >>> * calling setattr got an error . >>> >>> * issubclass(Exception,object) return different result against >>> Ironpython and Cpython >>> >>> You can download IronPython 2.0 Beta 3 at: >>> http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=12988 >>> >>> The IronPython Team >>> >>> IMPORTANT NOTES >>> >>> ToyScript, a small scripting language built on top of the DLR, is >>> merely a DLR sample and not some new scripting language Microsoft has >>> created. Also, ToyScript is not intended to be distributed with >>> IronPython on a permanent basis. >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >>> >> -- >> http://www.ironpythoninaction.com/ >> http://www.theotherdelia.co.uk/ >> http://www.voidspace.org.uk/ >> http://www.ironpython.info/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From srivatsn at microsoft.com Sat Jun 14 20:14:39 2008 From: srivatsn at microsoft.com (Srivatsn Narayanan) Date: Sat, 14 Jun 2008 11:14:39 -0700 Subject: [IronPython] Announcing IronPython 2.0 Beta3 In-Reply-To: <485408DE.7050906@voidspace.org.uk> References: <4853A2B1.7010703@voidspace.org.uk> <485405FA.9000502@voidspace.org.uk> <485408DE.7050906@voidspace.org.uk> Message-ID: By tools and templates you mean the 'script' folder in the sdlsdk-bin zipfile right? Jimmy did point that out but it was fairly late then. We could include that in the IPy package itself from next time onwards. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, June 14, 2008 11:07 AM To: Discussion of IronPython Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 Srivatsn Narayanan wrote: > That's a nearly but no :) A few checkins were made to IPy/DLR in the two days. > Ok - thanks. It does seem slightly confusing that to work with the latest version of IronPython for Silverlight we need to download the sldsdk (which includes IronPython) - and then another version of IronPython. As they are now separate, would it make sense to offer a version of the SDK with just the tools and templates? Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, June 14, 2008 10:55 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 > > Srivatsn Narayanan wrote: > >> This build was snapped two days after the sdlsdk build. >> >> > > Hehe. Is that a yes or a no... it sounds like a 'nearly'. :-) > > Michael > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Saturday, June 14, 2008 3:51 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 >> >> Hey guys. >> >> Are the binaries for Silverlight in this release the *same* as the ones >> available in the Silverlight Dynamic Languages SDK - or are they more up >> to date? >> >> Thanks >> >> Michael Foord >> >> Srivatsn Narayanan wrote: >> >> >>> Hello IronPython Community, >>> >>> I'm pleased to announce IronPython 2.0 *Beta 3*. We have fixed around >>> 34 bugs in this release (~16 of them reported on Codeplex and ~18 >>> reported internally). Apart from the bug fixes, this release contains >>> the following improvements: >>> >>> * We have worked on perf - specifically generators, exception >>> handling, and shootout perf have improved. We are aware of some >>> late-breaking degrades which we expect to fix by the next release. >>> >>> * An auto-templating feature has been added to the Dynamic Language >>> Runtime which should improve performance in highly dynamic scenarios. >>> >>> * cmath and _winreg modules have been implemented. >>> >>> There is a change in packaging this time. The Dynamic Silverlight >>> sources and binaries, compatible with Silverlight 2 Beta 2, are now >>> included in this release. This makes the package a single place to get >>> both the desktop and Silverlight versions of IronPython. The Visual >>> Studio solution file (IronPython.sln) has been updated to build under >>> "Silverlight Release" and "Silverlight Debug" configurations as well. >>> Please note that this requires Silverlight 2 Beta 2 to build properly. >>> >>> IronPython2005.sln is no longer part of the package as was mentioned >>> in the last beta release notes. This means that Visual Studio >>> 2008/.NET 3.5 is required to build IronPython.sln. Ofcourse >>> /toolsversion:2.0 flag can still be passed to msbuild and hence >>> IronPython can be built to run against .NET 2.0 runtime as well. >>> >>> The following codeplex workitems have been closed since IronPython 2.0 >>> Beta 2: >>> >>> * nt.access is missing Closed Issue Medium Jun 2 at 7:24 PM >>> >>> * Trivial: throw WindowsError (with 'errno' of 17) when nt.mkdir >>> called on pre-existing directory >>> >>> * '_' is in the result of dir() after first expression evaluation >>> >>> * -X:MTA option not supported by IP 2.0A >>> >>> * expresion-1 if condition else expresion-2 working incorrectly >>> >>> * Python Parser class is internal >>> >>> * PythonType.HasGetAttribute property does not detect inherited >>> implementation. >>> >>> * _winreg is not implemented >>> >>> * SyntaxError(...).__dict__ is not a dict >>> >>> * Using 'with' statment with IDisposable .NET type doesn't work >>> >>> * IronPython forces objects in sys.meta_path to be new-style classes >>> >>> * imp.load_module("os", ...) broken >>> >>> * DUPLICATE: Run ipyw .exe ( Iron Python 2 Beta 2 ) >>> >>> * REJECTED: Can't create & return nested function from CreateDelegate >>> >>> * id returns Int64 not int or long >>> >>> * Overriding properties has strange syntax >>> >>> We'd like to thank everyone in the community who reported these bugs: >>> py_sunil, jhardy, awilkins, oldman, and 05031972, Ronnie Maor, >>> Jonathan Amsterdam, sanxiyn, jackeyoo, Thane Plummer, Vizcayno >>> Tamparantan, Michael Foord, Alex Henderson >>> >>> We've also closed these bugs that were reported internally: >>> >>> * Trivial: Exception messages are not directed to sys.stderr >>> >>> * Python25: new exception hierarchy >>> >>> * when base class provide over one ctor function,IronPython can not >>> distinguish them just like Cpython do. >>> >>> * AttributeError: 'file' object has no attribute 'truncate' >>> >>> * ImportError: No module named xxsubtype >>> >>> * cmath module isn't implemented (complex arithmetic) >>> >>> * long("0X20",16) throws ValueError: invalid integer number literal >>> >>> * ImportError: No module named _winreg >>> >>> * dir(*()) returns something unexpected >>> >>> * "print a_super_object" throws TypeError >>> >>> * old style class constructed with an unpacked tuple containing a >>> single None barfs >>> >>> * DLR crashes with stack overflow when ironpython.dll is missing >>> >>> * Enable turning whole object models dynamic in IronPython >>> >>> * Trivial: There is no "_md5" module in IronPython2.0 when run the >>> file of test_hmac.py >>> >>> * TypeError: don't know how to disassemble code objects >>> >>> * sys.meta_path is not implemented >>> >>> * calling setattr got an error . >>> >>> * issubclass(Exception,object) return different result against >>> Ironpython and Cpython >>> >>> You can download IronPython 2.0 Beta 3 at: >>> http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=12988 >>> >>> The IronPython Team >>> >>> IMPORTANT NOTES >>> >>> ToyScript, a small scripting language built on top of the DLR, is >>> merely a DLR sample and not some new scripting language Microsoft has >>> created. Also, ToyScript is not intended to be distributed with >>> IronPython on a permanent basis. >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >>> >> -- >> http://www.ironpythoninaction.com/ >> http://www.theotherdelia.co.uk/ >> http://www.voidspace.org.uk/ >> http://www.ironpython.info/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Sat Jun 14 20:20:30 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 14 Jun 2008 19:20:30 +0100 Subject: [IronPython] Application Compatibility Documentation on ironpython.info In-Reply-To: References: Message-ID: <48540BEE.2050909@voidspace.org.uk> That's great! Those pages could do with filling in though... :-) Michael Jeff Hardy wrote: > Hi all, > I've carved out a section of the ironpython.info wiki to document the > compatibility of various python applications (SCons, Trac, etc) and > libraries (Genshi, compiler, etc.). There are links off the Contents > page, and the direct links are: > > * http://www.ironpython.info/index.php/Application_Compatibility > * http://www.ironpython.info/index.php/Web_Application_Compatibility > * http://www.ironpython.info/index.php/Standard_Library_Compatibility > * http://www.ironpython.info/index.php/Third-Party_Library_Compatibility > > I hope others will chip in as well so that this information can be > centralized and prevent duplicated effort. > > -Jeff > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From jdhardy at gmail.com Sat Jun 14 22:19:25 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Sat, 14 Jun 2008 14:19:25 -0600 Subject: [IronPython] Application Compatibility Documentation on ironpython.info In-Reply-To: <48540BEE.2050909@voidspace.org.uk> References: <48540BEE.2050909@voidspace.org.uk> Message-ID: I'm only one man... :) On Sat, Jun 14, 2008 at 12:20 PM, Michael Foord wrote: > That's great! Those pages could do with filling in though... :-) > > Michael > > Jeff Hardy wrote: >> >> Hi all, >> I've carved out a section of the ironpython.info wiki to document the >> compatibility of various python applications (SCons, Trac, etc) and >> libraries (Genshi, compiler, etc.). There are links off the Contents >> page, and the direct links are: >> >> * http://www.ironpython.info/index.php/Application_Compatibility >> * http://www.ironpython.info/index.php/Web_Application_Compatibility >> * http://www.ironpython.info/index.php/Standard_Library_Compatibility >> * http://www.ironpython.info/index.php/Third-Party_Library_Compatibility >> >> I hope others will chip in as well so that this information can be >> centralized and prevent duplicated effort. >> >> -Jeff >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From jonathan at slenders.be Sat Jun 14 22:54:38 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Sat, 14 Jun 2008 22:54:38 +0200 Subject: [IronPython] Application Compatibility Documentation on ironpython.info In-Reply-To: References: <48540BEE.2050909@voidspace.org.uk> Message-ID: This overview is really useful, I added the Pygments library several hours ago. Within the next months, I'll probably do some testing with other libraries and add them as well. 2008/6/14 Jeff Hardy : > I'm only one man... :) > > On Sat, Jun 14, 2008 at 12:20 PM, Michael Foord > wrote: > > That's great! Those pages could do with filling in though... :-) > > > > Michael > > > > Jeff Hardy wrote: > >> > >> Hi all, > >> I've carved out a section of the ironpython.info wiki to document the > >> compatibility of various python applications (SCons, Trac, etc) and > >> libraries (Genshi, compiler, etc.). There are links off the Contents > >> page, and the direct links are: > >> > >> * http://www.ironpython.info/index.php/Application_Compatibility > >> * http://www.ironpython.info/index.php/Web_Application_Compatibility > >> * http://www.ironpython.info/index.php/Standard_Library_Compatibility > >> * > http://www.ironpython.info/index.php/Third-Party_Library_Compatibility > >> > >> I hope others will chip in as well so that this information can be > >> centralized and prevent duplicated effort. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Sat Jun 14 23:09:20 2008 From: jdhardy at gmail.com (Jeff Hardy) Date: Sat, 14 Jun 2008 15:09:20 -0600 Subject: [IronPython] Error running Django Message-ID: Hi, I'm trying to get Django trunk running with 2.0b3 and NWSGI. I get the error below when running under IIS7; I tried VS2008, but it gives a different error. I'm just not sure if this is an IronPython issue, a Django issue, or a NWSGI issue. It looks like Django is doing some funky stuff that IP doesn't know how to handle, but I'm not sure. Running Django's WSGI handler from the command line instead of NWSGI resulted in the same error. Anybody have any ideas? -Jeff ------------------------------- Server Error in '/django-demo' Application. -------------------------------------------------------------------------------- Operation is not valid due to the current state of the object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Operation is not valid due to the current state of the object. Source Error: Line 161: self.__dispatch[resultclass] = {} Line 162: for (k, v) in resultclass.__dict__.items(): *Line 163: setattr(self, k, self.__promise__(resultclass, k, v)) Line 164: self._delegate_str = str in resultclasses Line 165: self._delegate_unicode = unicode in resultclasses Source File: C:\inetpub\wwwroot\django-demo\bin\Lib\django\utils\functional.py Line: 163 Stack Trace: [InvalidOperationException: Operation is not valid due to the current state of the object.] IronPython.Runtime.Operations.PythonOps.SlotSetValue(CodeContext context, PythonTypeSlot slot, Object instance, PythonType owner, Object value) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Operations\PythonOps.cs:2842 _stub_$3980##1168(Closure , CallSite , CodeContext , Object , Object ) +228 _stub_MatchCaller(Object , CallSite , Object[] ) +112 Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\CallSite.cs:297 Microsoft.Scripting.Actions.UpdateDelegates.Update3(CallSite site, T0 arg0, T1 arg1, T2 arg2) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\UpdateDelegates.Generated.cs:41 Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting\Actions\DynamicSite.Generated.cs:86 IronPython.Runtime.Operations.PythonOps.SetAttr(CodeContext context, Object o, SymbolId name, Object value) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Operations\PythonOps.cs:1055 IronPython.Runtime.Builtin.setattr(CodeContext context, Object o, String name, Object val) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Builtin.cs:1440 _stub_$3928##1116(Closure , CallSite , CodeContext , Object , Object , Object , Object ) +253 OptScope_functional$31.__init__$1435(Closure , Object self, Object args, Object kw) in C:\inetpub\wwwroot\django-demo\bin\Lib\django\utils\functional.py:163 _stub_$3913##1101(Closure , CallSite , CodeContext , Object , Object , Object , Object ) +209 _stub_MatchCaller(Object , CallSite , Object[] ) +152 Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\CallSite.cs:297 Microsoft.Scripting.Actions.UpdateDelegates.Update5(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\UpdateDelegates.Generated.cs:55 _stub_$3912##1100(Closure , CallSite , CodeContext , Object , Object , Object ) +286 _stub_MatchCaller(Object , CallSite , Object[] ) +132 Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\CallSite.cs:297 Microsoft.Scripting.Actions.UpdateDelegates.Update4(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\UpdateDelegates.Generated.cs:48 _stub_$3911##1099(Closure , CallSite , CodeContext , Object , Object , Object ) +409 _stub_MatchCaller(Object , CallSite , Object[] ) +132 Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\CallSite.cs:297 Microsoft.Scripting.Actions.UpdateDelegates.Update4(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\UpdateDelegates.Generated.cs:48 OptScope_functional$31.__wrapper__$1445(Closure , Object args, Object kw) in C:\inetpub\wwwroot\django-demo\bin\Lib\django\utils\functional.py:223 OptScope_functional$31.__wrapper__$1445(Closure , Object[] ) +177 _stub_$3910##1098(Closure , CallSite , CodeContext , Object , String ) +306 _stub_MatchCaller(Object , CallSite , Object[] ) +139 Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\CallSite.cs:297 Microsoft.Scripting.Actions.UpdateDelegates.Update3(CallSite site, T0 arg0, T1 arg1, T2 arg2) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\UpdateDelegates.Generated.cs:41 OptScope_validators$99.RequiredIfOtherFieldNotGiven$3047(Closure ) in C:\inetpub\wwwroot\django-demo\bin\Lib\django\core\validators.py:307 IronPython.Runtime.Operations.PythonOps.MakeClass(CodeContext context, String name, Object[] bases, String selfNames, CallTarget0 body) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Operations\PythonOps.cs:1642 OptScope_validators$99.Initialize(CodeContext ) in C:\inetpub\wwwroot\django-demo\bin\Lib\django\core\validators.py:542 Microsoft.Scripting.ScriptCode.Run(CodeContext context) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Runtime\ScriptCode.cs:118 Microsoft.Scripting.ScriptCode.Run(Scope scope) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Runtime\ScriptCode.cs:111 IronPython.Runtime.PythonContext.CreateModule(String fileName, Scope scope, ScriptCode scriptCode, ModuleOptions options) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\PythonContext.cs:643 IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options, ScriptCode& scriptCode) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\PythonContext.cs:567 IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\PythonContext.cs:556 IronPython.Runtime.Importer.LoadFromSourceUnit(CodeContext context, SourceUnit sourceCode, String name, String path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:732 IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:694 IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:648 IronPython.Runtime.Importer.ImportNestedModule(CodeContext context, Scope scope, String name, List path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:504 IronPython.Runtime.Importer.ImportFrom(CodeContext context, Object from, String name) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:100 IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Builtin.cs:127 IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Builtin.cs:103 _stub_$2##1(Closure , CallSite , CodeContext , Object , String , IAttributesCollection , IAttributesCollection , PythonTuple ) +143 Microsoft.Scripting.Actions.DynamicSite`6.Invoke(CodeContext context, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting\Actions\DynamicSite.Generated.cs:182 IronPython.Runtime.Importer.Import(CodeContext context, String fullName, PythonTuple from, Int32 level) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:56 IronPython.Runtime.Operations.PythonOps.ImportWithNames(CodeContext context, String fullName, String[] names, Int32 level) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Operations\PythonOps.cs:1994 OptScope___init__$98.Initialize(CodeContext ) in C:\inetpub\wwwroot\django-demo\bin\Lib\django\db\models\__init__.py:19 Microsoft.Scripting.ScriptCode.Run(CodeContext context) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Runtime\ScriptCode.cs:118 Microsoft.Scripting.ScriptCode.Run(Scope scope) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Runtime\ScriptCode.cs:111 IronPython.Runtime.PythonContext.CreateModule(String fileName, Scope scope, ScriptCode scriptCode, ModuleOptions options) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\PythonContext.cs:643 IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options, ScriptCode& scriptCode) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\PythonContext.cs:567 IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\PythonContext.cs:556 IronPython.Runtime.Importer.LoadFromSourceUnit(CodeContext context, SourceUnit sourceCode, String name, String path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:732 IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:694 IronPython.Runtime.Importer.LoadPackageFromSource(CodeContext context, String name, String path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:727 IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:642 IronPython.Runtime.Importer.ImportNestedModule(CodeContext context, Scope scope, String name, List path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:504 IronPython.Runtime.Importer.ImportFrom(CodeContext context, Object from, String name) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:100 IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Builtin.cs:127 IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Builtin.cs:103 _stub_$2##1(Closure , CallSite , CodeContext , Object , String , IAttributesCollection , IAttributesCollection , PythonTuple ) +143 Microsoft.Scripting.Actions.DynamicSite`6.Invoke(CodeContext context, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting\Actions\DynamicSite.Generated.cs:182 IronPython.Runtime.Importer.Import(CodeContext context, String fullName, PythonTuple from, Int32 level) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:56 IronPython.Runtime.Operations.PythonOps.ImportWithNames(CodeContext context, String fullName, String[] names, Int32 level) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Operations\PythonOps.cs:1994 OptScope_models$92.Initialize(CodeContext ) in C:\inetpub\wwwroot\django-demo\bin\Lib\django\contrib\sessions\models.py:24 Microsoft.Scripting.ScriptCode.Run(CodeContext context) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Runtime\ScriptCode.cs:118 Microsoft.Scripting.ScriptCode.Run(Scope scope) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Runtime\ScriptCode.cs:111 IronPython.Runtime.PythonContext.CreateModule(String fileName, Scope scope, ScriptCode scriptCode, ModuleOptions options) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\PythonContext.cs:643 IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options, ScriptCode& scriptCode) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\PythonContext.cs:567 IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\PythonContext.cs:556 IronPython.Runtime.Importer.LoadFromSourceUnit(CodeContext context, SourceUnit sourceCode, String name, String path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:732 IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:694 IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:648 IronPython.Runtime.Importer.ImportNestedModule(CodeContext context, Scope scope, String name, List path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:504 IronPython.Runtime.Importer.ImportModuleFrom(CodeContext context, Object from, String name) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:121 IronPython.Runtime.Importer.ImportModule(CodeContext context, Object globals, String modName, Boolean bottom, Int32 level) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:192 IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Builtin.cs:111 IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Builtin.cs:103 _stub_$2##1(Closure , CallSite , CodeContext , Object , String , IAttributesCollection , IAttributesCollection , PythonTuple ) +143 Microsoft.Scripting.Actions.DynamicSite`6.Invoke(CodeContext context, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting\Actions\DynamicSite.Generated.cs:182 IronPython.Runtime.Importer.Import(CodeContext context, String fullName, PythonTuple from, Int32 level) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:56 IronPython.Runtime.Operations.PythonOps.ImportWithNames(CodeContext context, String fullName, String[] names, Int32 level) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Operations\PythonOps.cs:1994 OptScope_db$91.Initialize(CodeContext ) in C:\inetpub\wwwroot\django-demo\bin\Lib\django\contrib\sessions\backends\db.py:7 Microsoft.Scripting.ScriptCode.Run(CodeContext context) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Runtime\ScriptCode.cs:118 Microsoft.Scripting.ScriptCode.Run(Scope scope) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Runtime\ScriptCode.cs:111 IronPython.Runtime.PythonContext.CreateModule(String fileName, Scope scope, ScriptCode scriptCode, ModuleOptions options) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\PythonContext.cs:643 IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options, ScriptCode& scriptCode) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\PythonContext.cs:567 IronPython.Runtime.PythonContext.CompileModule(String fileName, String moduleName, SourceUnit sourceCode, ModuleOptions options) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\PythonContext.cs:556 IronPython.Runtime.Importer.LoadFromSourceUnit(CodeContext context, SourceUnit sourceCode, String name, String path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:732 IronPython.Runtime.Importer.LoadModuleFromSource(CodeContext context, String name, String path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:694 IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:648 IronPython.Runtime.Importer.ImportNestedModule(CodeContext context, Scope scope, String name, List path) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:504 IronPython.Runtime.Importer.ImportModuleFrom(CodeContext context, Object from, String name) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:121 IronPython.Runtime.Importer.ImportModule(CodeContext context, Object globals, String modName, Boolean bottom, Int32 level) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Importer.cs:192 IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist, Int32 level) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Builtin.cs:111 IronPython.Runtime.Builtin.__import__(CodeContext context, String name, Object globals, Object locals, Object fromlist) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\IronPython\Runtime\Builtin.cs:103 _stub_$1930##606(Closure , CallSite , CodeContext , Object , Object , PythonDictionary , PythonDictionary , List ) +270 _stub_MatchCaller(Object , CallSite , Object[] ) +258 Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\CallSite.cs:253 Microsoft.Scripting.Actions.UpdateDelegates.Update6(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\UpdateDelegates.Generated.cs:62 OptScope_middleware$80.process_request$2612(Closure , Object self, Object request) in C:\inetpub\wwwroot\django-demo\bin\Lib\django\contrib\sessions\middleware.py:13 _stub_$2770##844(Closure , CallSite , CodeContext , Object , Object , Object ) +195 _stub_$2769##843(Closure , CallSite , CodeContext , Object , Object ) +273 OptScope_base$35.get_response$1490(Closure , Object self, Object request) in C:\inetpub\wwwroot\django-demo\bin\Lib\django\core\handlers\base.py:64 _stub_$2770##844(Closure , CallSite , CodeContext , Object , Object , Object ) +195 _stub_MatchCaller(Object , CallSite , Object[] ) +132 Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\CallSite.cs:297 Microsoft.Scripting.Actions.UpdateDelegates.Update4(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\UpdateDelegates.Generated.cs:48 _stub_$2769##843(Closure , CallSite , CodeContext , Object , Object ) +273 _stub_MatchCaller(Object , CallSite , Object[] ) +112 Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\CallSite.cs:297 Microsoft.Scripting.Actions.UpdateDelegates.Update3(CallSite site, T0 arg0, T1 arg1, T2 arg2) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\UpdateDelegates.Generated.cs:41 OptScope_wsgi$9.__call__$306(Closure , Object self, Object environ, Object start_response) in C:\inetpub\wwwroot\django-demo\bin\Lib\django\core\handlers\wsgi.py:205 _stub_$1651##376(Closure , CallSite , CodeContext , Object , Object , Object , Object ) +209 _stub_MatchCaller(Object , CallSite , Object[] ) +152 Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\CallSite.cs:297 Microsoft.Scripting.Actions.UpdateDelegates.Update5(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\UpdateDelegates.Generated.cs:55 _stub_$1650##375(Closure , CallSite , CodeContext , Object , Object , Object ) +286 _stub_MatchCaller(Object , CallSite , Object[] ) +132 Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\CallSite.cs:297 Microsoft.Scripting.Actions.UpdateDelegates.Update4(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\UpdateDelegates.Generated.cs:48 _stub_$1649##374(Closure , CallSite , CodeContext , Object , Object , Object ) +377 _stub_MatchCaller(Object , CallSite , Object[] ) +132 Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\CallSite.cs:297 Microsoft.Scripting.Actions.UpdateDelegates.Update4(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) in C:\Users\Jeff\Documents\Repositories\IronPython-2.0B3\Src\Microsoft.Scripting.Core\Actions\UpdateDelegates.Generated.cs:48 System.Collections.IEnumerable(PythonDictionary, StartResponseDelegate)(Object[] , PythonDictionary , StartResponseDelegate ) +134 NWSGI.WsgiHandler.ProcessRequest(HttpContext context) in C:\Users\Jeff\Documents\Repositories\NWSGI\NWSGI\NWSGI\WsgiHandler.cs:115 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +638 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +177 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434 From ckupec at mvlc.org Sat Jun 14 23:17:17 2008 From: ckupec at mvlc.org (joeymcjoejoe) Date: Sat, 14 Jun 2008 14:17:17 -0700 (PDT) Subject: [IronPython] How do I set assembly information in IronPython? Message-ID: <17828121.post@talk.nabble.com> This is what I had in an old vb file that I long ago compiled into an exe: Imports System Imports System.IO Imports System.Runtime.InteropServices Imports Microsoft.VisualBasic Imports System.Reflection ... I've got the rest of the vb code translated into IronPython, and it works on the machine I'm doing this on. I can create an executable from it using pyc.py, and that works fine on this machine too, but I can't get that transferred exe file to work on another machine, I think because it doesn't have valid Assembly info in it. So how does one do that? I wanted to make a distributable exe out of the script so that the individual machines won't have to install IronPython, Python 2.5, etc. The actual error I get on the second machine is "error signature". Doable? -- View this message in context: http://www.nabble.com/How-do-I-set-assembly-information-in-IronPython--tp17828121p17828121.html Sent from the IronPython mailing list archive at Nabble.com. From fuzzyman at voidspace.org.uk Sat Jun 14 23:20:36 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 14 Jun 2008 22:20:36 +0100 Subject: [IronPython] How do I set assembly information in IronPython? In-Reply-To: <17828121.post@talk.nabble.com> References: <17828121.post@talk.nabble.com> Message-ID: <48543624.7050501@voidspace.org.uk> joeymcjoejoe wrote: > This is what I had in an old vb file that I long ago compiled into an exe: > > Imports System > Imports System.IO > Imports System.Runtime.InteropServices > Imports Microsoft.VisualBasic > Imports System.Reflection > > > > > > > > ... > > I've got the rest of the vb code translated into IronPython, and it works on > the machine I'm doing this on. I can create an executable from it using > pyc.py, and that works fine on this machine too, but I can't get that > transferred exe file to work on another machine, I think because it doesn't > have valid Assembly info in it. So how does one do that? I wanted to make a > distributable exe out of the script so that the individual machines won't > have to install IronPython, Python 2.5, etc. The actual error I get on the > second machine is "error signature". > > Doable? > > > What error do you get on the other machine? Does the program work when run from source with IronPython on the other machine? Michael Foord -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Sun Jun 15 01:46:42 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 15 Jun 2008 00:46:42 +0100 Subject: [IronPython] First cut of an interactive IronPython Interpreter running in the browser Message-ID: <48545862.7050305@voidspace.org.uk> Well, I've finally converted my Silverlight interactive interpreter to work with Silverlight 2 Beta 2 - and it works! http://www.voidspace.org.uk/ironpython/silverlight-console/console.html There's no download yet and I've only tested on Firefox 3 and Safari (but the Javascript works on both as far as I can tell - more work probably needed to get it working on FF 2 and IE). It also doesn't include much of the standard library yet either - but this could be great for tutorials and interactive documentation. Michael Foord -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Sun Jun 15 01:51:41 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 15 Jun 2008 00:51:41 +0100 Subject: [IronPython] First cut of an interactive IronPython Interpreter running in the browser In-Reply-To: <48545862.7050305@voidspace.org.uk> References: <48545862.7050305@voidspace.org.uk> Message-ID: <4854598D.7020201@voidspace.org.uk> Michael Foord wrote: > Well, I've finally converted my Silverlight interactive interpreter to > work with Silverlight 2 Beta 2 - and it works! > Hmmm... damn. Still doesn't handle syntax errors properly. This may well be the fault of my code though - I'll need to look into it. For non syntax-errors it seems to be working fine. If you really want to see the source you can get it from the xap file: http://www.voidspace.org.uk/ironpython/silverlight-console/ I might start a google project to get an SVN repository for the code. Michael Foord > http://www.voidspace.org.uk/ironpython/silverlight-console/console.html > > There's no download yet and I've only tested on Firefox 3 and Safari > (but the Javascript works on both as far as I can tell - more work > probably needed to get it working on FF 2 and IE). > > It also doesn't include much of the standard library yet either - but > this could be great for tutorials and interactive documentation. > > Michael Foord > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From ckupec at mvlc.org Sun Jun 15 02:41:20 2008 From: ckupec at mvlc.org (joeymcjoejoe) Date: Sat, 14 Jun 2008 17:41:20 -0700 (PDT) Subject: [IronPython] How do I set assembly information in IronPython? In-Reply-To: <48543624.7050501@voidspace.org.uk> References: <17828121.post@talk.nabble.com> <48543624.7050501@voidspace.org.uk> Message-ID: <17845282.post@talk.nabble.com> Michael Foord-5 wrote: > > > What error do you get on the other machine? Does the program work when > run from source with IronPython on the other machine? > > Michael Foord > > You got me to the answer. The source worked fine on the second machine, so I read through the Pyc readme again. _Now_ I know what this line in the Pyc readme means:"The compiled executables require the presence of IronPython.dll and IronMath.dll in the current directory." The _executable_ needs them. I thought it was just when making the executable that they needed to be present. So that explains the following: I was getting the "Error Signature" alert box with the usual "there was some unpleasantness..." if I ran it straight from the desktop. I popped it into my IronPython directory on the other machine it worked. Now I know why: because the DLLs were in there. Great! Now, back to the housekeeping part of my question. How do I get Version, Creator, etc. into my app properly? I guess there's some kind of dynamic heady goodness going on, but "Version 0.0.0.0" looks a little shaky. -- View this message in context: http://www.nabble.com/How-do-I-set-assembly-information-in-IronPython--tp17828121p17845282.html Sent from the IronPython mailing list archive at Nabble.com. From Jimmy.Schementi at microsoft.com Sun Jun 15 06:21:22 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Sat, 14 Jun 2008 21:21:22 -0700 Subject: [IronPython] Announcing IronPython 2.0 Beta3 In-Reply-To: References: <4853A2B1.7010703@voidspace.org.uk> <485405FA.9000502@voidspace.org.uk> <485408DE.7050906@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC55C1C8@NA-EXMSG-C116.redmond.corp.microsoft.com> The "Silverlight" folder in the ipy release *should* basically mirror the sdlsdk for just python, but no one asked me about it beforehand. =P Sri, can we just update the IronPython release zip with the "script" folder from the SDLSDK? Michael, the IronPython release is like 2 days older, so you should be good with just the sdk. Also, they aren't "separate" ... the sdk will always have IronPython in it. But the IronPython release *should* give you everything you need to make SL apps w/Ipy. ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Srivatsn Narayanan > Sent: Saturday, June 14, 2008 11:15 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 > > By tools and templates you mean the 'script' folder in the sdlsdk-bin > zipfile right? Jimmy did point that out but it was fairly late then. We > could include that in the IPy package itself from next time onwards. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, June 14, 2008 11:07 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 > > Srivatsn Narayanan wrote: > > That's a nearly but no :) A few checkins were made to IPy/DLR in the > two days. > > > Ok - thanks. > > It does seem slightly confusing that to work with the latest version of > IronPython for Silverlight we need to download the sldsdk (which > includes IronPython) - and then another version of IronPython. > > As they are now separate, would it make sense to offer a version of the > SDK with just the tools and templates? > > Michael > > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > > Sent: Saturday, June 14, 2008 10:55 AM > > To: Discussion of IronPython > > Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 > > > > Srivatsn Narayanan wrote: > > > >> This build was snapped two days after the sdlsdk build. > >> > >> > > > > Hehe. Is that a yes or a no... it sounds like a 'nearly'. :-) > > > > Michael > > > > > >> -----Original Message----- > >> From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > >> Sent: Saturday, June 14, 2008 3:51 AM > >> To: Discussion of IronPython > >> Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 > >> > >> Hey guys. > >> > >> Are the binaries for Silverlight in this release the *same* as the > ones > >> available in the Silverlight Dynamic Languages SDK - or are they > more up > >> to date? > >> > >> Thanks > >> > >> Michael Foord > >> > >> Srivatsn Narayanan wrote: > >> > >> > >>> Hello IronPython Community, > >>> > >>> I'm pleased to announce IronPython 2.0 *Beta 3*. We have fixed > around > >>> 34 bugs in this release (~16 of them reported on Codeplex and ~18 > >>> reported internally). Apart from the bug fixes, this release > contains > >>> the following improvements: > >>> > >>> * We have worked on perf - specifically generators, exception > >>> handling, and shootout perf have improved. We are aware of some > >>> late-breaking degrades which we expect to fix by the next release. > >>> > >>> * An auto-templating feature has been added to the Dynamic Language > >>> Runtime which should improve performance in highly dynamic > scenarios. > >>> > >>> * cmath and _winreg modules have been implemented. > >>> > >>> There is a change in packaging this time. The Dynamic Silverlight > >>> sources and binaries, compatible with Silverlight 2 Beta 2, are now > >>> included in this release. This makes the package a single place to > get > >>> both the desktop and Silverlight versions of IronPython. The Visual > >>> Studio solution file (IronPython.sln) has been updated to build > under > >>> "Silverlight Release" and "Silverlight Debug" configurations as > well. > >>> Please note that this requires Silverlight 2 Beta 2 to build > properly. > >>> > >>> IronPython2005.sln is no longer part of the package as was > mentioned > >>> in the last beta release notes. This means that Visual Studio > >>> 2008/.NET 3.5 is required to build IronPython.sln. Ofcourse > >>> /toolsversion:2.0 flag can still be passed to msbuild and hence > >>> IronPython can be built to run against .NET 2.0 runtime as well. > >>> > >>> The following codeplex workitems have been closed since IronPython > 2.0 > >>> Beta 2: > >>> > >>> * nt.access is missing Closed Issue Medium Jun 2 at 7:24 PM > >>> > >>> * Trivial: throw WindowsError (with 'errno' of 17) when nt.mkdir > >>> called on pre-existing directory > >>> > >>> * '_' is in the result of dir() after first expression evaluation > >>> > >>> * -X:MTA option not supported by IP 2.0A > >>> > >>> * expresion-1 if condition else expresion-2 working incorrectly > >>> > >>> * Python Parser class is internal > >>> > >>> * PythonType.HasGetAttribute property does not detect inherited > >>> implementation. > >>> > >>> * _winreg is not implemented > >>> > >>> * SyntaxError(...).__dict__ is not a dict > >>> > >>> * Using 'with' statment with IDisposable .NET type doesn't work > >>> > >>> * IronPython forces objects in sys.meta_path to be new-style > classes > >>> > >>> * imp.load_module("os", ...) broken > >>> > >>> * DUPLICATE: Run ipyw .exe ( Iron Python 2 Beta 2 ) > >>> > >>> * REJECTED: Can't create & return nested function from > CreateDelegate > >>> > >>> * id returns Int64 not int or long > >>> > >>> * Overriding properties has strange syntax > >>> > >>> We'd like to thank everyone in the community who reported these > bugs: > >>> py_sunil, jhardy, awilkins, oldman, and 05031972, Ronnie Maor, > >>> Jonathan Amsterdam, sanxiyn, jackeyoo, Thane Plummer, Vizcayno > >>> Tamparantan, Michael Foord, Alex Henderson > >>> > >>> We've also closed these bugs that were reported internally: > >>> > >>> * Trivial: Exception messages are not directed to sys.stderr > >>> > >>> * Python25: new exception hierarchy > >>> > >>> * when base class provide over one ctor function,IronPython can not > >>> distinguish them just like Cpython do. > >>> > >>> * AttributeError: 'file' object has no attribute 'truncate' > >>> > >>> * ImportError: No module named xxsubtype > >>> > >>> * cmath module isn't implemented (complex arithmetic) > >>> > >>> * long("0X20",16) throws ValueError: invalid integer number literal > >>> > >>> * ImportError: No module named _winreg > >>> > >>> * dir(*()) returns something unexpected > >>> > >>> * "print a_super_object" throws TypeError > >>> > >>> * old style class constructed with an unpacked tuple containing a > >>> single None barfs > >>> > >>> * DLR crashes with stack overflow when ironpython.dll is missing > >>> > >>> * Enable turning whole object models dynamic in IronPython > >>> > >>> * Trivial: There is no "_md5" module in IronPython2.0 when run the > >>> file of test_hmac.py > >>> > >>> * TypeError: don't know how to disassemble code objects > >>> > >>> * sys.meta_path is not implemented > >>> > >>> * calling setattr got an error . > >>> > >>> * issubclass(Exception,object) return different result against > >>> Ironpython and Cpython > >>> > >>> You can download IronPython 2.0 Beta 3 at: > >>> > http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?Release > Id=12988 > >>> > >>> The IronPython Team > >>> > >>> IMPORTANT NOTES > >>> > >>> ToyScript, a small scripting language built on top of the DLR, is > >>> merely a DLR sample and not some new scripting language Microsoft > has > >>> created. Also, ToyScript is not intended to be distributed with > >>> IronPython on a permanent basis. > >>> > >>> ------------------------------------------------------------------- > ----- > >>> > >>> _______________________________________________ > >>> Users mailing list > >>> Users at lists.ironpython.com > >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >>> > >>> > >>> > >> -- > >> http://www.ironpythoninaction.com/ > >> http://www.theotherdelia.co.uk/ > >> http://www.voidspace.org.uk/ > >> http://www.ironpython.info/ > >> http://www.resolverhacks.net/ > >> > >> _______________________________________________ > >> 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 > >> > >> > > > > > > -- > > http://www.ironpythoninaction.com/ > > http://www.theotherdelia.co.uk/ > > http://www.voidspace.org.uk/ > > http://www.ironpython.info/ > > http://www.resolverhacks.net/ > > > > _______________________________________________ > > 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 > > > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 jonathan at slenders.be Sun Jun 15 12:34:42 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Sun, 15 Jun 2008 12:34:42 +0200 Subject: [IronPython] First cut of an interactive IronPython Interpreter running in the browser In-Reply-To: <4854598D.7020201@voidspace.org.uk> References: <48545862.7050305@voidspace.org.uk> <4854598D.7020201@voidspace.org.uk> Message-ID: Good work, this looks useful. Maybe you also want to capture the 'tab'-key -- I hate spaces for indentation. Some bug I noticed, when calling stdout.write myself: Python 2.5.0 () on silverlight > The interactive browser interpreter by Michael Foord > >>> import sys > >>> sys.stdout.write('test') > test>>> print 'a' > ... print 'b' > ... > I guess it's also impossible to ever capture sys.__stdout__ or sys.__stderr__ in silverlight, apart from writing a IronPython host in c#. Jonathan 2008/6/15 Michael Foord : > Michael Foord wrote: > >> Well, I've finally converted my Silverlight interactive interpreter to >> work with Silverlight 2 Beta 2 - and it works! >> >> > Hmmm... damn. Still doesn't handle syntax errors properly. This may well be > the fault of my code though - I'll need to look into it. > > For non syntax-errors it seems to be working fine. > > If you really want to see the source you can get it from the xap file: > > http://www.voidspace.org.uk/ironpython/silverlight-console/ > > I might start a google project to get an SVN repository for the code. > > Michael Foord > > > http://www.voidspace.org.uk/ironpython/silverlight-console/console.html >> >> There's no download yet and I've only tested on Firefox 3 and Safari (but >> the Javascript works on both as far as I can tell - more work probably >> needed to get it working on FF 2 and IE). >> >> It also doesn't include much of the standard library yet either - but this >> could be great for tutorials and interactive documentation. >> >> Michael Foord >> >> > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 fuzzyman at voidspace.org.uk Sun Jun 15 13:04:57 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 15 Jun 2008 12:04:57 +0100 Subject: [IronPython] First cut of an interactive IronPython Interpreter running in the browser In-Reply-To: References: <48545862.7050305@voidspace.org.uk> <4854598D.7020201@voidspace.org.uk> Message-ID: <4854F759.8000001@voidspace.org.uk> Jonathan Slenders wrote: > Good work, this looks useful. Maybe you also want to capture the > 'tab'-key -- I hate spaces for indentation. > > Some bug I noticed, when calling stdout.write myself: > > Python 2.5.0 () on silverlight > The interactive browser interpreter by Michael Foord > >>> import sys > >>> sys.stdout.write('test') > test>>> print 'a' > ... print 'b' > ... > > > I guess it's also impossible to ever capture sys.__stdout__ or > sys.__stderr__ in silverlight, apart from writing a IronPython host in c#. Ha! Nice bug find. No - try the prints without first writing to stdout directly... :-) Michael > > > Jonathan > > 2008/6/15 Michael Foord >: > > Michael Foord wrote: > > Well, I've finally converted my Silverlight interactive > interpreter to work with Silverlight 2 Beta 2 - and it works! > > > Hmmm... damn. Still doesn't handle syntax errors properly. This > may well be the fault of my code though - I'll need to look into it. > > For non syntax-errors it seems to be working fine. > > If you really want to see the source you can get it from the xap > file: > > > http://www.voidspace.org.uk/ironpython/silverlight-console/ > > I might start a google project to get an SVN repository for the code. > > Michael Foord > > > http://www.voidspace.org.uk/ironpython/silverlight-console/console.html > > There's no download yet and I've only tested on Firefox 3 and > Safari (but the Javascript works on both as far as I can tell > - more work probably needed to get it working on FF 2 and IE). > > It also doesn't include much of the standard library yet > either - but this could be great for tutorials and interactive > documentation. > > Michael Foord > > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Sun Jun 15 15:33:14 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 15 Jun 2008 14:33:14 +0100 Subject: [IronPython] Python in the Browser Project Page Message-ID: <48551A1A.4010400@voidspace.org.uk> Hello all, I've setup a project page for "Python in the Browser", an interactive Python interpreter that runs in an HTML textarea. http://code.google.com/p/pythoninthebrowser/ There's no download yet, but I have checked in the current code. "Python in the Browser" is an interactive Python interpreter that runs in the browser, using Silverlight 2 and IronPython?. This is ideal for tutorials and documentation, where example Python code can actually be tried in the browser. It requires Silverlight 2 Beta 2, and the Python version is 2.5. The interpreter runs in an HTML textarea, with Javascript that communicates with Silverlight and prevents you deleting text from the console except after the interactive prompt. Target browsers are Firefox 2 & 3, Safari and IE 7. (Although reports on compatibility with other browsers welcomed.) Currently it 'works' but is at an early stage of development. The project is a combination of IronPython? (for the interpreter loop), Javascript (for the 'console behaviour' in the textarea) and C# (as a helper to call into Silverlight from Javascript). I've entered the known issues at: http://code.google.com/p/pythoninthebrowser/issues/list There is a live example at: http://www.voidspace.org.uk/ironpython/silverlight-console/console.html I'm not sure how quickly I will be able to develop this (I have a book to finish!), but it should be very easy to knock out a couple of the simpler issues quickly. If you want to contribute then please post patches to the issue tracker. Michael Foord -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Sun Jun 15 15:36:38 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 15 Jun 2008 14:36:38 +0100 Subject: [IronPython] Announcing IronPython 2.0 Beta3 In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC55C1C8@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4853A2B1.7010703@voidspace.org.uk> <485405FA.9000502@voidspace.org.uk> <485408DE.7050906@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC55C1C8@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <48551AE6.8020104@voidspace.org.uk> Jimmy Schementi wrote: > The "Silverlight" folder in the ipy release *should* basically mirror the sdlsdk for just python, but no one asked me about it beforehand. =P Sri, can we just update the IronPython release zip with the "script" folder from the SDLSDK? > > Michael, the IronPython release is like 2 days older, so you should be good with just the sdk. Also, they aren't "separate" ... the sdk will always have IronPython in it. But the IronPython release *should* give you everything you need to make SL apps w/Ipy. > Ok - sounds good to me. So the Silverlight dynamic languages SDK can only be updated when there are versions of IronRuby and IronPython that run on the same version of the DLR - but in the meantime it will be possible to get everything for IronPython from releases versions. Thanks Michael Foord > ~js > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Srivatsn Narayanan >> Sent: Saturday, June 14, 2008 11:15 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 >> >> By tools and templates you mean the 'script' folder in the sdlsdk-bin >> zipfile right? Jimmy did point that out but it was fairly late then. We >> could include that in the IPy package itself from next time onwards. >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Saturday, June 14, 2008 11:07 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 >> >> Srivatsn Narayanan wrote: >> >>> That's a nearly but no :) A few checkins were made to IPy/DLR in the >>> >> two days. >> >> Ok - thanks. >> >> It does seem slightly confusing that to work with the latest version of >> IronPython for Silverlight we need to download the sldsdk (which >> includes IronPython) - and then another version of IronPython. >> >> As they are now separate, would it make sense to offer a version of the >> SDK with just the tools and templates? >> >> Michael >> >> >> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users- >>> >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> >>> Sent: Saturday, June 14, 2008 10:55 AM >>> To: Discussion of IronPython >>> Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 >>> >>> Srivatsn Narayanan wrote: >>> >>> >>>> This build was snapped two days after the sdlsdk build. >>>> >>>> >>>> >>> Hehe. Is that a yes or a no... it sounds like a 'nearly'. :-) >>> >>> Michael >>> >>> >>> >>>> -----Original Message----- >>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>> >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> >>>> Sent: Saturday, June 14, 2008 3:51 AM >>>> To: Discussion of IronPython >>>> Subject: Re: [IronPython] Announcing IronPython 2.0 Beta3 >>>> >>>> Hey guys. >>>> >>>> Are the binaries for Silverlight in this release the *same* as the >>>> >> ones >> >>>> available in the Silverlight Dynamic Languages SDK - or are they >>>> >> more up >> >>>> to date? >>>> >>>> Thanks >>>> >>>> Michael Foord >>>> >>>> Srivatsn Narayanan wrote: >>>> >>>> >>>> >>>>> Hello IronPython Community, >>>>> >>>>> I'm pleased to announce IronPython 2.0 *Beta 3*. We have fixed >>>>> >> around >> >>>>> 34 bugs in this release (~16 of them reported on Codeplex and ~18 >>>>> reported internally). Apart from the bug fixes, this release >>>>> >> contains >> >>>>> the following improvements: >>>>> >>>>> * We have worked on perf - specifically generators, exception >>>>> handling, and shootout perf have improved. We are aware of some >>>>> late-breaking degrades which we expect to fix by the next release. >>>>> >>>>> * An auto-templating feature has been added to the Dynamic Language >>>>> Runtime which should improve performance in highly dynamic >>>>> >> scenarios. >> >>>>> * cmath and _winreg modules have been implemented. >>>>> >>>>> There is a change in packaging this time. The Dynamic Silverlight >>>>> sources and binaries, compatible with Silverlight 2 Beta 2, are now >>>>> included in this release. This makes the package a single place to >>>>> >> get >> >>>>> both the desktop and Silverlight versions of IronPython. The Visual >>>>> Studio solution file (IronPython.sln) has been updated to build >>>>> >> under >> >>>>> "Silverlight Release" and "Silverlight Debug" configurations as >>>>> >> well. >> >>>>> Please note that this requires Silverlight 2 Beta 2 to build >>>>> >> properly. >> >>>>> IronPython2005.sln is no longer part of the package as was >>>>> >> mentioned >> >>>>> in the last beta release notes. This means that Visual Studio >>>>> 2008/.NET 3.5 is required to build IronPython.sln. Ofcourse >>>>> /toolsversion:2.0 flag can still be passed to msbuild and hence >>>>> IronPython can be built to run against .NET 2.0 runtime as well. >>>>> >>>>> The following codeplex workitems have been closed since IronPython >>>>> >> 2.0 >> >>>>> Beta 2: >>>>> >>>>> * nt.access is missing Closed Issue Medium Jun 2 at 7:24 PM >>>>> >>>>> * Trivial: throw WindowsError (with 'errno' of 17) when nt.mkdir >>>>> called on pre-existing directory >>>>> >>>>> * '_' is in the result of dir() after first expression evaluation >>>>> >>>>> * -X:MTA option not supported by IP 2.0A >>>>> >>>>> * expresion-1 if condition else expresion-2 working incorrectly >>>>> >>>>> * Python Parser class is internal >>>>> >>>>> * PythonType.HasGetAttribute property does not detect inherited >>>>> implementation. >>>>> >>>>> * _winreg is not implemented >>>>> >>>>> * SyntaxError(...).__dict__ is not a dict >>>>> >>>>> * Using 'with' statment with IDisposable .NET type doesn't work >>>>> >>>>> * IronPython forces objects in sys.meta_path to be new-style >>>>> >> classes >> >>>>> * imp.load_module("os", ...) broken >>>>> >>>>> * DUPLICATE: Run ipyw .exe ( Iron Python 2 Beta 2 ) >>>>> >>>>> * REJECTED: Can't create & return nested function from >>>>> >> CreateDelegate >> >>>>> * id returns Int64 not int or long >>>>> >>>>> * Overriding properties has strange syntax >>>>> >>>>> We'd like to thank everyone in the community who reported these >>>>> >> bugs: >> >>>>> py_sunil, jhardy, awilkins, oldman, and 05031972, Ronnie Maor, >>>>> Jonathan Amsterdam, sanxiyn, jackeyoo, Thane Plummer, Vizcayno >>>>> Tamparantan, Michael Foord, Alex Henderson >>>>> >>>>> We've also closed these bugs that were reported internally: >>>>> >>>>> * Trivial: Exception messages are not directed to sys.stderr >>>>> >>>>> * Python25: new exception hierarchy >>>>> >>>>> * when base class provide over one ctor function,IronPython can not >>>>> distinguish them just like Cpython do. >>>>> >>>>> * AttributeError: 'file' object has no attribute 'truncate' >>>>> >>>>> * ImportError: No module named xxsubtype >>>>> >>>>> * cmath module isn't implemented (complex arithmetic) >>>>> >>>>> * long("0X20",16) throws ValueError: invalid integer number literal >>>>> >>>>> * ImportError: No module named _winreg >>>>> >>>>> * dir(*()) returns something unexpected >>>>> >>>>> * "print a_super_object" throws TypeError >>>>> >>>>> * old style class constructed with an unpacked tuple containing a >>>>> single None barfs >>>>> >>>>> * DLR crashes with stack overflow when ironpython.dll is missing >>>>> >>>>> * Enable turning whole object models dynamic in IronPython >>>>> >>>>> * Trivial: There is no "_md5" module in IronPython2.0 when run the >>>>> file of test_hmac.py >>>>> >>>>> * TypeError: don't know how to disassemble code objects >>>>> >>>>> * sys.meta_path is not implemented >>>>> >>>>> * calling setattr got an error . >>>>> >>>>> * issubclass(Exception,object) return different result against >>>>> Ironpython and Cpython >>>>> >>>>> You can download IronPython 2.0 Beta 3 at: >>>>> >>>>> >> http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?Release >> Id=12988 >> >>>>> The IronPython Team >>>>> >>>>> IMPORTANT NOTES >>>>> >>>>> ToyScript, a small scripting language built on top of the DLR, is >>>>> merely a DLR sample and not some new scripting language Microsoft >>>>> >> has >> >>>>> created. Also, ToyScript is not intended to be distributed with >>>>> IronPython on a permanent basis. >>>>> >>>>> ------------------------------------------------------------------- >>>>> >> ----- >> >>>>> _______________________________________________ >>>>> Users mailing list >>>>> Users at lists.ironpython.com >>>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>>>> >>>>> >>>>> >>>>> >>>> -- >>>> http://www.ironpythoninaction.com/ >>>> http://www.theotherdelia.co.uk/ >>>> http://www.voidspace.org.uk/ >>>> http://www.ironpython.info/ >>>> http://www.resolverhacks.net/ >>>> >>>> _______________________________________________ >>>> 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 >>>> >>>> >>>> >>> -- >>> http://www.ironpythoninaction.com/ >>> http://www.theotherdelia.co.uk/ >>> http://www.voidspace.org.uk/ >>> http://www.ironpython.info/ >>> http://www.resolverhacks.net/ >>> >>> _______________________________________________ >>> 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 >>> >>> >> -- >> http://www.ironpythoninaction.com/ >> http://www.theotherdelia.co.uk/ >> http://www.voidspace.org.uk/ >> http://www.ironpython.info/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From dinov at exchange.microsoft.com Sun Jun 15 18:23:49 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Sun, 15 Jun 2008 09:23:49 -0700 Subject: [IronPython] Application Compatibility Documentation on ironpython.info In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227012BC9F4FAA5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> This is awesome, thanks! It'll make it that much easier to drive these apps to be working. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Hardy Sent: Saturday, June 14, 2008 10:48 AM To: Discussion of IronPython Subject: [IronPython] Application Compatibility Documentation on ironpython.info Hi all, I've carved out a section of the ironpython.info wiki to document the compatibility of various python applications (SCons, Trac, etc) and libraries (Genshi, compiler, etc.). There are links off the Contents page, and the direct links are: * http://www.ironpython.info/index.php/Application_Compatibility * http://www.ironpython.info/index.php/Web_Application_Compatibility * http://www.ironpython.info/index.php/Standard_Library_Compatibility * http://www.ironpython.info/index.php/Third-Party_Library_Compatibility I hope others will chip in as well so that this information can be centralized and prevent duplicated effort. -Jeff _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Sun Jun 15 23:09:38 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 15 Jun 2008 22:09:38 +0100 Subject: [IronPython] First cut of an interactive IronPython Interpreter running in the browser In-Reply-To: References: <48545862.7050305@voidspace.org.uk> <4854598D.7020201@voidspace.org.uk> Message-ID: <6f4025010806151409i56076edsd11570a7ce75a96@mail.gmail.com> 2008/6/15 Jonathan Slenders : > Good work, this looks useful. Maybe you also want to capture the 'tab'-key > -- I hate spaces for indentation. > > Some bug I noticed, when calling stdout.write myself: This bug - along with not handling syntax errors properly - should now be fixed (both in SVN and the online demo). Michael Foord > > Python 2.5.0 () on silverlight >> The interactive browser interpreter by Michael Foord >> >>> import sys >> >>> sys.stdout.write('test') >> test>>> print 'a' >> ... print 'b' >> ... >> > > I guess it's also impossible to ever capture sys.__stdout__ or > sys.__stderr__ in silverlight, apart from writing a IronPython host in c#. > > > Jonathan > > 2008/6/15 Michael Foord : > >> Michael Foord wrote: >> >>> Well, I've finally converted my Silverlight interactive interpreter to >>> work with Silverlight 2 Beta 2 - and it works! >>> >>> >> Hmmm... damn. Still doesn't handle syntax errors properly. This may well >> be the fault of my code though - I'll need to look into it. >> >> For non syntax-errors it seems to be working fine. >> >> If you really want to see the source you can get it from the xap file: >> >> http://www.voidspace.org.uk/ironpython/silverlight-console/ >> >> I might start a google project to get an SVN repository for the code. >> >> Michael Foord >> >> >> http://www.voidspace.org.uk/ironpython/silverlight-console/console.html >>> >>> There's no download yet and I've only tested on Firefox 3 and Safari (but >>> the Javascript works on both as far as I can tell - more work probably >>> needed to get it working on FF 2 and IE). >>> >>> It also doesn't include much of the standard library yet either - but >>> this could be great for tutorials and interactive documentation. >>> >>> Michael Foord >>> >>> >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.theotherdelia.co.uk/ >> http://www.voidspace.org.uk/ >> http://www.ironpython.info/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 > > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Mon Jun 16 06:46:58 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Sun, 15 Jun 2008 21:46:58 -0700 Subject: [IronPython] First cut of an interactive IronPython Interpreterrunning in the browser In-Reply-To: <6f4025010806151409i56076edsd11570a7ce75a96@mail.gmail.com> References: <48545862.7050305@voidspace.org.uk><4854598D.7020201@voidspace.org.uk> <6f4025010806151409i56076edsd11570a7ce75a96@mail.gmail.com> Message-ID: Neat Small bug: the Start/End/Pos don't update until a key press. Probably a simple fix. J From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Sunday, June 15, 2008 2:10 PM To: Discussion of IronPython Subject: Re: [IronPython] First cut of an interactive IronPython Interpreterrunning in the browser 2008/6/15 Jonathan Slenders : Good work, this looks useful. Maybe you also want to capture the 'tab'-key -- I hate spaces for indentation. Some bug I noticed, when calling stdout.write myself: This bug - along with not handling syntax errors properly - should now be fixed (both in SVN and the online demo). Michael Foord Python 2.5.0 () on silverlight The interactive browser interpreter by Michael Foord >>> import sys >>> sys.stdout.write('test') test>>> print 'a' ... print 'b' ... I guess it's also impossible to ever capture sys.__stdout__ or sys.__stderr__ in silverlight, apart from writing a IronPython host in c#. Jonathan 2008/6/15 Michael Foord : Michael Foord wrote: Well, I've finally converted my Silverlight interactive interpreter to work with Silverlight 2 Beta 2 - and it works! Hmmm... damn. Still doesn't handle syntax errors properly. This may well be the fault of my code though - I'll need to look into it. For non syntax-errors it seems to be working fine. If you really want to see the source you can get it from the xap file: http://www.voidspace.org.uk/ironpython/silverlight-console/ I might start a google project to get an SVN repository for the code. Michael Foord http://www.voidspace.org.uk/ironpython/silverlight-console/console.html There's no download yet and I've only tested on Firefox 3 and Safari (but the Javascript works on both as far as I can tell - more work probably needed to get it working on FF 2 and IE). It also doesn't include much of the standard library yet either - but this could be great for tutorials and interactive documentation. Michael Foord -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ _______________________________________________ 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 -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Jun 16 09:55:26 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 16 Jun 2008 08:55:26 +0100 Subject: [IronPython] First cut of an interactive IronPython Interpreterrunning in the browser In-Reply-To: References: <48545862.7050305@voidspace.org.uk><4854598D.7020201@voidspace.org.uk> <6f4025010806151409i56076edsd11570a7ce75a96@mail.gmail.com> Message-ID: <48561C6E.7030303@voidspace.org.uk> Keith J. Farmer wrote: > > Neat > > Small bug: the Start/End/Pos don?t update until a key press. Probably > a simple fix. J > The start / end / pos are purely there for debugging and are updated on a keypress. They will be removed when I get a chance to test and fix the Javascript with IE. :-) Michael > *From:* users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Michael Foord > *Sent:* Sunday, June 15, 2008 2:10 PM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] First cut of an interactive IronPython > Interpreterrunning in the browser > > 2008/6/15 Jonathan Slenders >: > > Good work, this looks useful. Maybe you also want to capture the > 'tab'-key -- I hate spaces for indentation. > > Some bug I noticed, when calling stdout.write myself: > > > This bug - along with not handling syntax errors properly - should now > be fixed (both in SVN and the online demo). > > Michael Foord > > Python 2.5.0 () on silverlight > The interactive browser interpreter by Michael Foord > >>> import sys > >>> sys.stdout.write('test') > test>>> print 'a' > ... print 'b' > ... > > > I guess it's also impossible to ever capture sys.__stdout__ or > sys.__stderr__ in silverlight, apart from writing a IronPython > host in c#. > > > Jonathan > > 2008/6/15 Michael Foord >: > > Michael Foord wrote: > > Well, I've finally converted my Silverlight interactive > interpreter to work with Silverlight 2 Beta 2 - and it works! > > Hmmm... damn. Still doesn't handle syntax errors properly. This > may well be the fault of my code though - I'll need to look into it. > > For non syntax-errors it seems to be working fine. > > If you really want to see the source you can get it from the xap file: > > > > http://www.voidspace.org.uk/ironpython/silverlight-console/ > > I might start a google project to get an SVN repository for the code. > > Michael Foord > > http://www.voidspace.org.uk/ironpython/silverlight-console/console.html > > There's no download yet and I've only tested on Firefox 3 and > Safari (but the Javascript works on both as far as I can tell > - more work probably needed to get it working on FF 2 and IE). > > It also doesn't include much of the standard library yet > either - but this could be great for tutorials and interactive > documentation. > > Michael Foord > > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > > > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From giles.thomas at resolversystems.com Mon Jun 16 16:20:13 2008 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Mon, 16 Jun 2008 15:20:13 +0100 Subject: [IronPython] Announcing IronPython 2.0 Beta3 In-Reply-To: References: Message-ID: <4856769D.6010805@resolversystems.com> Congratulations, guys! We'll build Resolver One against it and let you know what breaks :-) Regards, Giles Srivatsn Narayanan wrote: > > Hello IronPython Community, > > > > I'm pleased to announce IronPython 2.0 *Beta 3*. We have fixed around > 34 bugs in this release (~16 of them reported on Codeplex and ~18 > reported internally). Apart from the bug fixes, this release contains > the following improvements: > > ? We have worked on perf -- specifically generators, exception > handling, and shootout perf have improved. We are aware of some > late-breaking degrades which we expect to fix by the next release. > > ? An auto-templating feature has been added to the Dynamic > Language Runtime which should improve performance in highly dynamic > scenarios. > > ? cmath and _winreg modules have been implemented. > > > > There is a change in packaging this time. The Dynamic Silverlight > sources and binaries, compatible with Silverlight 2 Beta 2, are now > included in this release. This makes the package a single place to get > both the desktop and Silverlight versions of IronPython. The Visual > Studio solution file (IronPython.sln) has been updated to build under > "Silverlight Release" and "Silverlight Debug" configurations as well. > Please note that this requires Silverlight 2 Beta 2 to build properly. > > > > IronPython2005.sln is no longer part of the package as was mentioned > in the last beta release notes. This means that Visual Studio > 2008/.NET 3.5 is required to build IronPython.sln. Ofcourse > /toolsversion:2.0 flag can still be passed to msbuild and hence > IronPython can be built to run against .NET 2.0 runtime as well. > > > > The following codeplex workitems have been closed since IronPython 2.0 > Beta 2: > > ? nt.access is missing Closed Issue Medium Jun 2 at 7:24 PM > > ? Trivial: throw WindowsError (with 'errno' of 17) when > nt.mkdir called on pre-existing directory > > ? '_' is in the result of dir() after first expression evaluation > > ? -X:MTA option not supported by IP 2.0A > > ? expresion-1 if condition else expresion-2 working incorrectly > > ? Python Parser class is internal > > ? PythonType.HasGetAttribute property does not detect > inherited implementation. > > ? _winreg is not implemented > > ? SyntaxError(...).__dict__ is not a dict > > ? Using 'with' statment with IDisposable .NET type doesn't work > > ? IronPython forces objects in sys.meta_path to be new-style > classes > > ? imp.load_module("os", ...) broken > > ? DUPLICATE: Run ipyw .exe ( Iron Python 2 Beta 2 ) > > ? REJECTED: Can't create & return nested function from > CreateDelegate > > ? id returns Int64 not int or long > > ? Overriding properties has strange syntax > > > > We'd like to thank everyone in the community who reported these bugs: > py_sunil, jhardy, awilkins, oldman, and 05031972, Ronnie Maor, > Jonathan Amsterdam, sanxiyn, jackeyoo, Thane Plummer, Vizcayno > Tamparantan, Michael Foord, Alex Henderson > > > > We've also closed these bugs that were reported internally: > > ? Trivial: Exception messages are not directed to > sys.stderr > > ? Python25: new exception hierarchy > > ? when base class provide over one ctor function,IronPython > can not distinguish them just like Cpython do. > > ? AttributeError: 'file' object has no attribute 'truncate' > > ? ImportError: No module named xxsubtype > > ? cmath module isn't implemented (complex arithmetic) > > ? long("0X20",16) throws ValueError: invalid integer number > literal > > ? ImportError: No module named _winreg > > ? dir(*()) returns something unexpected > > ? "print a_super_object" throws TypeError > > ? old style class constructed with an unpacked tuple > containing a single None barfs > > ? DLR crashes with stack overflow when ironpython.dll is missing > > ? Enable turning whole object models dynamic in IronPython > > ? Trivial: There is no "_md5" module in IronPython2.0 when run > the file of test_hmac.py > > ? TypeError: don't know how to disassemble code > objects > > ? sys.meta_path is not implemented > > ? calling setattr got an error . > > ? issubclass(Exception,object) return different result against > Ironpython and Cpython > > > > You can download IronPython 2.0 Beta 3 at: > http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=12988 > > > > The IronPython Team > > > > IMPORTANT NOTES > > ToyScript, a small scripting language built on top of the DLR, is > merely a DLR sample and not some new scripting language Microsoft has > created. Also, ToyScript is not intended to be distributed with > IronPython on a permanent basis. > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Giles Thomas MD & CTO, Resolver Systems Ltd. giles.thomas at resolversystems.com +44 (0) 20 7253 6372 Try out Resolver One! (Free registration required) 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK -------------- next part -------------- An HTML attachment was scrubbed... URL: From brosembob at yahoo.com Mon Jun 16 17:28:05 2008 From: brosembob at yahoo.com (Bob Rosembob) Date: Mon, 16 Jun 2008 08:28:05 -0700 (PDT) Subject: [IronPython] Talk to Python script from C# app... Message-ID: <199257.54157.qm@web35507.mail.mud.yahoo.com> Curt, Thanks a lot for your help Bob ----- Original Message ---- From: Curt Hagenlocher To: Discussion of IronPython Sent: Friday, June 13, 2008 6:38:11 PM Subject: Re: [IronPython] Talk to Python script from C# app... If this test worked, you should be able to just copy them onto the users' machine -- manually or using an installer. On Fri, Jun 13, 2008 at 3:28 PM, Bob Rosembob wrote: I added bunch of files (.py), one at the time, before I could run the script and it works now. Do I need to include them into my installer and just copy them on the user's machine or I'll have to do something more then that? ? Thanks for your help, Bob ----- Original Message ---- From: Curt Hagenlocher To: Discussion of IronPython Sent: Friday, June 13, 2008 1:51:23 PM Subject: Re: [IronPython] Talk to Python script from C# app... There will be a "string.py" in the lib directory of your Python 2.5 installation.? You may need other files from this directory as well.? On Fri, Jun 13, 2008 at 10:30 AM, Bob Rosembob wrote: Curt, I?copied all the files (app.exe + cycle.py + python.exe + python25.dll) to another PC, which doesn't have Python installed, and ran it. I got error saying that it can't import string module (No module named string). Any ideas? ? Thanks, Bob ----- Original Message ---- From: Curt Hagenlocher To: Discussion of IronPython Sent: Thursday, June 12, 2008 3:18:09 PM Subject: Re: [IronPython] Talk to Python script from C# app... Whether it's CPython or IronPython, you're going to have to deploy something to the user's PC if you want to run a Python program there.? IronPython doesn't have any kind of installer; you just copy its modules over with your application.? But your program almost certainly makes use of parts of the standard CPython library, which you'd then have to copy over as well. ? Even though CPython has an installer under Windows, I suspect you can still do an "xcopy deployment" of it to most machines provided that you also grab a copy of Python25.dll from the Windows directory. To try with IronPython, You can run ipy.exe the same way as you're running python.exe.? But you'd want to try this from a command prompt first before going to the trouble of changing your C# program. On Wed, Jun 11, 2008 at 3:40 PM, Bob Rosembob wrote: Thank you?Michael and Curt for your quick response. I got the script working using the following logic: ? privateProcessP; ... stringpython = @"C:\Python25\python.exe"; stringpyscript = @"IronPython\cycle_LR.py"; P = newProcess(); P.OutputDataReceived += newDataReceivedEventHandler(OnOutputDataReceived); P.ErrorDataReceived += newDataReceivedEventHandler(OnErrorReceived); P.StartInfo.UseShellExecute = false; P.StartInfo.RedirectStandardOutput = true; P.StartInfo.RedirectStandardError = true; P.StartInfo.CreateNoWindow = true; P.StartInfo.FileName = @python.ToString(); P.StartInfo.Arguments = "-u "+ pyscript.ToString() + @" IronPython\cycle.ini"; P.Start(); P.BeginOutputReadLine(); P.BeginErrorReadLine(); ? As you probably guessed I installed latest Python 2.5.2 on my machine. Now, do I need to include Python 2.5.2 into my deployment package and install?it on the user's PC or I can some how embed it into my application? ? >>If the former then you can use System.Process to launch the script with >>IronPython. You will need to download (rather than install) and launch >>the script with 'ipy.exe args...'. ? Wouldn't this approach be simpler, since I don't have to install python on user's PC? How exactly can I run ipy.exe with the args? Curt, The script that I have to use was created in 2004 and probably was not tested with IronPython. The guy who created it left the company and nobody modified the script since. Thank you very much, Bob ? ? ----- Original Message ---- From: Michael Foord To: Discussion of IronPython Sent: Wednesday, June 11, 2008 1:29:27 PM Subject: Re: [IronPython] Talk to Python script from C# app... Hello Bob, The question is, do you want to run it in the same way you would launch any command line application from C# and collect the results from standard out - or do you want to embed IronPython and run the script 'inside' your application? If the former then you can use System.Process to launch the script with IronPython. You will need to download (rather than install) and launch the script with 'ipy.exe args...'. If the latter then how you do it depends on whether you use IronPython 1 or 2 and what exactly your use case is. Michael Foord http://www.ironpythoninaction.com/ Bob Rosembob wrote: > Hello there, > I have a C# application and a 3rd party Python script that the > application should run. The script is called periodical with some > arguments, performs some calculations and returns the results. I'm > running Vista & VS2005. >? > What should I do to run the script from my application? I assume I > need to install IronPython on my PC. How exactly should I do it? >? > Thanks for your help. >? > Bob > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >? _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ 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 rpigneri at LavaStorm.com Mon Jun 16 18:06:57 2008 From: rpigneri at LavaStorm.com (Pigneri, Rocco) Date: Mon, 16 Jun 2008 12:06:57 -0400 Subject: [IronPython] How do I set assembly information in IronPython? In-Reply-To: <17845282.post@talk.nabble.com> References: <17828121.post@talk.nabble.com> <48543624.7050501@voidspace.org.uk> <17845282.post@talk.nabble.com> Message-ID: I'm not sure if this is related at all, but since no one else has replied, I thought that I would supply it in case it puts you on the right path. The Al.exe (the Assembly Linker) is a .NET tool that adds an assembly manifest--a document that contains all the information that you are concerned about--to a module, or an assembly without a manifest. You can find the MSDN page here: http://msdn.microsoft.com/en-us/library/c405shex.aspx Again, this does seem a little tangential, but perhaps it will point you in the right direction. Rocco -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of joeymcjoejoe Sent: Saturday, June 14, 2008 8:41 PM To: users at lists.ironpython.com Subject: Re: [IronPython] How do I set assembly information in IronPython? Michael Foord-5 wrote: > > > What error do you get on the other machine? Does the program work when > run from source with IronPython on the other machine? > > Michael Foord > > You got me to the answer. The source worked fine on the second machine, so I read through the Pyc readme again. _Now_ I know what this line in the Pyc readme means:"The compiled executables require the presence of IronPython.dll and IronMath.dll in the current directory." The _executable_ needs them. I thought it was just when making the executable that they needed to be present. So that explains the following: I was getting the "Error Signature" alert box with the usual "there was some unpleasantness..." if I ran it straight from the desktop. I popped it into my IronPython directory on the other machine it worked. Now I know why: because the DLLs were in there. Great! Now, back to the housekeeping part of my question. How do I get Version, Creator, etc. into my app properly? I guess there's some kind of dynamic heady goodness going on, but "Version 0.0.0.0" looks a little shaky. -- View this message in context: http://www.nabble.com/How-do-I-set-assembly-information-in-IronPython--t p17828121p17845282.html Sent from the IronPython mailing list archive at Nabble.com. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jonathan at slenders.be Mon Jun 16 19:02:54 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Mon, 16 Jun 2008 19:02:54 +0200 Subject: [IronPython] Silverlight+IronPython: external DLLs Message-ID: Hello, I'm working on dynamic generation of XAP files from XAML and Python code. The normal way is to pack them all in a single XAP file. The problem here is that this files easily become a few MB and this is not reasonably when you've -- say 10 -- of these silverlight controls on a webpage. My current Manifest file looks like this: And when I don't include the dll files in the XAP container, Silverlight tries to download them from the server, it's URL path relative to the current page. Is it possible to set an absolute path where the Silverlight client can download the DLL files? And from the IronPython perspective, does it any harm to keep these DLLs out of the XAP? Thanks, Jonathan -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben2004uk at googlemail.com Mon Jun 16 22:55:48 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Mon, 16 Jun 2008 21:55:48 +0100 Subject: [IronPython] DLR Videos from Lang.NET Symposium Message-ID: Hi, I was just wondering if the two DLR sessions from Lang.NET Symposium was going to be made available - they are marked as "coming soon". The two sessions being "Vision of the DLR" and "Targeting DLR" Thanks Ben From Jimmy.Schementi at microsoft.com Mon Jun 16 23:13:00 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 16 Jun 2008 14:13:00 -0700 Subject: [IronPython] DLR Videos from Lang.NET Symposium In-Reply-To: References: Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC55C6C0@NA-EXMSG-C116.redmond.corp.microsoft.com> Yep, I actually just got them on my machine yesterday (someone else had recorded them). They're good quality, so I'm going to compress them and get them online soon. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Ben Hall > Sent: Monday, June 16, 2008 1:56 PM > To: Discussion of IronPython > Subject: [IronPython] DLR Videos from Lang.NET Symposium > > Hi, > > I was just wondering if the two DLR sessions from Lang.NET Symposium > was going to be made available - they are marked as "coming soon". > > The two sessions being "Vision of the DLR" and "Targeting DLR" > > Thanks > > Ben > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ben2004uk at googlemail.com Mon Jun 16 23:16:22 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Mon, 16 Jun 2008 22:16:22 +0100 Subject: [IronPython] DLR Videos from Lang.NET Symposium In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC55C6C0@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC55C6C0@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: Excellent! Let everyone know when when they are available ;) On Mon, Jun 16, 2008 at 10:13 PM, Jimmy Schementi wrote: > Yep, I actually just got them on my machine yesterday (someone else had recorded them). They're good quality, so I'm going to compress them and get them online soon. > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Ben Hall >> Sent: Monday, June 16, 2008 1:56 PM >> To: Discussion of IronPython >> Subject: [IronPython] DLR Videos from Lang.NET Symposium >> >> Hi, >> >> I was just wondering if the two DLR sessions from Lang.NET Symposium >> was going to be made available - they are marked as "coming soon". >> >> The two sessions being "Vision of the DLR" and "Targeting DLR" >> >> Thanks >> >> Ben >> _______________________________________________ >> 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 gigs at hi.t-com.hr Mon Jun 16 23:44:44 2008 From: gigs at hi.t-com.hr (Gigs_) Date: Mon, 16 Jun 2008 23:44:44 +0200 Subject: [IronPython] ironpython xna problem Message-ID: <4856DECC.5000908@hi.t-com.hr> Hi all! i want to run some ironpython xna script, but all the tim im getting error. I tried this in c# and it is working, i have installed directx runtime, xna studio 2.0 and xna framework. later i tried with xna 3.0 and same thing this is error: Could not load file or assembly 'Microsoft.Xna.Framework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d' or one of its dependencies. The system cannot find the file specified. import clr clr.AddReference('Microsoft.Xna.Framework') clr.AddReference('Microsoft.Xna.Framework.Game') from Microsoft.Xna.Framework import * from Microsoft.Xna.Framework.Graphics import * from Microsoft.Xna.Framework.Content import * class MyGame(Game): def __init__(self): self.spriteX = self.spriteY = 0 self.spriteSpeedX = self.spriteSpeedY = 1 self.initializeComponent() def initializeComponent(self): self.graphics = GraphicsDeviceManager(self) self.content = ContentManager(self.Services) ... Can someon help me with this_ thanks! From fuzzyman at voidspace.org.uk Tue Jun 17 01:04:52 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 17 Jun 2008 00:04:52 +0100 Subject: [IronPython] Python in the Browser updates Message-ID: <4856F194.7040004@voidspace.org.uk> For those who are interested, I've updated "Python in the Browser". Both the repository: http://code.google.com/p/pythoninthebrowser/ And the online demo: http://www.voidspace.org.uk/ironpython/silverlight-console/console.html There are a few minor but nice improvements: * The Javascript now works with IE 7! * The textarea scrolls as input is printed * The context window is disabled to prevent you pasting over the input area - not sure if this is really an improvement though... * The input area is cleared on load - to stop browsers like Firefox and Safari repopulating the textarea for us on browser refresh * Recursion limit is set I think it is basically in a useful state now... I might push out a '0.1' release from the current SVN head. All the best, Michael Foord -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From Jimmy.Schementi at microsoft.com Tue Jun 17 04:13:43 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 16 Jun 2008 19:13:43 -0700 Subject: [IronPython] Silverlight+IronPython: external DLLs In-Reply-To: References: Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC55C8F0@NA-EXMSG-C116.redmond.corp.microsoft.com> Jonathan, Make your AppManifest.xaml file look like this, this will let you download DLLs from the root of the current domain. You can also add http://foo.com to the beginning of the path and have it download from a different server (which needs to have a clientaccess.xml or clientaccesspolicy.xml file). Take a look at this post; at the ?My XAP is filled with CRAP!? heading I start talking about how to pull DLLs out of the XAP. Make sense? ~js From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jonathan Slenders Sent: Monday, June 16, 2008 10:03 AM To: Discussion of IronPython Subject: [IronPython] Silverlight+IronPython: external DLLs Hello, I'm working on dynamic generation of XAP files from XAML and Python code. The normal way is to pack them all in a single XAP file. The problem here is that this files easily become a few MB and this is not reasonably when you've -- say 10 -- of these silverlight controls on a webpage. My current Manifest file looks like this: And when I don't include the dll files in the XAP container, Silverlight tries to download them from the server, it's URL path relative to the current page. Is it possible to set an absolute path where the Silverlight client can download the DLL files? And from the IronPython perspective, does it any harm to keep these DLLs out of the XAP? Thanks, Jonathan -------------- next part -------------- An HTML attachment was scrubbed... URL: From miha.valencic at gmail.com Tue Jun 17 07:20:45 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Tue, 17 Jun 2008 07:20:45 +0200 Subject: [IronPython] Python in the Browser updates In-Reply-To: <4856F194.7040004@voidspace.org.uk> References: <4856F194.7040004@voidspace.org.uk> Message-ID: <233dfa1d0806162220w12ce515bx6d2407243302eb2d@mail.gmail.com> Any ideas how to get it working on Mac? Thanks, Miha. On Tue, Jun 17, 2008 at 1:04 AM, Michael Foord wrote: > For those who are interested, I've updated "Python in the Browser". > > And the online demo: > > http://www.voidspace.org.uk/ironpython/silverlight-console/console.html > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Tue Jun 17 07:58:46 2008 From: kfarmer at thuban.org (Keith J. Farmer) Date: Mon, 16 Jun 2008 22:58:46 -0700 Subject: [IronPython] First cut of an interactive IronPython Interpreterrunning in the browser In-Reply-To: <48561C6E.7030303@voidspace.org.uk> References: <48545862.7050305@voidspace.org.uk><4854598D.7020201@voidspace.org.uk> <6f4025010806151409i56076edsd11570a7ce75a96@mail.gmail.com> <48561C6E.7030303@voidspace.org.uk> Message-ID: Very simple fix indeed, then :) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, June 16, 2008 12:55 AM To: Discussion of IronPython Subject: Re: [IronPython] First cut of an interactive IronPython Interpreterrunning in the browser Keith J. Farmer wrote: > > Neat > > Small bug: the Start/End/Pos don't update until a key press. Probably > a simple fix. J > The start / end / pos are purely there for debugging and are updated on a keypress. They will be removed when I get a chance to test and fix the Javascript with IE. :-) Michael > *From:* users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Michael Foord > *Sent:* Sunday, June 15, 2008 2:10 PM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] First cut of an interactive IronPython > Interpreterrunning in the browser > > 2008/6/15 Jonathan Slenders >: > > Good work, this looks useful. Maybe you also want to capture the > 'tab'-key -- I hate spaces for indentation. > > Some bug I noticed, when calling stdout.write myself: > > > This bug - along with not handling syntax errors properly - should now > be fixed (both in SVN and the online demo). > > Michael Foord > > Python 2.5.0 () on silverlight > The interactive browser interpreter by Michael Foord > >>> import sys > >>> sys.stdout.write('test') > test>>> print 'a' > ... print 'b' > ... > > > I guess it's also impossible to ever capture sys.__stdout__ or > sys.__stderr__ in silverlight, apart from writing a IronPython > host in c#. > > > Jonathan > > 2008/6/15 Michael Foord >: > > Michael Foord wrote: > > Well, I've finally converted my Silverlight interactive > interpreter to work with Silverlight 2 Beta 2 - and it works! > > Hmmm... damn. Still doesn't handle syntax errors properly. This > may well be the fault of my code though - I'll need to look into it. > > For non syntax-errors it seems to be working fine. > > If you really want to see the source you can get it from the xap file: > > > > http://www.voidspace.org.uk/ironpython/silverlight-console/ > > I might start a google project to get an SVN repository for the code. > > Michael Foord > > http://www.voidspace.org.uk/ironpython/silverlight-console/console.html > > There's no download yet and I've only tested on Firefox 3 and > Safari (but the Javascript works on both as far as I can tell > - more work probably needed to get it working on FF 2 and IE). > > It also doesn't include much of the standard library yet > either - but this could be great for tutorials and interactive > documentation. > > Michael Foord > > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > > > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > ------------------------------------------------------------------------ > > _______________________________________________ > 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 jonathan at slenders.be Tue Jun 17 09:49:43 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Tue, 17 Jun 2008 09:49:43 +0200 Subject: [IronPython] Silverlight+IronPython: external DLLs In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC55C8F0@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC55C8F0@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: 2008/6/17 Jimmy Schementi : > Jonathan, > > > Make your AppManifest.xaml file look like this, this will let you download > DLLs from the root of the current domain. You can also add http://foo.comto the beginning of the path and have it download from a different server > (which needs to have a clientaccess.xml or clientaccesspolicy.xml file). > Take a look at this post; at the "My XAP is filled with CRAP!" heading I > start talking about how to pull DLLs out of the XAP. > > xmlns="http://schemas.microsoft.com/client/2007/deployment" > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > RuntimeVersion="%(version)s" > EntryPointAssembly="Microsoft.Scripting.Silverlight" > EntryPointType="Microsoft.Scripting.Silverlight.DynamicApplication"> > > Source="/%(path_to_dlr_assemblies)/Microsoft.Scripting.dll" /> > > Source="/%(path_to_dlr_assemblies)/IronPython.Modules.dll" /> > Source="/%(path_to_dlr_assemblies)/Microsoft.Scripting.Core.dll" /> > Source="/%(path_to_dlr_assemblies)/Microsoft.Scripting.Silverlight.dll" /> > > > > > > Make sense? > Thank you, this is perfect! > ~js > > Your initials are mine :) *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Jonathan Slenders > *Sent:* Monday, June 16, 2008 10:03 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] Silverlight+IronPython: external DLLs > > > > Hello, I'm working on dynamic generation of XAP files from XAML and Python > code. > The normal way is to pack them all in a single XAP file. The problem here > is that this files easily become a few MB and this is not reasonably when > you've -- say 10 -- of these silverlight controls on a webpage. > My current Manifest file looks like this: > > xmlns="http://schemas.microsoft.com/client/2007/deployment > " > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > RuntimeVersion="%(version)s" > EntryPointAssembly="Microsoft.Scripting.Silverlight" > > EntryPointType="Microsoft.Scripting.Silverlight.DynamicApplication"> > > > > > > Source="Microsoft.Scripting.Silverlight.dll" /> > > > > And when I don't include the dll files in the XAP container, Silverlight > tries to download them from the server, it's URL path relative to the > current page. > > Is it possible to set an absolute path where the Silverlight client can > download the DLL files? > And from the IronPython perspective, does it any harm to keep these DLLs > out of the XAP? > > Thanks, > Jonathan > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Tue Jun 17 11:42:22 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 17 Jun 2008 10:42:22 +0100 Subject: [IronPython] Python in the Browser updates In-Reply-To: <233dfa1d0806162220w12ce515bx6d2407243302eb2d@mail.gmail.com> References: <4856F194.7040004@voidspace.org.uk> <233dfa1d0806162220w12ce515bx6d2407243302eb2d@mail.gmail.com> Message-ID: <485786FE.5020502@voidspace.org.uk> Miha Valencic wrote: > Any ideas how to get it working on Mac? I've been developing it on the Mac - so it definitely works. You need Silverlight 2 Beta 2 installed. You can get this from: http://silverlight.net/GetStarted/ To run "Python in the Browser" locally you'll need a recent version of Mono installed and the development tool 'Chiron' from either the IronPython 2.0 B3 or Dynamic Silverlight SDK. You'll also need to checkout the latest version of "Python in the Browser" form: http://code.google.com/p/pythoninthebrowser/ When you start Chiron, it starts serving from the current directory - so you need to start it somewhere 'above' 'console.html'. When you have started Chiron you should be able to browse to it - and it should work. I hope this helps. Michael Foord > > Thanks, Miha. > > On Tue, Jun 17, 2008 at 1:04 AM, Michael Foord > > wrote: > > For those who are interested, I've updated "Python in the Browser". > > And the online demo: > > http://www.voidspace.org.uk/ironpython/silverlight-console/console.html > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Tue Jun 17 11:45:56 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 17 Jun 2008 10:45:56 +0100 Subject: [IronPython] Python in the Browser updates In-Reply-To: <485786FE.5020502@voidspace.org.uk> References: <4856F194.7040004@voidspace.org.uk> <233dfa1d0806162220w12ce515bx6d2407243302eb2d@mail.gmail.com> <485786FE.5020502@voidspace.org.uk> Message-ID: <485787D4.6080301@voidspace.org.uk> Michael Foord wrote: > Miha Valencic wrote: >> Any ideas how to get it working on Mac? > > I've been developing it on the Mac - so it definitely works. You need > Silverlight 2 Beta 2 installed. You can get this from: > > http://silverlight.net/GetStarted/ > > > To run "Python in the Browser" locally you'll need a recent version of > Mono installed and the development tool 'Chiron' from either the > IronPython 2.0 B3 or Dynamic Silverlight SDK. > > You'll also need to checkout the latest version of "Python in the > Browser" form: > > http://code.google.com/p/pythoninthebrowser/ > > When you start Chiron, it starts serving from the current directory - Oops - missed something. Starting Chiron on the Mac is done with: mono path/to/Chiron.exe /w Michael Foord > so you need to start it somewhere 'above' 'console.html'. When you > have started Chiron you should be able to browse to it - and it should > work. > > I hope this helps. > > Michael Foord > >> >> Thanks, Miha. >> >> On Tue, Jun 17, 2008 at 1:04 AM, Michael Foord >> > wrote: >> >> For those who are interested, I've updated "Python in the Browser". >> >> And the online demo: >> >> >> http://www.voidspace.org.uk/ironpython/silverlight-console/console.html >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From sls at iinet.net.au Tue Jun 17 15:40:15 2008 From: sls at iinet.net.au (Paul Turbett) Date: Tue, 17 Jun 2008 21:40:15 +0800 Subject: [IronPython] ironpython xna problem In-Reply-To: <4856DECC.5000908@hi.t-com.hr> References: <4856DECC.5000908@hi.t-com.hr> Message-ID: <4857BEBF.8020403@iinet.net.au> Are the XNA assemblies in the same directory as your script? I don't think they are in the GAC, so unless they in the same place as the ipy script, or a directory in your path, they won't be loaded. L8r, Paul Gigs_ wrote: > Hi all! > > > i want to run some ironpython xna script, but all the tim im getting > error. I tried this in c# and it is working, i have installed directx > runtime, xna studio 2.0 and xna framework. later i tried with xna 3.0 > and same thing > this is error: > > Could not load file or assembly 'Microsoft.Xna.Framework, > Version=2.0.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d' or > one of its dependencies. The system cannot find the file specified. > > import clr > > clr.AddReference('Microsoft.Xna.Framework') > clr.AddReference('Microsoft.Xna.Framework.Game') > > from Microsoft.Xna.Framework import * > from Microsoft.Xna.Framework.Graphics import * > from Microsoft.Xna.Framework.Content import * > > class MyGame(Game): > def __init__(self): > self.spriteX = self.spriteY = 0 > self.spriteSpeedX = self.spriteSpeedY = 1 > self.initializeComponent() > def initializeComponent(self): > self.graphics = GraphicsDeviceManager(self) > self.content = ContentManager(self.Services) > ... > > > Can someon help me with this_ thanks! > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From lists.ironpython.com at ka.weltenschmiede.com Tue Jun 17 17:11:46 2008 From: lists.ironpython.com at ka.weltenschmiede.com (Korbinian Abenthum) Date: Tue, 17 Jun 2008 17:11:46 +0200 Subject: [IronPython] Operator overloading, and implicit conversion from Double to Single in operators Message-ID: <00b301c8d08c_75a9cbc0_14b2a8c0@lannisport> Hi I basically have the same problem as in http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=939 A struct like: public struct Test { public float a; public Test(float a) { this.a = a; } public static Test operator *(float lscalar, Test test) { return new Test(lscalar * test.a); } public static Test mul(float lscalar, Test test) { return new Test(lscalar* test.a); } public override string ToString() { return "Test("+a+")"; } } If I execute in IronPython: >>> 6 * Test(1.7) >>> Test.mul(6.5, Test(1.7)) >>> 6.5 * Test(1.7) unsupported operand type(s) for *: 'float' and 'Test' at _stub_$695##312(Closure , CallSite , CodeContext , Double , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at Initialize$694##311(Closure , CodeContext ) at Microsoft.Scripting.ScriptCode.Run(CodeContext context) at Microsoft.Scripting.ScriptCode.Run(Scope scope) at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) [...] TypeError: unsupported operand type(s) for *: 'float' and 'Test' The comment in the issue quoted above says that the exception is by design, since the operator is only defined for a float. And indeed, >>> System.Single(6.5) * Test(1.7) works just fine. What I don't understand is why there should be a difference in implicit conversion of python numbers depending on if it's used in a constructor, a function or an operator. Is there a reason for that? Cheers, Korbinian From tnelson at onresolve.com Tue Jun 17 17:39:32 2008 From: tnelson at onresolve.com (Trent Nelson) Date: Tue, 17 Jun 2008 16:39:32 +0100 Subject: [IronPython] APAX? Message-ID: <6167796BFEB5D0438720AC212E89A6B00786581D@exchange.onresolve.com> Any likelihood of IronPython competing with the likes of 'ARAX'? http://www.eweek.com/c/a/Application-Development/Move-Over-AJAX-ARAX-is-Here/ Trent. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gigs at hi.t-com.hr Tue Jun 17 17:51:30 2008 From: gigs at hi.t-com.hr (Gigs_) Date: Tue, 17 Jun 2008 17:51:30 +0200 Subject: [IronPython] ironpython xna problem In-Reply-To: <4857BEBF.8020403@iinet.net.au> References: <4856DECC.5000908@hi.t-com.hr> <4857BEBF.8020403@iinet.net.au> Message-ID: <4857DD82.4030301@hi.t-com.hr> Paul Turbett wrote: > Are the XNA assemblies in the same directory as your script? I don't > think they are in the GAC, so unless they in the same place as the ipy > script, or a directory in your path, they won't be loaded. > > L8r, Paul > > Gigs_ wrote: >> Hi all! >> >> >> i want to run some ironpython xna script, but all the tim im getting >> error. I tried this in c# and it is working, i have installed directx >> runtime, xna studio 2.0 and xna framework. later i tried with xna 3.0 >> and same thing >> this is error: >> >> Could not load file or assembly 'Microsoft.Xna.Framework, >> Version=2.0.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d' or >> one of its dependencies. The system cannot find the file specified. >> >> import clr >> >> clr.AddReference('Microsoft.Xna.Framework') >> clr.AddReference('Microsoft.Xna.Framework.Game') >> >> from Microsoft.Xna.Framework import * >> from Microsoft.Xna.Framework.Graphics import * >> from Microsoft.Xna.Framework.Content import * >> >> class MyGame(Game): >> def __init__(self): >> self.spriteX = self.spriteY = 0 >> self.spriteSpeedX = self.spriteSpeedY = 1 >> self.initializeComponent() def initializeComponent(self): >> self.graphics = GraphicsDeviceManager(self) >> self.content = ContentManager(self.Services) >> ... >> >> >> Can someon help me with this_ thanks! >> _______________________________________________ >> 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 > > __________ Information from ESET NOD32 Antivirus, version of virus > signature database 3194 (20080617) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.eset.com > > > thez are in the gac, and when i copy them to working dir nothing change. i will blow, i really need ironpython for xna for testing From fuzzyman at voidspace.org.uk Tue Jun 17 17:56:23 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 17 Jun 2008 16:56:23 +0100 Subject: [IronPython] APAX? In-Reply-To: <6167796BFEB5D0438720AC212E89A6B00786581D@exchange.onresolve.com> References: <6167796BFEB5D0438720AC212E89A6B00786581D@exchange.onresolve.com> Message-ID: <4857DEA7.9090905@voidspace.org.uk> Trent Nelson wrote: > Any likelihood of IronPython competing with the likes of 'ARAX'? > > http://www.eweek.com/c/a/Application-Development/Move-Over-AJAX-ARAX-is-Here/ > > It would be easy enough to write a library supporting 'AJAX-like' operations from IronPython in Silverlight. Michael Foord > Trent. > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Tue Jun 17 18:05:43 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 17 Jun 2008 17:05:43 +0100 Subject: [IronPython] ironpython xna problem In-Reply-To: <4857DD82.4030301@hi.t-com.hr> References: <4856DECC.5000908@hi.t-com.hr> <4857BEBF.8020403@iinet.net.au> <4857DD82.4030301@hi.t-com.hr> Message-ID: <4857E0D7.2070301@voidspace.org.uk> Hello Gigs_, That error definitely means that IronPython isn't finding the assemblies. What happens if you copy the XNA assemblies into the same directory as the IronPython interpreter and execute the following into the interactive interpreter: import clr clr.AddReference('Microsoft.Xna.Framework') clr.AddReference('Microsoft.Xna.Framework.Game') from Microsoft.Xna.Framework import * from Microsoft.Xna.Framework.Graphics import * from Microsoft.Xna.Framework.Content import * Gigs_ wrote: > Paul Turbett wrote: >> Are the XNA assemblies in the same directory as your script? I don't >> think they are in the GAC, so unless they in the same place as the >> ipy script, or a directory in your path, they won't be loaded. >> >> L8r, Paul >> >> Gigs_ wrote: >>> Hi all! >>> >>> >>> i want to run some ironpython xna script, but all the tim im getting >>> error. I tried this in c# and it is working, i have installed >>> directx runtime, xna studio 2.0 and xna framework. later i tried >>> with xna 3.0 and same thing >>> this is error: >>> >>> Could not load file or assembly 'Microsoft.Xna.Framework, >>> Version=2.0.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d' >>> or one of its dependencies. The system cannot find the file specified. >>> >>> import clr >>> >>> clr.AddReference('Microsoft.Xna.Framework') >>> clr.AddReference('Microsoft.Xna.Framework.Game') >>> >>> from Microsoft.Xna.Framework import * >>> from Microsoft.Xna.Framework.Graphics import * >>> from Microsoft.Xna.Framework.Content import * >>> >>> class MyGame(Game): >>> def __init__(self): >>> self.spriteX = self.spriteY = 0 >>> self.spriteSpeedX = self.spriteSpeedY = 1 >>> self.initializeComponent() def initializeComponent(self): >>> self.graphics = GraphicsDeviceManager(self) >>> self.content = ContentManager(self.Services) >>> ... >>> >>> >>> Can someon help me with this_ thanks! >>> _______________________________________________ >>> 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 >> >> __________ Information from ESET NOD32 Antivirus, version of virus >> signature database 3194 (20080617) __________ >> >> The message was checked by ESET NOD32 Antivirus. >> >> http://www.eset.com >> >> >> > thez are in the gac, and when i copy them to working dir nothing > change. i will blow, i really need ironpython for xna for testing > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From Jimmy.Schementi at microsoft.com Tue Jun 17 18:10:28 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 17 Jun 2008 09:10:28 -0700 Subject: [IronPython] APAX? In-Reply-To: <4857DEA7.9090905@voidspace.org.uk> References: <6167796BFEB5D0438720AC212E89A6B00786581D@exchange.onresolve.com> <4857DEA7.9090905@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC55CAC7@NA-EXMSG-C116.redmond.corp.microsoft.com> Definitely, there's nothing *special* about ARAX, other than that it's Ruby; It could be APAX too, given that someone writes the library. I'm building up a nice library for Ruby, and that can definitely be ported to Python (Michael? =P). All this is enabled by Silverlight and the DLR, so any language on the DLR could have a nice story in the browser. ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Tuesday, June 17, 2008 8:56 AM > To: Discussion of IronPython > Subject: Re: [IronPython] APAX? > > Trent Nelson wrote: > > Any likelihood of IronPython competing with the likes of 'ARAX'? > > > > http://www.eweek.com/c/a/Application-Development/Move-Over-AJAX-ARAX- > is-Here/ > > > > > > It would be easy enough to write a library supporting 'AJAX-like' > operations from IronPython in Silverlight. > > Michael Foord > > > Trent. > > --------------------------------------------------------------------- > --- > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Jun 17 19:34:26 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 17 Jun 2008 10:34:26 -0700 Subject: [IronPython] ironpython xna problem In-Reply-To: <4857E0D7.2070301@voidspace.org.uk> References: <4856DECC.5000908@hi.t-com.hr> <4857BEBF.8020403@iinet.net.au> <4857DD82.4030301@hi.t-com.hr> <4857E0D7.2070301@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227012BC9F4FD9F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Is this on a 64-bit machine? IronPython is a neutral EXE so it'll run at 64-bit on a 64-bit machine and 32-bit on a 32-bit machine. It looks like XNA is a 32-bit only assembly: http://www.start64.com/index.php?option=com_content&task=view&id=1932&Itemid=114 If this is the problem then the answer is that unfortunately we don't ship a 32-bit ipy.exe. You could write a simple 32-bit wrapper that does a AppDomain.ExecuteAssembly on ipy.exe though. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Tuesday, June 17, 2008 9:06 AM To: Discussion of IronPython Subject: Re: [IronPython] ironpython xna problem Hello Gigs_, That error definitely means that IronPython isn't finding the assemblies. What happens if you copy the XNA assemblies into the same directory as the IronPython interpreter and execute the following into the interactive interpreter: import clr clr.AddReference('Microsoft.Xna.Framework') clr.AddReference('Microsoft.Xna.Framework.Game') from Microsoft.Xna.Framework import * from Microsoft.Xna.Framework.Graphics import * from Microsoft.Xna.Framework.Content import * Gigs_ wrote: > Paul Turbett wrote: >> Are the XNA assemblies in the same directory as your script? I don't >> think they are in the GAC, so unless they in the same place as the >> ipy script, or a directory in your path, they won't be loaded. >> >> L8r, Paul >> >> Gigs_ wrote: >>> Hi all! >>> >>> >>> i want to run some ironpython xna script, but all the tim im getting >>> error. I tried this in c# and it is working, i have installed >>> directx runtime, xna studio 2.0 and xna framework. later i tried >>> with xna 3.0 and same thing >>> this is error: >>> >>> Could not load file or assembly 'Microsoft.Xna.Framework, >>> Version=2.0.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d' >>> or one of its dependencies. The system cannot find the file specified. >>> >>> import clr >>> >>> clr.AddReference('Microsoft.Xna.Framework') >>> clr.AddReference('Microsoft.Xna.Framework.Game') >>> >>> from Microsoft.Xna.Framework import * >>> from Microsoft.Xna.Framework.Graphics import * >>> from Microsoft.Xna.Framework.Content import * >>> >>> class MyGame(Game): >>> def __init__(self): >>> self.spriteX = self.spriteY = 0 >>> self.spriteSpeedX = self.spriteSpeedY = 1 >>> self.initializeComponent() def initializeComponent(self): >>> self.graphics = GraphicsDeviceManager(self) >>> self.content = ContentManager(self.Services) >>> ... >>> >>> >>> Can someon help me with this_ thanks! >>> _______________________________________________ >>> 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 >> >> __________ Information from ESET NOD32 Antivirus, version of virus >> signature database 3194 (20080617) __________ >> >> The message was checked by ESET NOD32 Antivirus. >> >> http://www.eset.com >> >> >> > thez are in the gac, and when i copy them to working dir nothing > change. i will blow, i really need ironpython for xna for testing > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From gigs at hi.t-com.hr Tue Jun 17 21:02:33 2008 From: gigs at hi.t-com.hr (Gigs_) Date: Tue, 17 Jun 2008 21:02:33 +0200 Subject: [IronPython] ironpython xna problem In-Reply-To: <7AD436E4270DD54A94238001769C2227012BC9F4FD9F@DF-GRTDANE-MSG.ex change.corp.microsoft.com> References: <4856DECC.5000908@hi.t-com.hr> <4857BEBF.8020403@iinet.net.au> <4857DD82.4030301@hi.t-com.hr> <4857E0D7.2070301@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012BC9F4FD9F@DF-GRTDANE-MSG.exchange.corp. microsoft.com> Message-ID: <48580A49.3070209@hi.t-com.hr> thats the problem, i use 64 bit os Dino Viehland wrote: > Is this on a 64-bit machine? IronPython is a neutral EXE so it'll run at 64-bit on a 64-bit machine and 32-bit on a 32-bit machine. It looks like XNA is a 32-bit only assembly: http://www.start64.com/index.php?option=com_content&task=view&id=1932&Itemid=114 > > If this is the problem then the answer is that unfortunately we don't ship a 32-bit ipy.exe. You could write a simple 32-bit wrapper that does a AppDomain.ExecuteAssembly on ipy.exe though. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Tuesday, June 17, 2008 9:06 AM > To: Discussion of IronPython > Subject: Re: [IronPython] ironpython xna problem > > Hello Gigs_, > > That error definitely means that IronPython isn't finding the assemblies. > > What happens if you copy the XNA assemblies into the same directory as > the IronPython interpreter and execute the following into the > interactive interpreter: > > > import clr > > clr.AddReference('Microsoft.Xna.Framework') > clr.AddReference('Microsoft.Xna.Framework.Game') > > from Microsoft.Xna.Framework import * > from Microsoft.Xna.Framework.Graphics import * > from Microsoft.Xna.Framework.Content import * > > Gigs_ wrote: > >> Paul Turbett wrote: >> >>> Are the XNA assemblies in the same directory as your script? I don't >>> think they are in the GAC, so unless they in the same place as the >>> ipy script, or a directory in your path, they won't be loaded. >>> >>> L8r, Paul >>> >>> Gigs_ wrote: >>> >>>> Hi all! >>>> >>>> >>>> i want to run some ironpython xna script, but all the tim im getting >>>> error. I tried this in c# and it is working, i have installed >>>> directx runtime, xna studio 2.0 and xna framework. later i tried >>>> with xna 3.0 and same thing >>>> this is error: >>>> >>>> Could not load file or assembly 'Microsoft.Xna.Framework, >>>> Version=2.0.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d' >>>> or one of its dependencies. The system cannot find the file specified. >>>> >>>> import clr >>>> >>>> clr.AddReference('Microsoft.Xna.Framework') >>>> clr.AddReference('Microsoft.Xna.Framework.Game') >>>> >>>> from Microsoft.Xna.Framework import * >>>> from Microsoft.Xna.Framework.Graphics import * >>>> from Microsoft.Xna.Framework.Content import * >>>> >>>> class MyGame(Game): >>>> def __init__(self): >>>> self.spriteX = self.spriteY = 0 >>>> self.spriteSpeedX = self.spriteSpeedY = 1 >>>> self.initializeComponent() def initializeComponent(self): >>>> self.graphics = GraphicsDeviceManager(self) >>>> self.content = ContentManager(self.Services) >>>> ... >>>> >>>> >>>> Can someon help me with this_ thanks! >>>> _______________________________________________ >>>> 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 >>> >>> __________ Information from ESET NOD32 Antivirus, version of virus >>> signature database 3194 (20080617) __________ >>> >>> The message was checked by ESET NOD32 Antivirus. >>> >>> http://www.eset.com >>> >>> >>> >>> >> thez are in the gac, and when i copy them to working dir nothing >> change. i will blow, i really need ironpython for xna for testing >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > > __________ Information from ESET NOD32 Antivirus, version of virus signature database 3194 (20080617) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.eset.com > > > > From dinov at exchange.microsoft.com Tue Jun 17 21:57:18 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 17 Jun 2008 12:57:18 -0700 Subject: [IronPython] Operator overloading, and implicit conversion from Double to Single in operators In-Reply-To: <00b301c8d08c_75a9cbc0_14b2a8c0@lannisport> References: <00b301c8d08c_75a9cbc0_14b2a8c0@lannisport> Message-ID: <7AD436E4270DD54A94238001769C2227012BC9F4FE44@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Great question. The reason why operators get treated differently due to things like: [2, 3] * 2.0 For this call we cannot coerce the float into an int by Python semantics. Compare this to: xrange(2.0) which is allowed (but in CPython issues a warning). So in general Python seems to be more restrictive on binary operators then it does on method calls. We've mirrored this behavior in IronPython through our support of .NET operator overloading. That allows us to implement the standard Python semantics in a manner which .NET understands - for example our List class implements operator * and a C# programmer could do someList * 3. We then just automatically expose these operators out to Python in a way which Python expects - including returning NotImplemented if the parameters aren't compatible. We could look at relaxing this in the future (in particular for non-Python types) but I think we have bigger fish to fry for the immediate future - and it might just make things that much more confusing as well. If it's particularly troublesome I'd suggest opening a feature request on CodePlex so we can gauge how many people it's affecting by keeping track of the votes. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Korbinian Abenthum Sent: Tuesday, June 17, 2008 8:12 AM To: Discussion of IronPython Subject: [IronPython] Operator overloading, and implicit conversion from Double to Single in operators Hi I basically have the same problem as in http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=939 A struct like: public struct Test { public float a; public Test(float a) { this.a = a; } public static Test operator *(float lscalar, Test test) { return new Test(lscalar * test.a); } public static Test mul(float lscalar, Test test) { return new Test(lscalar* test.a); } public override string ToString() { return "Test("+a+")"; } } If I execute in IronPython: >>> 6 * Test(1.7) >>> Test.mul(6.5, Test(1.7)) >>> 6.5 * Test(1.7) unsupported operand type(s) for *: 'float' and 'Test' at _stub_$695##312(Closure , CallSite , CodeContext , Double , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at Initialize$694##311(Closure , CodeContext ) at Microsoft.Scripting.ScriptCode.Run(CodeContext context) at Microsoft.Scripting.ScriptCode.Run(Scope scope) at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink) at Microsoft.Scripting.Hosting.ScriptSource.Execute(ScriptScope scope) [...] TypeError: unsupported operand type(s) for *: 'float' and 'Test' The comment in the issue quoted above says that the exception is by design, since the operator is only defined for a float. And indeed, >>> System.Single(6.5) * Test(1.7) works just fine. What I don't understand is why there should be a difference in implicit conversion of python numbers depending on if it's used in a constructor, a function or an operator. Is there a reason for that? Cheers, Korbinian _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jonathan at slenders.be Tue Jun 17 23:40:30 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Tue, 17 Jun 2008 23:40:30 +0200 Subject: [IronPython] XmlDocument or XDocument in Python/Silverlight Message-ID: Hello, It seems that XmlDocument isn't available in Silverlight. The Linq dll ("System.Xml.Linq.dll") is listed between the client libraries, but when I add them to my Silverlight manifest file and try: from System.Xml.Linq import XDocument The following error occurs: "ManagedRuntimeError, SetProperty failed" What's the recommended way to query XML documents? A good XML library is essential at the client for doing AJAX (in our case: APAX), I wonder in the first place why XmlDocument isn't in Silverlight by default. I don't want to use a SAX parser like XmlReader. Jonathan PS: When the XML parsing works, I can present a working APAX example for querying a mysql database. It returns row after row every time the client does a request for the next row. The javascript version works, and I'm porting it now to Silverlight/IronPython. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Tue Jun 17 23:45:17 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 17 Jun 2008 22:45:17 +0100 Subject: [IronPython] XmlDocument or XDocument in Python/Silverlight In-Reply-To: References: Message-ID: <4858306D.2020308@voidspace.org.uk> Hello Jonathan, Do you need to add a reference to the assembly before importing from it? In the Silverlight chapter of IronPython in Action I use 'XmlReader' for parsing XML. I have already (in an earlier chapter) provided a wrapper over this that gives it a SAX like interface. The code worked unmodified on Silverlight! Michael Foord Jonathan Slenders wrote: > Hello, > > It seems that XmlDocument isn't available in Silverlight. The Linq dll > ("System.Xml.Linq.dll") is listed between the client libraries, but > when I add them to my Silverlight manifest file > and try: > > from System.Xml.Linq import XDocument > > The following error occurs: "ManagedRuntimeError, SetProperty failed" > > What's the recommended way to query XML documents? A good XML library > is essential at the client for doing AJAX (in our case: APAX), I > wonder in the first place why XmlDocument isn't in Silverlight by default. > I don't want to use a SAX parser like XmlReader. > > Jonathan > > > PS: When the XML parsing works, I can present a working APAX example > for querying a mysql database. It returns row after row every time the > client does a request for the next row. The javascript version works, > and I'm porting it now to Silverlight/IronPython. > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Tue Jun 17 23:51:41 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 17 Jun 2008 22:51:41 +0100 Subject: [IronPython] Python in the Browser updates In-Reply-To: <4856F194.7040004@voidspace.org.uk> References: <4856F194.7040004@voidspace.org.uk> Message-ID: <485831ED.2050304@voidspace.org.uk> Hello all, Sorry for the noise - but tomorrow I hope to package this for a release and if any of you get the chance to give me any feedback before then. http://www.voidspace.org.uk/ironpython/silverlight-console/console.html I think I have fixed all the basic usability issues (it is no longer possible to screw up the console so that it refuses further input for example). To *really* fix input I ought to move execution into its own thread so that we can interrupt infinite loops [1] - but that is a bigger change so I am resisting it for the moment. The big change is that I have added some simple code snippets - as an example of how it could be used in tutorials or for teaching Python. It is also easy to customize - the source code (200 lines of Python, 70 lines of Javascript, 25 lines of C#) shows how to prepopulate the execution context and show the first few lines of code in the interpreter. You can get the sourcecode from the repository of course: http://code.google.com/p/pythoninthebrowser/ All the best, Michael Foord [1] and then decide whether on windows a ctrl-c should send a keyboard interrupt or copy to the clipboard... Michael Foord wrote: > For those who are interested, I've updated "Python in the Browser". > > Both the repository: > > http://code.google.com/p/pythoninthebrowser/ > > And the online demo: > > http://www.voidspace.org.uk/ironpython/silverlight-console/console.html > > There are a few minor but nice improvements: > > * The Javascript now works with IE 7! > * The textarea scrolls as input is printed > * The context window is disabled to prevent you pasting over the input > area - not sure if this is really an improvement though... > * The input area is cleared on load - to stop browsers like Firefox > and Safari repopulating the textarea for us on browser refresh > * Recursion limit is set > > I think it is basically in a useful state now... I might push out a > '0.1' release from the current SVN head. > > All the best, > > Michael Foord > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From jonathan at slenders.be Wed Jun 18 00:13:52 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Wed, 18 Jun 2008 00:13:52 +0200 Subject: [IronPython] XmlDocument or XDocument in Python/Silverlight In-Reply-To: <4858306D.2020308@voidspace.org.uk> References: <4858306D.2020308@voidspace.org.uk> Message-ID: Thank you, Michael I had to: import clr clr.AddReference('System.Xml.Linq') 2008/6/17 Michael Foord : > Hello Jonathan, > > Do you need to add a reference to the assembly before importing from it? > > In the Silverlight chapter of IronPython in Action I use 'XmlReader' for > parsing XML. I have already (in an earlier chapter) provided a wrapper over > this that gives it a SAX like interface. The code worked unmodified on > Silverlight! > > Michael Foord > > Jonathan Slenders wrote: > >> Hello, >> >> It seems that XmlDocument isn't available in Silverlight. The Linq dll >> ("System.Xml.Linq.dll") is listed between the client libraries, but when I >> add them to my Silverlight manifest file >> and try: >> >> from System.Xml.Linq import XDocument >> >> The following error occurs: "ManagedRuntimeError, SetProperty failed" >> >> What's the recommended way to query XML documents? A good XML library is >> essential at the client for doing AJAX (in our case: APAX), I wonder in the >> first place why XmlDocument isn't in Silverlight by default. >> I don't want to use a SAX parser like XmlReader. >> >> Jonathan >> >> >> PS: When the XML parsing works, I can present a working APAX example for >> querying a mysql database. It returns row after row every time the client >> does a request for the next row. The javascript version works, and I'm >> porting it now to Silverlight/IronPython. >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 Jimmy.Schementi at microsoft.com Wed Jun 18 08:45:27 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 17 Jun 2008 23:45:27 -0700 Subject: [IronPython] Python in the Browser updates In-Reply-To: <485831ED.2050304@voidspace.org.uk> References: <4856F194.7040004@voidspace.org.uk> <485831ED.2050304@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC6216BA@NA-EXMSG-C116.redmond.corp.microsoft.com> Michael, question for you: > On every keypress Javascript calls into IronPython (via the C#!). How come you used C# to handle the onkeypress event? This should do it in Python:
from System import EventHandler from System.Windows.Browser import Htmlpage, HtmlEventArgs document = System.Windows.Browser.HtmlPage.Document def onkeypress(s, e): document.result.innerHTML += "KeyPress
" document.code.AttachEvent("onkeypress", EventHandler[HtmlEventArgs](onkeypress)) Anyway, just wondering if anything was blocking you from hooking HTML events with Python. ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Tuesday, June 17, 2008 2:52 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Python in the Browser updates > > Hello all, > > Sorry for the noise - but tomorrow I hope to package this for a release > and if any of you get the chance to give me any feedback before then. > > http://www.voidspace.org.uk/ironpython/silverlight-console/console.html > > I think I have fixed all the basic usability issues (it is no longer > possible to screw up the console so that it refuses further input for > example). To *really* fix input I ought to move execution into its own > thread so that we can interrupt infinite loops [1] - but that is a > bigger change so I am resisting it for the moment. > > The big change is that I have added some simple code snippets - as an > example of how it could be used in tutorials or for teaching Python. > > It is also easy to customize - the source code (200 lines of Python, 70 > lines of Javascript, 25 lines of C#) shows how to prepopulate the > execution context and show the first few lines of code in the > interpreter. > > You can get the sourcecode from the repository of course: > > http://code.google.com/p/pythoninthebrowser/ > > All the best, > > Michael Foord > > [1] and then decide whether on windows a ctrl-c should send a keyboard > interrupt or copy to the clipboard... > > Michael Foord wrote: > > For those who are interested, I've updated "Python in the Browser". > > > > Both the repository: > > > > http://code.google.com/p/pythoninthebrowser/ > > > > And the online demo: > > > > http://www.voidspace.org.uk/ironpython/silverlight- > console/console.html > > > > There are a few minor but nice improvements: > > > > * The Javascript now works with IE 7! > > * The textarea scrolls as input is printed > > * The context window is disabled to prevent you pasting over the > input > > area - not sure if this is really an improvement though... > > * The input area is cleared on load - to stop browsers like Firefox > > and Safari repopulating the textarea for us on browser refresh > > * Recursion limit is set > > > > I think it is basically in a useful state now... I might push out a > > '0.1' release from the current SVN head. > > > > All the best, > > > > Michael Foord > > > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From miha.valencic at gmail.com Wed Jun 18 09:10:15 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Wed, 18 Jun 2008 09:10:15 +0200 Subject: [IronPython] Python in the Browser updates In-Reply-To: <485786FE.5020502@voidspace.org.uk> References: <4856F194.7040004@voidspace.org.uk> <233dfa1d0806162220w12ce515bx6d2407243302eb2d@mail.gmail.com> <485786FE.5020502@voidspace.org.uk> Message-ID: <233dfa1d0806180010n6e436b74j5f44b06e93dcad10@mail.gmail.com> A couple of observations: the "get sliverlight" on your page links to Windows binaries. I guess msft could detect OS and server appropriate binary for download. I installed the 2.0b2 on Mac -- it's 6.7 MB and not 4MB, as it says. :) And it does take more than 10s to install, but all went fine. Works in safari and ff2. Great work! All I wanted was just run it in the browser and I actually only needed Msft Silverlight package. Thanks! Miha ps: do you think that the page could link to appropriate Silverlight package for download if it is not installed? On Tue, Jun 17, 2008 at 11:42 AM, Michael Foord wrote: > Miha Valencic wrote: > >> Any ideas how to get it working on Mac? >> > > I've been developing it on the Mac - so it definitely works. You need > Silverlight 2 Beta 2 installed. You can get this from: > > http://silverlight.net/GetStarted/ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan at slenders.be Wed Jun 18 10:03:54 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Wed, 18 Jun 2008 10:03:54 +0200 Subject: [IronPython] XmlDocument or XDocument in Python/Silverlight In-Reply-To: References: <4858306D.2020308@voidspace.org.uk> Message-ID: How does IronPython receive the results of GetDescendants() or Elements() from the Linq library. PS C:\Documents and Settings\Jonathan\Desktop\IronPython-2.0B3-Bin\IronPython-2.0B3> .\ipy.exe IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> >>> import clr >>> clr.AddReference('System.Xml.Linq') >>> from System.Xml.Linq import XDocument >>> document = '
aaabbbccc' >>> XDocument.Parse(document).Element('root').Element('a') aaa]> >>> XDocument.Parse(document).Element('root').Elements('a') d__11 object at 0x0000000000000033 [System.Xml.Linq.XContainer+d__11]> >>> for i in XDocument.Parse(document).Element('root').Elements('a'): ... print i ... >>> The for loop doesn't return any result, but it also doesn't raise an exception. The MSDN documentation has only examples for c# which all use the "from ... select ...." syntax from Linq which isn't available here. Jonathan 2008/6/18 Jonathan Slenders : > Thank you, Michael > > I had to: > > import clr > clr.AddReference('System.Xml.Linq') > > > > 2008/6/17 Michael Foord : > > Hello Jonathan, >> >> Do you need to add a reference to the assembly before importing from it? >> >> In the Silverlight chapter of IronPython in Action I use 'XmlReader' for >> parsing XML. I have already (in an earlier chapter) provided a wrapper over >> this that gives it a SAX like interface. The code worked unmodified on >> Silverlight! >> >> Michael Foord >> >> Jonathan Slenders wrote: >> >>> Hello, >>> >>> It seems that XmlDocument isn't available in Silverlight. The Linq dll >>> ("System.Xml.Linq.dll") is listed between the client libraries, but when I >>> add them to my Silverlight manifest file >>> and try: >>> >>> from System.Xml.Linq import XDocument >>> >>> The following error occurs: "ManagedRuntimeError, SetProperty failed" >>> >>> What's the recommended way to query XML documents? A good XML library is >>> essential at the client for doing AJAX (in our case: APAX), I wonder in the >>> first place why XmlDocument isn't in Silverlight by default. >>> I don't want to use a SAX parser like XmlReader. >>> >>> Jonathan >>> >>> >>> PS: When the XML parsing works, I can present a working APAX example for >>> querying a mysql database. It returns row after row every time the client >>> does a request for the next row. The javascript version works, and I'm >>> porting it now to Silverlight/IronPython. >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >> >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.theotherdelia.co.uk/ >> http://www.voidspace.org.uk/ >> http://www.ironpython.info/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 jonathan at slenders.be Wed Jun 18 11:57:23 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Wed, 18 Jun 2008 11:57:23 +0200 Subject: [IronPython] XmlDocument or XDocument in Python/Silverlight In-Reply-To: References: <4858306D.2020308@voidspace.org.uk> Message-ID: 2008/6/18 Jonathan Slenders : > How does IronPython receive the results of GetDescendants() or Elements() > from the Linq library. > > PS C:\Documents and > Settings\Jonathan\Desktop\IronPython-2.0B3-Bin\IronPython-2.0B3> .\ipy.exe > IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1433 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> > >>> import clr > >>> clr.AddReference('System.Xml.Linq') > >>> from System.Xml.Linq import XDocument > >>> document = 'aaabbbccc' > >>> XDocument.Parse(document).Element('root').Element('a') > aaa]> > >>> XDocument.Parse(document).Element('root').Elements('a') > d__11 object at 0x0000000000000033 > [System.Xml.Linq.XContainer+d__11]> > >>> for i in XDocument.Parse(document).Element('root').Elements('a'): > ... print i > ... > >>> > > The for loop doesn't return any result, but it also doesn't raise an > exception. The MSDN documentation has only examples for c# which all use the > "from ... select ...." syntax from Linq which isn't available here. > > Jonathan > And another question, which is rather Silverlight then IronPython related. I hope it's okey to ask it here. How should I create a TextNode from Silverlight with IronPython code? In javascript, one would: node = document.createTextNode("text"); element.appendChild(node); According to the MSDN documentation, the HtmlDocument class doesn't have a createTextNode, and I can't find it anywhere else. Michael his book has been extremely useful for me, but he uses innerHtml which i really don't like. InnerHtml is is an old-style method for DOM-manipulation, and unsafe by definition. (it allows you to insert HTML code) So far, I worked around my previous problem by using the NextNode property, which works fine. Though not as nice as iterators would be: def insert_rows(rows): html_table = HtmlPage.Document.GetElementById('mysql-api-test-table') row = XDocument.Parse(rows).Element('table').Element('row') while row != None: html_row = HtmlPage.Document.CreateElement('tr') field = row.Element('field') while field != None: html_field = HtmlPage.Document.CreateElement('td') #html_field.Children.Add(HtmlPage.Document.CreateTextNode(field.Value)) # Doesn't exist?? html_row.AppendChild(html_field) field = field.NextNode html_table.AppendChild(html_row) row = row.NextNode Thank you Jonathan -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Wed Jun 18 12:01:23 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 18 Jun 2008 11:01:23 +0100 Subject: [IronPython] Python in the Browser updates In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845CC6216BA@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4856F194.7040004@voidspace.org.uk> <485831ED.2050304@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC6216BA@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <4858DCF3.1000302@voidspace.org.uk> Jimmy Schementi wrote: > Michael, question for you: > > >> On every keypress Javascript calls into IronPython (via the C#!). >> > > How come you used C# to handle the onkeypress event? This should do it in Python: > > Did you look at the code to see why? I'd be really interested to know if I can do what I'm doing from Python inside Silverlight, but I doubt it. There's not much code in total, so it should be easy to follow. I actually handle the onkeypress event from Javascript (onkeypress.js). This calls into 'getSelection' (cursor_pos.js) to work out the current selection in the textarea. Naturally this is easy to do in Firefox / Safari and scarily awful in IE. :-) Having worked these out (and shortcut a few specific scenarios - like ctrl-A, ctrl-Z and ctrl-C), the Javascript then calls into IronPython with the selection start, selection end, and the character that was pressed. I use C# to expose a scriptable type that Javascript can call. I use attaching events from Python to provide the sample code. There are three links above the console and Python handles the 'onclick' event to swap the examples around. Michael Foord > >
> > from System import EventHandler > from System.Windows.Browser import Htmlpage, HtmlEventArgs > > document = System.Windows.Browser.HtmlPage.Document > def onkeypress(s, e): > document.result.innerHTML += "KeyPress
" > document.code.AttachEvent("onkeypress", EventHandler[HtmlEventArgs](onkeypress)) > > Anyway, just wondering if anything was blocking you from hooking HTML events with Python. > > ~js > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Tuesday, June 17, 2008 2:52 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Python in the Browser updates >> >> Hello all, >> >> Sorry for the noise - but tomorrow I hope to package this for a release >> and if any of you get the chance to give me any feedback before then. >> >> http://www.voidspace.org.uk/ironpython/silverlight-console/console.html >> >> I think I have fixed all the basic usability issues (it is no longer >> possible to screw up the console so that it refuses further input for >> example). To *really* fix input I ought to move execution into its own >> thread so that we can interrupt infinite loops [1] - but that is a >> bigger change so I am resisting it for the moment. >> >> The big change is that I have added some simple code snippets - as an >> example of how it could be used in tutorials or for teaching Python. >> >> It is also easy to customize - the source code (200 lines of Python, 70 >> lines of Javascript, 25 lines of C#) shows how to prepopulate the >> execution context and show the first few lines of code in the >> interpreter. >> >> You can get the sourcecode from the repository of course: >> >> http://code.google.com/p/pythoninthebrowser/ >> >> All the best, >> >> Michael Foord >> >> [1] and then decide whether on windows a ctrl-c should send a keyboard >> interrupt or copy to the clipboard... >> >> Michael Foord wrote: >> >>> For those who are interested, I've updated "Python in the Browser". >>> >>> Both the repository: >>> >>> http://code.google.com/p/pythoninthebrowser/ >>> >>> And the online demo: >>> >>> http://www.voidspace.org.uk/ironpython/silverlight- >>> >> console/console.html >> >>> There are a few minor but nice improvements: >>> >>> * The Javascript now works with IE 7! >>> * The textarea scrolls as input is printed >>> * The context window is disabled to prevent you pasting over the >>> >> input >> >>> area - not sure if this is really an improvement though... >>> * The input area is cleared on load - to stop browsers like Firefox >>> and Safari repopulating the textarea for us on browser refresh >>> * Recursion limit is set >>> >>> I think it is basically in a useful state now... I might push out a >>> '0.1' release from the current SVN head. >>> >>> All the best, >>> >>> Michael Foord >>> >>> >> -- >> http://www.ironpythoninaction.com/ >> http://www.theotherdelia.co.uk/ >> http://www.voidspace.org.uk/ >> http://www.ironpython.info/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 jonathan at slenders.be Wed Jun 18 12:44:41 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Wed, 18 Jun 2008 12:44:41 +0200 Subject: [IronPython] Python in the Browser updates In-Reply-To: <4858DCF3.1000302@voidspace.org.uk> References: <4856F194.7040004@voidspace.org.uk> <485831ED.2050304@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC6216BA@NA-EXMSG-C116.redmond.corp.microsoft.com> <4858DCF3.1000302@voidspace.org.uk> Message-ID: 2008/6/18 Michael Foord : > Jimmy Schementi wrote: > >> Michael, question for you: >> >> >> >>> On every keypress Javascript calls into IronPython (via the C#!). >>> >>> >> >> How come you used C# to handle the onkeypress event? This should do it in >> Python: >> >> >> > > Did you look at the code to see why? I'd be really interested to know if I > can do what I'm doing from Python inside Silverlight, but I doubt it. > There's not much code in total, so it should be easy to follow. > > I actually handle the onkeypress event from Javascript (onkeypress.js). > This calls into 'getSelection' (cursor_pos.js) to work out the current > selection in the textarea. Naturally this is easy to do in Firefox / Safari > and scarily awful in IE. :-) > > Having worked these out (and shortcut a few specific scenarios - like > ctrl-A, ctrl-Z and ctrl-C), the Javascript then calls into IronPython with > the selection start, selection end, and the character that was pressed. I > use C# to expose a scriptable type that Javascript can call. > > I use attaching events from Python to provide the sample code. There are > three links above the console and Python handles the 'onclick' event to swap > the examples around. > I think Jimmy is right here. And the parts you did in javascript, could also be done in Silverlight. Some suggestions how I would do this: - instead of a text area, I'd use a html
, with CSS "overflow: auto;" for the scrollbars. - insert a

tag for each line into the

. - capture the body.onkeypress events for input - keep a textinput buffer in IronPython, but show the last line by copying it on each keypress to the last

- The cursor could be , styled in CSS to show a pinking cursor. - handle the left/right arrows to shift the cursor - handle the up/down arrows to replace the last

with the second last executed command - on a "enter" press, process that line. - when using a

, it's even very easy to do syntax highlighting on the fly. Surround known keywords by a and style them. That shouldn't be too hard to do. But you should decide whether it's necessary to have this all in IronPython. Probably, it's the cleanest way to do it. Jonathan -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonathan at slenders.be Wed Jun 18 13:54:19 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Wed, 18 Jun 2008 13:54:19 +0200 Subject: [IronPython] Python Pages -> Working APAX code Message-ID: Hello I got my first APAX code working, and I'm actually a little proud about it. The webpage contains a Silverlight control at the client, which queries a database at the server through APAX. It parses the result with the Linq library and inserts them into the DOM. The server publishes an XML API, and the client can request row after row. When the client need e.g. 10 rows, the API returns only 10 rows, and later on, the client can request the following 10 until the connection has been closed. The code at the server is based on a template. So, if one needs to publish an API for another database table. He creates a new page based on the mysql-database-xml-api master page and sets a few variables like dbtable, etc.. The Silverlight control is also based on my silvelight-xap master page which creates the xap file on the fly when requested. The code for the API however, isn't yet abstracted. The current version of Python Pages is installed and running at the following URL. It uses Silverlight 2, beta 2. http://home.slenders.be:8000/ Click the "test pages" link and then "silverlight client", or "javascript client". At the bottom of each page, a link "view source code" is available. Feel free to click them and see the server side code. You may also want to look at the documentation, and other test pages. In the Administration page, please don't click the "self test" button more then once. What it does is rendering all the pages in the framework and generating an overview of which pages do and which don't work. (Pretty heavy for my little server.) The web based debugger shows the breakpoints, but also isn't fully implemented -- just don't waste too much time there now. I hope it's worth something. At least, I can't find anyone who's done this before in IPy. Jonathan PS: I didn't yet receive an answer for my last two questions, so if someone knowns about this... (document.createTextNode() and using iterators in IPy to walk through a Linq element container) PS2: Please don't abuse my home server. The Internet connection isn't that fast, and the server itself isn't too. :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.muirhead at resolversystems.com Wed Jun 18 17:06:54 2008 From: christian.muirhead at resolversystems.com (Christian Muirhead) Date: Wed, 18 Jun 2008 16:06:54 +0100 Subject: [IronPython] Hosting: passing arguments to scripts? Message-ID: <4859248E.70000@resolversystems.com> Hey guys - I'm looking at running Resolver One on IP2B3, and it took a long time to work out how to pass an argument in to a script to run - it seemed like I should be able to set the ScriptEngine.Options.Arguments, but that resulted in an empty sys.argv. In the end I dug around in the source and found the following, which works: List argList = new List(); argList.extend(args); PythonContext context = (PythonContext)HostingHelpers.GetLanguageContext(engine); context.SystemState.Dict[SymbolTable.StringToId("argv")] = argList; There are comments on HostingHelper not really being intended for hosts - is there a better/less likely to go away method of doing this? Thanks, Christian -- Christian Muirhead Resolver Systems christian.muirhead at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ Resolver Systems Ltd 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK From dinov at exchange.microsoft.com Wed Jun 18 17:24:51 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 18 Jun 2008 08:24:51 -0700 Subject: [IronPython] Hosting: passing arguments to scripts? In-Reply-To: <4859248E.70000@resolversystems.com> References: <4859248E.70000@resolversystems.com> Message-ID: <7AD436E4270DD54A94238001769C2227012BC9F4FFC6@DF-GRTDANE-MSG.exchange.corp.microsoft.com> That's probably the best way to do it right now - we need to provide a service for Python specific information (exposed via ScriptEngine.GetService) or provide a PythonEngine wrapper which enables Python specific behavior. At this point that might be a feature that waits for post 2.0 though. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Christian Muirhead Sent: Wednesday, June 18, 2008 8:07 AM To: Discussion of IronPython Subject: [IronPython] Hosting: passing arguments to scripts? Hey guys - I'm looking at running Resolver One on IP2B3, and it took a long time to work out how to pass an argument in to a script to run - it seemed like I should be able to set the ScriptEngine.Options.Arguments, but that resulted in an empty sys.argv. In the end I dug around in the source and found the following, which works: List argList = new List(); argList.extend(args); PythonContext context = (PythonContext)HostingHelpers.GetLanguageContext(engine); context.SystemState.Dict[SymbolTable.StringToId("argv")] = argList; There are comments on HostingHelper not really being intended for hosts - is there a better/less likely to go away method of doing this? Thanks, Christian -- Christian Muirhead Resolver Systems christian.muirhead at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ Resolver Systems Ltd 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From lists.ironpython.com at ka.weltenschmiede.com Wed Jun 18 17:43:49 2008 From: lists.ironpython.com at ka.weltenschmiede.com (Korbinian Abenthum) Date: Wed, 18 Jun 2008 17:43:49 +0200 Subject: [IronPython] Operator overloading, and implicit conversion from Double to Single in operators References: <00b301c8d08c_75a9cbc0_14b2a8c0@lannisport> <7AD436E4270DD54A94238001769C2227012BC9F4FE44@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <011b01c8d15a_1a3ee350_14b2a8c0@lannisport> Dino Viehland wrote: > Great question. The reason why operators get treated > differently due to things like: > > [2, 3] * 2.0 > > For this call we cannot coerce the float into an int by Python > semantics. Compare this to: > > xrange(2.0) > > which is allowed (but in CPython issues a warning). > > So in general Python seems to be more restrictive on binary > operators then it does on method calls. Hmm. I know very little of Python, but that is a bold conclusion if it's only based on these two examples. :) The second call issues a "DeprecationWarning" - the reason for why Python is less restrictive there seems purely historical to me. > We've mirrored this behavior in IronPython through our support of > .NET operator overloading. That allows us to implement the standard > Python semantics in a manner which .NET understands - for example > our List class implements operator * and a C# programmer could do > someList * 3. We then just automatically expose these operators > out to Python in a way which Python expects - including returning > NotImplemented if the parameters aren't compatible. That's of course the desired behavior, but I think that to mirror this it'd make more sense to only distinguish between integer and floating point numbers, just like Python does, especially since it's rather cumbersome to get to floats in IronPython. Or, to be consistent with method calls where all numbers are downcast, just do the same with operators and solve this with overloads: The Sequence multiplication can get both a multiplication operator with an int and one with a float. I don't know how you choose between overloads, but if calls with an integer argument prefer the first, and with a floating points prefer the second (which throws NotImplemented) then you're done. But it could be that I'm still missing the big picture. > We could look at relaxing this in the future (in particular > for non-Python types) but I think we have bigger fish to fry > for the immediate future - and it might just make things that > much more confusing as well. If it's particularly troublesome > I'd suggest opening a feature request on CodePlex so we can > gauge how many people it's affecting by keeping track of the > votes. My problem was that I couldn't figure out what I was doing wrong, why I could still multiply my vectors with integers, and why it worked if I called the static op_Multiply method myself - that is until you removed exposure of static operator methods in B2.2 or B2.3 ;) I don't have to do much vector math in my scripts, so now that I know how to properly workaround I can definitely live with it, but I still think it's a bug and that it would make sense to change it some day. BTW thanks for fixing #16693 - I'm glad that I can use globals in generators again. :) Cheers, Korbinian From ckupec at mvlc.org Wed Jun 18 21:30:31 2008 From: ckupec at mvlc.org (joeymcjoejoe) Date: Wed, 18 Jun 2008 12:30:31 -0700 (PDT) Subject: [IronPython] Using pyc.py to make stand-alone executables Message-ID: <17990029.post@talk.nabble.com> I seem to be having a problem compiling a stand-alone exe file out of my code. my code is essentially pure Python. I'm using just using System.IO to get the FileSystemWatcher. The regular python modules I'm using are these: import sys sys.path.append(r'C:\Python25\Lib') import os import time import datetime import re import shutil import ConfigParser import string import smtplib import email.Message When I run this line: ipy.exe pyc.py /main:myprogram.py I get an executable that removes the need for IronPython on the client. It will run on the compiling machine, plus any other machine with Python installled. But without Python installed, it won't run.So I think I need to include those resources in the compile command, no? How do I include those regular python modules? The pyc sample readme only shows how to take the .Net modules in. What is the proper syntax I need to use? My guess is /res: ? And which ones do I take? The uncompiled ones? Also email.Message is in its own directory "Email\message.py" Some I can't even find in the Lib directory, e.g.: sys, time, datetime. What do I do in that case? -- View this message in context: http://www.nabble.com/Using-pyc.py-to-make-stand-alone-executables-tp17990029p17990029.html Sent from the IronPython mailing list archive at Nabble.com. From dinov at exchange.microsoft.com Wed Jun 18 23:42:42 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 18 Jun 2008 14:42:42 -0700 Subject: [IronPython] IronPython 2.0 Minimum Requirements Message-ID: <7AD436E4270DD54A94238001769C2227012BCA0C0219@DF-GRTDANE-MSG.exchange.corp.microsoft.com> As everyone's probably aware Beta 3 was the first release to officially start requiring .NET 3.5 to compile IronPython and the DLR sources. I just wanted to let everyone know that we've also now formalized what the minimum runtime requirements for IronPython 2.0 will be. The short of this is that IronPython (and the DLR) will start requiring .NET 2.0 SP1. The first IronPython release that will require this will be Beta 4 but it'll start showing up in our source tree sometime next week. The reason for this change is that .NET 2.0 has a few bugs which we've been working around until this point. There's one in particular, referencing generic fields on a type from dynamic methods, which effects our public surface, performance, and compatibility with .NET 3.5 (w.r.t. LINQ Expression trees). As the DLR team continues their work this has become more and more problematic and we're now at the point where they need to be able to move forward. .NET 2.0 SP1 was released last November so we hope that this gives plenty of time between it's release and the final IronPython release to enable most users to upgrade. Also anyone who has deployed .NET 3.5 will also have .NET 2.0 SP1 installed so we're hoping this isn't too high of a bar. If you have any questions or concerns please let us know. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Thu Jun 19 04:38:26 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 19 Jun 2008 11:38:26 +0900 Subject: [IronPython] Using pyc.py to make stand-alone executables In-Reply-To: <17990029.post@talk.nabble.com> References: <17990029.post@talk.nabble.com> Message-ID: <5b0248170806181938t6ea5fb23j94b7e796d75af23@mail.gmail.com> Can't answer other questions, but... 2008/6/19 joeymcjoejoe : > Some I can't even find in the Lib directory, e.g.: sys, time, datetime. What > do I do in that case? Nothing. These modules are implemented in IronPython.dll. -- Seo Sanghyeon From fuzzyman at voidspace.org.uk Thu Jun 19 11:05:16 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 19 Jun 2008 10:05:16 +0100 Subject: [IronPython] Python in the Browser updates In-Reply-To: References: <4856F194.7040004@voidspace.org.uk> <485831ED.2050304@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC6216BA@NA-EXMSG-C116.redmond.corp.microsoft.com> <4858DCF3.1000302@voidspace.org.uk> Message-ID: <485A214C.1060409@voidspace.org.uk> Hello all, Thanks Jonathan. The approach you suggest has several great advantages. The disadvantages are that you lose the ability to copy and paste (I think most browsers forbid you from manipulating the clipboard from Javascript unless the user has fiddled with some obscure settings). For the first release I'll stick with a textarea but I'll prototype your suggestion for the next release and see what I think. Michael Foord Jonathan Slenders wrote: > > > 2008/6/18 Michael Foord >: > > Jimmy Schementi wrote: > > Michael, question for you: > > > > On every keypress Javascript calls into IronPython (via > the C#!). > > > > How come you used C# to handle the onkeypress event? This > should do it in Python: > > > > > Did you look at the code to see why? I'd be really interested to > know if I can do what I'm doing from Python inside Silverlight, > but I doubt it. There's not much code in total, so it should be > easy to follow. > > I actually handle the onkeypress event from Javascript > (onkeypress.js). This calls into 'getSelection' (cursor_pos.js) to > work out the current selection in the textarea. Naturally this is > easy to do in Firefox / Safari and scarily awful in IE. :-) > > Having worked these out (and shortcut a few specific scenarios - > like ctrl-A, ctrl-Z and ctrl-C), the Javascript then calls into > IronPython with the selection start, selection end, and the > character that was pressed. I use C# to expose a scriptable type > that Javascript can call. > > I use attaching events from Python to provide the sample code. > There are three links above the console and Python handles the > 'onclick' event to swap the examples around. > > > > I think Jimmy is right here. And the parts you did in javascript, > could also be done in Silverlight. Some suggestions how I would do this: > - instead of a text area, I'd use a html
, with CSS "overflow: > auto;" for the scrollbars. > - insert a

tag for each line into the

. > - capture the body.onkeypress events for input > - keep a textinput buffer in IronPython, but show the last line by > copying it on each keypress to the last

> - The cursor could be , styled in CSS to show a pinking cursor. > - handle the left/right arrows to shift the cursor > - handle the up/down arrows to replace the last

with the second > last executed command > - on a "enter" press, process that line. > - when using a

, it's even very easy to do syntax highlighting on > the fly. Surround known keywords by a and style > them. > > That shouldn't be too hard to do. But you should decide whether it's > necessary to have this all in IronPython. Probably, it's the cleanest > way to do it. > > Jonathan > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From jonathan at slenders.be Thu Jun 19 12:05:51 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Thu, 19 Jun 2008 12:05:51 +0200 Subject: [IronPython] Python in the Browser updates In-Reply-To: <485A214C.1060409@voidspace.org.uk> References: <4856F194.7040004@voidspace.org.uk> <485831ED.2050304@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC6216BA@NA-EXMSG-C116.redmond.corp.microsoft.com> <4858DCF3.1000302@voidspace.org.uk> <485A214C.1060409@voidspace.org.uk> Message-ID: You're right there. Copying is no problem, but pasting is. I don't know how often you paste Python code in an interactive terminal, but you should do it literally line by line because of the extra empty line required in the console to close a definition. So, I don't think it's really that important. If you're interested. The link below is a Vi prototype in the browser written in Javascript. (I hope, you know the basics of Vi, to test it :) ) >From what I remember, it doesn't use a text area, just HTML markup. (It does syncs the content to a text area however, for submitting the form.) http://gpl.internetconnection.net/vi/ Jonathan 2008/6/19 Michael Foord : > Hello all, > > Thanks Jonathan. The approach you suggest has several great advantages. The > disadvantages are that you lose the ability to copy and paste (I think most > browsers forbid you from manipulating the clipboard from Javascript unless > the user has fiddled with some obscure settings). > > For the first release I'll stick with a textarea but I'll prototype your > suggestion for the next release and see what I think. > > Michael Foord > > Jonathan Slenders wrote: > >> >> >> 2008/6/18 Michael Foord > fuzzyman at voidspace.org.uk>>: >> >> >> Jimmy Schementi wrote: >> >> Michael, question for you: >> >> >> On every keypress Javascript calls into IronPython (via >> the C#!). >> >> >> How come you used C# to handle the onkeypress event? This >> should do it in Python: >> >> >> >> Did you look at the code to see why? I'd be really interested to >> know if I can do what I'm doing from Python inside Silverlight, >> but I doubt it. There's not much code in total, so it should be >> easy to follow. >> >> I actually handle the onkeypress event from Javascript >> (onkeypress.js). This calls into 'getSelection' (cursor_pos.js) to >> work out the current selection in the textarea. Naturally this is >> easy to do in Firefox / Safari and scarily awful in IE. :-) >> >> Having worked these out (and shortcut a few specific scenarios - >> like ctrl-A, ctrl-Z and ctrl-C), the Javascript then calls into >> IronPython with the selection start, selection end, and the >> character that was pressed. I use C# to expose a scriptable type >> that Javascript can call. >> >> I use attaching events from Python to provide the sample code. >> There are three links above the console and Python handles the >> 'onclick' event to swap the examples around. >> >> >> >> I think Jimmy is right here. And the parts you did in javascript, could >> also be done in Silverlight. Some suggestions how I would do this: >> - instead of a text area, I'd use a html
, with CSS "overflow: >> auto;" for the scrollbars. >> - insert a

tag for each line into the

. >> - capture the body.onkeypress events for input >> - keep a textinput buffer in IronPython, but show the last line by copying >> it on each keypress to the last

>> - The cursor could be , styled in CSS to show a pinking cursor. >> - handle the left/right arrows to shift the cursor >> - handle the up/down arrows to replace the last

with the second last >> executed command >> - on a "enter" press, process that line. >> - when using a

, it's even very easy to do syntax highlighting on the >> fly. Surround known keywords by a and style them. >> >> That shouldn't be too hard to do. But you should decide whether it's >> necessary to have this all in IronPython. Probably, it's the cleanest way to >> do it. >> >> Jonathan >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> 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 Jimmy.Schementi at microsoft.com Thu Jun 19 12:08:51 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 19 Jun 2008 03:08:51 -0700 Subject: [IronPython] Python in the Browser updates In-Reply-To: <485A214C.1060409@voidspace.org.uk> References: <4856F194.7040004@voidspace.org.uk> <485831ED.2050304@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC6216BA@NA-EXMSG-C116.redmond.corp.microsoft.com> <4858DCF3.1000302@voidspace.org.uk> <485A214C.1060409@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D26B7F17@NA-EXMSG-C116.redmond.corp.microsoft.com> My "Try IronRuby (in the browser)" toy console does doesn't users a 1-row textarea that expands as more rows are added. The previous console output isn't in the textarea, it's moved into a div above it. It's easy to hide everything's borders and set the margins/paddings right with CSS that the effect is transparent. When I get my bits in the wild feel free to rip it off =) ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Thursday, June 19, 2008 2:05 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Python in the Browser updates > > Hello all, > > Thanks Jonathan. The approach you suggest has several great advantages. > The disadvantages are that you lose the ability to copy and paste (I > think most browsers forbid you from manipulating the clipboard from > Javascript unless the user has fiddled with some obscure settings). > > For the first release I'll stick with a textarea but I'll prototype > your > suggestion for the next release and see what I think. > > Michael Foord > > Jonathan Slenders wrote: > > > > > > 2008/6/18 Michael Foord > >: > > > > Jimmy Schementi wrote: > > > > Michael, question for you: > > > > > > > > On every keypress Javascript calls into IronPython (via > > the C#!). > > > > > > > > How come you used C# to handle the onkeypress event? This > > should do it in Python: > > > > > > > > > > Did you look at the code to see why? I'd be really interested to > > know if I can do what I'm doing from Python inside Silverlight, > > but I doubt it. There's not much code in total, so it should be > > easy to follow. > > > > I actually handle the onkeypress event from Javascript > > (onkeypress.js). This calls into 'getSelection' (cursor_pos.js) > to > > work out the current selection in the textarea. Naturally this is > > easy to do in Firefox / Safari and scarily awful in IE. :-) > > > > Having worked these out (and shortcut a few specific scenarios - > > like ctrl-A, ctrl-Z and ctrl-C), the Javascript then calls into > > IronPython with the selection start, selection end, and the > > character that was pressed. I use C# to expose a scriptable type > > that Javascript can call. > > > > I use attaching events from Python to provide the sample code. > > There are three links above the console and Python handles the > > 'onclick' event to swap the examples around. > > > > > > > > I think Jimmy is right here. And the parts you did in javascript, > > could also be done in Silverlight. Some suggestions how I would do > this: > > - instead of a text area, I'd use a html
, with CSS "overflow: > > auto;" for the scrollbars. > > - insert a

tag for each line into the

. > > - capture the body.onkeypress events for input > > - keep a textinput buffer in IronPython, but show the last line by > > copying it on each keypress to the last

> > - The cursor could be , styled in CSS to show a pinking cursor. > > - handle the left/right arrows to shift the cursor > > - handle the up/down arrows to replace the last

with the second > > last executed command > > - on a "enter" press, process that line. > > - when using a

, it's even very easy to do syntax highlighting > on > > the fly. Surround known keywords by a and > style > > them. > > > > That shouldn't be too hard to do. But you should decide whether it's > > necessary to have this all in IronPython. Probably, it's the cleanest > > way to do it. > > > > Jonathan > > --------------------------------------------------------------------- > --- > > > > _______________________________________________ > > 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 fuzzyman at voidspace.org.uk Thu Jun 19 12:12:24 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 19 Jun 2008 11:12:24 +0100 Subject: [IronPython] Python in the Browser updates In-Reply-To: References: <4856F194.7040004@voidspace.org.uk> <485831ED.2050304@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC6216BA@NA-EXMSG-C116.redmond.corp.microsoft.com> <4858DCF3.1000302@voidspace.org.uk> <485A214C.1060409@voidspace.org.uk> Message-ID: <485A3108.80606@voidspace.org.uk> Jonathan Slenders wrote: > You're right there. Copying is no problem, but pasting is. I don't > know how often you paste Python code in an interactive terminal, but > you should do it literally line by line because of the extra empty > line required in the console to close a definition. So, I don't think > it's really that important. > I'm forever pasting into consoles... But that aside, both you and Jimmy make some very good suggestions. > If you're interested. The link below is a Vi prototype in the browser > written in Javascript. (I hope, you know the basics of Vi, to test it > :) ) Yep - it feels very broken, which has always been my experience when working with Vi... :-) Michael > From what I remember, it doesn't use a text area, just HTML markup. > (It does syncs the content to a text area however, for submitting the > form.) > > http://gpl.internetconnection.net/vi/ > > Jonathan > > 2008/6/19 Michael Foord >: > > Hello all, > > Thanks Jonathan. The approach you suggest has several great > advantages. The disadvantages are that you lose the ability to > copy and paste (I think most browsers forbid you from manipulating > the clipboard from Javascript unless the user has fiddled with > some obscure settings). > > For the first release I'll stick with a textarea but I'll > prototype your suggestion for the next release and see what I think. > > Michael Foord > > Jonathan Slenders wrote: > > > > 2008/6/18 Michael Foord > >>: > > > Jimmy Schementi wrote: > > Michael, question for you: > > > On every keypress Javascript calls into IronPython (via > the C#!). > > > How come you used C# to handle the onkeypress event? This > should do it in Python: > > > > Did you look at the code to see why? I'd be really > interested to > know if I can do what I'm doing from Python inside Silverlight, > but I doubt it. There's not much code in total, so it should be > easy to follow. > > I actually handle the onkeypress event from Javascript > (onkeypress.js). This calls into 'getSelection' > (cursor_pos.js) to > work out the current selection in the textarea. Naturally > this is > easy to do in Firefox / Safari and scarily awful in IE. :-) > > Having worked these out (and shortcut a few specific > scenarios - > like ctrl-A, ctrl-Z and ctrl-C), the Javascript then calls into > IronPython with the selection start, selection end, and the > character that was pressed. I use C# to expose a scriptable > type > that Javascript can call. > > I use attaching events from Python to provide the sample code. > There are three links above the console and Python handles the > 'onclick' event to swap the examples around. > > > > I think Jimmy is right here. And the parts you did in > javascript, could also be done in Silverlight. Some > suggestions how I would do this: > - instead of a text area, I'd use a html
, with CSS > "overflow: auto;" for the scrollbars. > - insert a

tag for each line into the

. > - capture the body.onkeypress events for input > - keep a textinput buffer in IronPython, but show the last > line by copying it on each keypress to the last

> - The cursor could be , styled in CSS to show a pinking > cursor. > - handle the left/right arrows to shift the cursor > - handle the up/down arrows to replace the last

with the > second last executed command > - on a "enter" press, process that line. > - when using a

, it's even very easy to do syntax > highlighting on the fly. Surround known keywords by a class="keyword"> and style them. > > That shouldn't be too hard to do. But you should decide > whether it's necessary to have this all in IronPython. > Probably, it's the cleanest way to do it. > > Jonathan > ------------------------------------------------------------------------ > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From Jimmy.Schementi at microsoft.com Thu Jun 19 12:12:41 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 19 Jun 2008 03:12:41 -0700 Subject: [IronPython] Python in the Browser updates In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845D26B7F17@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4856F194.7040004@voidspace.org.uk> <485831ED.2050304@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC6216BA@NA-EXMSG-C116.redmond.corp.microsoft.com> <4858DCF3.1000302@voidspace.org.uk> <485A214C.1060409@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D26B7F17@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D26B7F18@NA-EXMSG-C116.redmond.corp.microsoft.com> Whoa, 3am typo: "... toy console *uses* a 1-row ..." > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi > Sent: Thursday, June 19, 2008 3:09 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Python in the Browser updates > > My "Try IronRuby (in the browser)" toy console does doesn't users a 1- > row textarea that expands as more rows are added. The previous console > output isn't in the textarea, it's moved into a div above it. It's easy > to hide everything's borders and set the margins/paddings right with > CSS that the effect is transparent. > > When I get my bits in the wild feel free to rip it off =) > > ~js > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > > bounces at lists.ironpython.com] On Behalf Of Michael Foord > > Sent: Thursday, June 19, 2008 2:05 AM > > To: Discussion of IronPython > > Subject: Re: [IronPython] Python in the Browser updates > > > > Hello all, > > > > Thanks Jonathan. The approach you suggest has several great > advantages. > > The disadvantages are that you lose the ability to copy and paste (I > > think most browsers forbid you from manipulating the clipboard from > > Javascript unless the user has fiddled with some obscure settings). > > > > For the first release I'll stick with a textarea but I'll prototype > > your > > suggestion for the next release and see what I think. > > > > Michael Foord > > > > Jonathan Slenders wrote: > > > > > > > > > 2008/6/18 Michael Foord > > >: > > > > > > Jimmy Schementi wrote: > > > > > > Michael, question for you: > > > > > > > > > > > > On every keypress Javascript calls into IronPython (via > > > the C#!). > > > > > > > > > > > > How come you used C# to handle the onkeypress event? This > > > should do it in Python: > > > > > > > > > > > > > > > Did you look at the code to see why? I'd be really interested > to > > > know if I can do what I'm doing from Python inside Silverlight, > > > but I doubt it. There's not much code in total, so it should be > > > easy to follow. > > > > > > I actually handle the onkeypress event from Javascript > > > (onkeypress.js). This calls into 'getSelection' (cursor_pos.js) > > to > > > work out the current selection in the textarea. Naturally this > is > > > easy to do in Firefox / Safari and scarily awful in IE. :-) > > > > > > Having worked these out (and shortcut a few specific scenarios > - > > > like ctrl-A, ctrl-Z and ctrl-C), the Javascript then calls into > > > IronPython with the selection start, selection end, and the > > > character that was pressed. I use C# to expose a scriptable > type > > > that Javascript can call. > > > > > > I use attaching events from Python to provide the sample code. > > > There are three links above the console and Python handles the > > > 'onclick' event to swap the examples around. > > > > > > > > > > > > I think Jimmy is right here. And the parts you did in javascript, > > > could also be done in Silverlight. Some suggestions how I would do > > this: > > > - instead of a text area, I'd use a html
, with CSS > "overflow: > > > auto;" for the scrollbars. > > > - insert a

tag for each line into the

. > > > - capture the body.onkeypress events for input > > > - keep a textinput buffer in IronPython, but show the last line by > > > copying it on each keypress to the last

> > > - The cursor could be , styled in CSS to show a pinking > cursor. > > > - handle the left/right arrows to shift the cursor > > > - handle the up/down arrows to replace the last

with the second > > > last executed command > > > - on a "enter" press, process that line. > > > - when using a

, it's even very easy to do syntax highlighting > > on > > > the fly. Surround known keywords by a and > > style > > > them. > > > > > > That shouldn't be too hard to do. But you should decide whether > it's > > > necessary to have this all in IronPython. Probably, it's the > cleanest > > > way to do it. > > > > > > Jonathan > > > ------------------------------------------------------------------- > -- > > --- > > > > > > _______________________________________________ > > > Users mailing list > > > Users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Thu Jun 19 12:12:46 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 19 Jun 2008 11:12:46 +0100 Subject: [IronPython] Python in the Browser updates In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845D26B7F17@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4856F194.7040004@voidspace.org.uk> <485831ED.2050304@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845CC6216BA@NA-EXMSG-C116.redmond.corp.microsoft.com> <4858DCF3.1000302@voidspace.org.uk> <485A214C.1060409@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D26B7F17@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <485A311E.6070702@voidspace.org.uk> Jimmy Schementi wrote: > My "Try IronRuby (in the browser)" toy console does doesn't users a 1-row textarea that expands as more rows are added. The previous console output isn't in the textarea, it's moved into a div above it. It's easy to hide everything's borders and set the margins/paddings right with CSS that the effect is transparent. > > When I get my bits in the wild feel free to rip it off =) > I probably will do... Michael > ~js > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Thursday, June 19, 2008 2:05 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Python in the Browser updates >> >> Hello all, >> >> Thanks Jonathan. The approach you suggest has several great advantages. >> The disadvantages are that you lose the ability to copy and paste (I >> think most browsers forbid you from manipulating the clipboard from >> Javascript unless the user has fiddled with some obscure settings). >> >> For the first release I'll stick with a textarea but I'll prototype >> your >> suggestion for the next release and see what I think. >> >> Michael Foord >> >> Jonathan Slenders wrote: >> >>> 2008/6/18 Michael Foord >> >: >>> >>> Jimmy Schementi wrote: >>> >>> Michael, question for you: >>> >>> >>> >>> On every keypress Javascript calls into IronPython (via >>> the C#!). >>> >>> >>> >>> How come you used C# to handle the onkeypress event? This >>> should do it in Python: >>> >>> >>> >>> >>> Did you look at the code to see why? I'd be really interested to >>> know if I can do what I'm doing from Python inside Silverlight, >>> but I doubt it. There's not much code in total, so it should be >>> easy to follow. >>> >>> I actually handle the onkeypress event from Javascript >>> (onkeypress.js). This calls into 'getSelection' (cursor_pos.js) >>> >> to >> >>> work out the current selection in the textarea. Naturally this is >>> easy to do in Firefox / Safari and scarily awful in IE. :-) >>> >>> Having worked these out (and shortcut a few specific scenarios - >>> like ctrl-A, ctrl-Z and ctrl-C), the Javascript then calls into >>> IronPython with the selection start, selection end, and the >>> character that was pressed. I use C# to expose a scriptable type >>> that Javascript can call. >>> >>> I use attaching events from Python to provide the sample code. >>> There are three links above the console and Python handles the >>> 'onclick' event to swap the examples around. >>> >>> >>> >>> I think Jimmy is right here. And the parts you did in javascript, >>> could also be done in Silverlight. Some suggestions how I would do >>> >> this: >> >>> - instead of a text area, I'd use a html
, with CSS "overflow: >>> auto;" for the scrollbars. >>> - insert a

tag for each line into the

. >>> - capture the body.onkeypress events for input >>> - keep a textinput buffer in IronPython, but show the last line by >>> copying it on each keypress to the last

>>> - The cursor could be , styled in CSS to show a pinking cursor. >>> - handle the left/right arrows to shift the cursor >>> - handle the up/down arrows to replace the last

with the second >>> last executed command >>> - on a "enter" press, process that line. >>> - when using a

, it's even very easy to do syntax highlighting >>> >> on >> >>> the fly. Surround known keywords by a and >>> >> style >> >>> them. >>> >>> That shouldn't be too hard to do. But you should decide whether it's >>> necessary to have this all in IronPython. Probably, it's the cleanest >>> way to do it. >>> >>> Jonathan >>> --------------------------------------------------------------------- >>> >> --- >> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From peter at peterryan.net Thu Jun 19 22:44:05 2008 From: peter at peterryan.net (peter_ryan) Date: Thu, 19 Jun 2008 13:44:05 -0700 (PDT) Subject: [IronPython] Disabling "Send a message to Microsoft popup" Message-ID: <18017714.post@talk.nabble.com> I have an iron python process that is running and every once in awhile it displays the "IronPython Console has encountered an error and needs to close" popup. The ipy process closes but locks to referenced assemblies remain until I click "Don't Send." Is there a way to prevent Iron Python from launching this popup or at least handle it programmatically? I am trying to create an automated process and this popup is blocking the run as I am waiting for the assemblies to unlock so I can delete them. Right now I do not have the ability to fix the error causing the popup. Thanks! Peter -- View this message in context: http://www.nabble.com/Disabling-%22Send-a-message-to-Microsoft-popup%22-tp18017714p18017714.html Sent from the IronPython mailing list archive at Nabble.com. From fuzzyman at voidspace.org.uk Thu Jun 19 22:45:39 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 19 Jun 2008 21:45:39 +0100 Subject: [IronPython] Disabling "Send a message to Microsoft popup" In-Reply-To: <18017714.post@talk.nabble.com> References: <18017714.post@talk.nabble.com> Message-ID: <485AC573.2010501@voidspace.org.uk> Hello Peter, You'll find this article interesting. http://freshfoo.com/blog/dotnet_exceptions Michael peter_ryan wrote: > I have an iron python process that is running and every once in awhile it > displays the "IronPython Console has encountered an error and needs to > close" popup. The ipy process closes but locks to referenced assemblies > remain until I click "Don't Send." > > Is there a way to prevent Iron Python from launching this popup or at least > handle it programmatically? I am trying to create an automated process and > this popup is blocking the run as I am waiting for the assemblies to unlock > so I can delete them. > > Right now I do not have the ability to fix the error causing the popup. > > Thanks! > > Peter > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Thu Jun 19 22:48:19 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 19 Jun 2008 21:48:19 +0100 Subject: [IronPython] Using pyc.py to make stand-alone executables In-Reply-To: <17990029.post@talk.nabble.com> References: <17990029.post@talk.nabble.com> Message-ID: <485AC613.7060101@voidspace.org.uk> joeymcjoejoe wrote: > I seem to be having a problem compiling a stand-alone exe file out of my > code. > > my code is essentially pure Python. I'm using just using System.IO to get > the FileSystemWatcher. > > The regular python modules I'm using are these: > > import sys > sys.path.append(r'C:\Python25\Lib') > import os > import time > import datetime > import re > import shutil > import ConfigParser > import string > import smtplib > import email.Message > > When I run this line: > > ipy.exe pyc.py /main:myprogram.py > > I get an executable that removes the need for IronPython on the client. It > will run on the compiling machine, plus any other machine with Python > installled. > > You still need the IronPython assemblies of course. > But without Python installed, it won't run.So I think I need to include > those resources in the compile command, no? > > How do I include those regular python modules? The pyc sample readme only > shows how to take the .Net modules in. What is the proper syntax I need to > use? My guess is /res: ? > No - the modules need to be available to import in the usual way. You can compile these as well if you want. > And which ones do I take? The uncompiled ones? > > Also email.Message is in its own directory "Email\message.py" > > This is a Python package. Even if you ship it compiled it will still need to be in a directory like this for the Python import to work. Michael Foord > Some I can't even find in the Lib directory, e.g.: sys, time, datetime. What > do I do in that case? > > > > -- http://www.ironpythoninaction.com/ http://www.theotherdelia.co.uk/ http://www.voidspace.org.uk/ http://www.ironpython.info/ http://www.resolverhacks.net/ From peter at peterryan.net Thu Jun 19 22:59:51 2008 From: peter at peterryan.net (Peter Ryan) Date: Thu, 19 Jun 2008 15:59:51 -0500 Subject: [IronPython] Disabling "Send a message to Microsoft popup" In-Reply-To: <485AC573.2010501@voidspace.org.uk> References: <18017714.post@talk.nabble.com> <485AC573.2010501@voidspace.org.uk> Message-ID: <485AC8C7.4090803@peterryan.net> Thanks! The second solution (exceptions occurring off the main thread) solved my problem. Michael Foord wrote: > Hello Peter, > > You'll find this article interesting. > > http://freshfoo.com/blog/dotnet_exceptions > > Michael From M.J.Clarke at rl.ac.uk Fri Jun 20 13:26:39 2008 From: M.J.Clarke at rl.ac.uk (Clarke, MJ (Matt)) Date: Fri, 20 Jun 2008 12:26:39 +0100 Subject: [IronPython] Problem with Beta3 Message-ID: <57BFD82EEF0CDE41A72C4EDADF8A01B206824499@exchange27.fed.cclrc.ac.uk> Hi, When I try to run these lines from C# (which I borrowed from EngineTest.cs) _env = ScriptRuntime.Create(); _pe = _env.GetEngine("py"); I get the following exception: Microsoft.Scripting.Runtime.MissingTypeException was unhandled Message="Type 'IronPython, IronPython.Runtime.PythonContext' is missing or cannot be loaded." Source="Microsoft.Scripting.Core" Any ideas? Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From christian.muirhead at resolversystems.com Fri Jun 20 13:56:36 2008 From: christian.muirhead at resolversystems.com (Christian Muirhead) Date: Fri, 20 Jun 2008 12:56:36 +0100 Subject: [IronPython] upgrading to ip 2b3 in Resolver One Message-ID: <485B9AF4.1060901@resolversystems.com> Hi guys - I mentioned the other day that I was doing some work towards us porting Resolver One to IP 2b3. I've got it working (mostly), but hit some bumps along the way that I figured it would be worth mentioning here: * As I noted before, passing in arguments to the hosted engine was a bit obscure (although it sounds like the API for this is a work in progress). * Another thing I saw here was that you can't set __name__ in a scope when running a script loaded from a source file - that is, this: ScriptSource source = engine.CreateScriptSourceFromFile("test.py"); ScriptScope scope = e.CreateScope(); scope.SetVariable("__name__", "__main__"); source.Execute(scope); when test.py contains print __name__ prints "test" * Can't assign to an instance's __doc__ attribute - we use this for our documentation generation in one place. (This works in IP 1.1.1, and CPython.) Shouldn't be hard to work around in the meantime. * We get deprecation warnings when we access protected members of C# classes from IP subclasses - I can understand this for code outside of subclasses (which shouldn't work but does in IP 1.1.1), but it would be nice if it still worked from code in a subclass. (This would be easy to work around for us - the protected members are all on dialogs we define in C#, so we can change them to public if we need to.) D'oh - I was just about to tell you about a weird thing I had seen where calling ScriptScope.SetVariable(name, value) when value is None fails - it dispatches to the (string, ObjectHandle) overload for some reason. Then I realised that the problem was that I was trying to use the C# API from IP, when I could just call setattr with the scope instead. That works fine. (And now I remember the .Overloads property to select between them.) Now that it's working, the performance is about 4x slower than under 1.1.1. I'm in the process of drilling down into that for specific operations that are drastically different - hopefully they'll be nicely isolated. Thanks, Christian -- Christian Muirhead Resolver Systems christian.muirhead at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ Resolver Systems Ltd 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK From ben2004uk at googlemail.com Fri Jun 20 14:12:34 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Fri, 20 Jun 2008 13:12:34 +0100 Subject: [IronPython] Problem with Beta3 In-Reply-To: <57BFD82EEF0CDE41A72C4EDADF8A01B206824499@exchange27.fed.cclrc.ac.uk> References: <57BFD82EEF0CDE41A72C4EDADF8A01B206824499@exchange27.fed.cclrc.ac.uk> Message-ID: Hello, Have you referenced Microsoft.Scripting and Microsoft.Scripting.Core in your C# project? Are they the correct version (the only IP was built against). They would be the first things to check, if you still have problems then let us know. Ben Blog.BenHall.me.uk On Fri, Jun 20, 2008 at 12:26 PM, Clarke, MJ (Matt) wrote: > Hi, > > > > When I try to run these lines from C# (which I borrowed from EngineTest.cs) > > > > _env = ScriptRuntime.Create(); > > _pe = _env.GetEngine("py"); > > > > I get the following exception: > > > > Microsoft.Scripting.Runtime.MissingTypeException was unhandled > > Message="Type 'IronPython, IronPython.Runtime.PythonContext' is missing or > cannot be loaded." > > Source="Microsoft.Scripting.Core" > > > > Any ideas? > > > > Matt > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From M.J.Clarke at rl.ac.uk Fri Jun 20 14:40:37 2008 From: M.J.Clarke at rl.ac.uk (Clarke, MJ (Matt)) Date: Fri, 20 Jun 2008 13:40:37 +0100 Subject: [IronPython] Problem with Beta3 In-Reply-To: References: <57BFD82EEF0CDE41A72C4EDADF8A01B206824499@exchange27.fed.cclrc.ac.uk> Message-ID: <57BFD82EEF0CDE41A72C4EDADF8A01B2068244EB@exchange27.fed.cclrc.ac.uk> Hi Ben, thanks for the reply. I have tried using the dlls that came with the binary download and I have also tried rebuilding IP from source and using all the dlls from that - same result. Matt -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ben Hall Sent: 20 June 2008 13:13 To: Discussion of IronPython Subject: Re: [IronPython] Problem with Beta3 Hello, Have you referenced Microsoft.Scripting and Microsoft.Scripting.Core in your C# project? Are they the correct version (the only IP was built against). They would be the first things to check, if you still have problems then let us know. Ben Blog.BenHall.me.uk On Fri, Jun 20, 2008 at 12:26 PM, Clarke, MJ (Matt) wrote: > Hi, > > > > When I try to run these lines from C# (which I borrowed from EngineTest.cs) > > > > _env = ScriptRuntime.Create(); > > _pe = _env.GetEngine("py"); > > > > I get the following exception: > > > > Microsoft.Scripting.Runtime.MissingTypeException was unhandled > > Message="Type 'IronPython, IronPython.Runtime.PythonContext' is missing or > cannot be loaded." > > Source="Microsoft.Scripting.Core" > > > > Any ideas? > > > > Matt > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From curt at hagenlocher.org Fri Jun 20 14:42:56 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 20 Jun 2008 05:42:56 -0700 Subject: [IronPython] Problem with Beta3 In-Reply-To: <57BFD82EEF0CDE41A72C4EDADF8A01B2068244EB@exchange27.fed.cclrc.ac.uk> References: <57BFD82EEF0CDE41A72C4EDADF8A01B206824499@exchange27.fed.cclrc.ac.uk> <57BFD82EEF0CDE41A72C4EDADF8A01B2068244EB@exchange27.fed.cclrc.ac.uk> Message-ID: All four of the DLLs are in your executable directory? On Fri, Jun 20, 2008 at 5:40 AM, Clarke, MJ (Matt) wrote: > Hi Ben, thanks for the reply. > > I have tried using the dlls that came with the binary download and I > have also tried rebuilding IP from source and using all the dlls from > that - same result. > > Matt > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ben Hall > Sent: 20 June 2008 13:13 > To: Discussion of IronPython > Subject: Re: [IronPython] Problem with Beta3 > > Hello, > > Have you referenced Microsoft.Scripting and Microsoft.Scripting.Core > in your C# project? Are they the correct version (the only IP was > built against). > > They would be the first things to check, if you still have problems > then let us know. > > Ben > Blog.BenHall.me.uk > > On Fri, Jun 20, 2008 at 12:26 PM, Clarke, MJ (Matt) > wrote: > > Hi, > > > > > > > > When I try to run these lines from C# (which I borrowed from > EngineTest.cs) > > > > > > > > _env = ScriptRuntime.Create(); > > > > _pe = _env.GetEngine("py"); > > > > > > > > I get the following exception: > > > > > > > > Microsoft.Scripting.Runtime.MissingTypeException was unhandled > > > > Message="Type 'IronPython, IronPython.Runtime.PythonContext' is > missing or > > cannot be loaded." > > > > Source="Microsoft.Scripting.Core" > > > > > > > > Any ideas? > > > > > > > > Matt > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From M.J.Clarke at rl.ac.uk Fri Jun 20 14:48:02 2008 From: M.J.Clarke at rl.ac.uk (Clarke, MJ (Matt)) Date: Fri, 20 Jun 2008 13:48:02 +0100 Subject: [IronPython] Problem with Beta3 In-Reply-To: References: <57BFD82EEF0CDE41A72C4EDADF8A01B206824499@exchange27.fed.cclrc.ac.uk><57BFD82EEF0CDE41A72C4EDADF8A01B2068244EB@exchange27.fed.cclrc.ac.uk> Message-ID: <57BFD82EEF0CDE41A72C4EDADF8A01B2068244F3@exchange27.fed.cclrc.ac.uk> Aha. I was using a test harness to run my library and it did not copy the IronPythonModules.Dll across when I added a reference to my library. It works now. Thanks. Matt From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: 20 June 2008 13:43 To: Discussion of IronPython Subject: Re: [IronPython] Problem with Beta3 All four of the DLLs are in your executable directory? On Fri, Jun 20, 2008 at 5:40 AM, Clarke, MJ (Matt) wrote: Hi Ben, thanks for the reply. I have tried using the dlls that came with the binary download and I have also tried rebuilding IP from source and using all the dlls from that - same result. Matt -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ben Hall Sent: 20 June 2008 13:13 To: Discussion of IronPython Subject: Re: [IronPython] Problem with Beta3 Hello, Have you referenced Microsoft.Scripting and Microsoft.Scripting.Core in your C# project? Are they the correct version (the only IP was built against). They would be the first things to check, if you still have problems then let us know. Ben Blog.BenHall.me.uk On Fri, Jun 20, 2008 at 12:26 PM, Clarke, MJ (Matt) wrote: > Hi, > > > > When I try to run these lines from C# (which I borrowed from EngineTest.cs) > > > > _env = ScriptRuntime.Create(); > > _pe = _env.GetEngine("py"); > > > > I get the following exception: > > > > Microsoft.Scripting.Runtime.MissingTypeException was unhandled > > Message="Type 'IronPython, IronPython.Runtime.PythonContext' is missing or > cannot be loaded." > > Source="Microsoft.Scripting.Core" > > > > Any ideas? > > > > Matt > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben2004uk at googlemail.com Fri Jun 20 15:10:37 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Fri, 20 Jun 2008 14:10:37 +0100 Subject: [IronPython] Problem with Beta3 In-Reply-To: <57BFD82EEF0CDE41A72C4EDADF8A01B2068244F3@exchange27.fed.cclrc.ac.uk> References: <57BFD82EEF0CDE41A72C4EDADF8A01B206824499@exchange27.fed.cclrc.ac.uk> <57BFD82EEF0CDE41A72C4EDADF8A01B2068244EB@exchange27.fed.cclrc.ac.uk> <57BFD82EEF0CDE41A72C4EDADF8A01B2068244F3@exchange27.fed.cclrc.ac.uk> Message-ID: Ahh, I always build into a central folder :) On Fri, Jun 20, 2008 at 1:48 PM, Clarke, MJ (Matt) wrote: > Aha. I was using a test harness to run my library and it did not copy the > IronPythonModules.Dll across when I added a reference to my library. > > > > It works now. > > > > Thanks. > > > > Matt > > > > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher > Sent: 20 June 2008 13:43 > > To: Discussion of IronPython > Subject: Re: [IronPython] Problem with Beta3 > > > > All four of the DLLs are in your executable directory? > > On Fri, Jun 20, 2008 at 5:40 AM, Clarke, MJ (Matt) > wrote: > > Hi Ben, thanks for the reply. > > I have tried using the dlls that came with the binary download and I > have also tried rebuilding IP from source and using all the dlls from > that - same result. > > Matt > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ben Hall > Sent: 20 June 2008 13:13 > To: Discussion of IronPython > Subject: Re: [IronPython] Problem with Beta3 > > Hello, > > Have you referenced Microsoft.Scripting and Microsoft.Scripting.Core > in your C# project? Are they the correct version (the only IP was > built against). > > They would be the first things to check, if you still have problems > then let us know. > > Ben > Blog.BenHall.me.uk > > On Fri, Jun 20, 2008 at 12:26 PM, Clarke, MJ (Matt) > wrote: >> Hi, >> >> >> >> When I try to run these lines from C# (which I borrowed from > EngineTest.cs) >> >> >> >> _env = ScriptRuntime.Create(); >> >> _pe = _env.GetEngine("py"); >> >> >> >> I get the following exception: >> >> >> >> Microsoft.Scripting.Runtime.MissingTypeException was unhandled >> >> Message="Type 'IronPython, IronPython.Runtime.PythonContext' is > missing or >> cannot be loaded." >> >> Source="Microsoft.Scripting.Core" >> >> >> >> Any ideas? >> >> >> >> Matt >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From christian.muirhead at resolversystems.com Fri Jun 20 16:17:27 2008 From: christian.muirhead at resolversystems.com (Christian Muirhead) Date: Fri, 20 Jun 2008 15:17:27 +0100 Subject: [IronPython] upgrading to ip 2b3 in Resolver One In-Reply-To: <485B9AF4.1060901@resolversystems.com> References: <485B9AF4.1060901@resolversystems.com> Message-ID: <485BBBF7.6080804@resolversystems.com> Christian Muirhead wrote: > * Another thing I saw here was that you can't set __name__ in a scope > when running a script loaded from a source file - that is, this: > > ScriptSource source = engine.CreateScriptSourceFromFile("test.py"); > ScriptScope scope = e.CreateScope(); > scope.SetVariable("__name__", "__main__"); > source.Execute(scope); > > when test.py contains > > print __name__ > > > prints "test" Oh, I forgot to say - I got around this using source.ExecuteProgram, where __name__ is set correctly. -- Christian Muirhead Resolver Systems christian.muirhead at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ Resolver Systems Ltd 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK From dfugate at microsoft.com Fri Jun 20 17:40:04 2008 From: dfugate at microsoft.com (Dave Fugate) Date: Fri, 20 Jun 2008 08:40:04 -0700 Subject: [IronPython] upgrading to ip 2b3 in Resolver One In-Reply-To: <485B9AF4.1060901@resolversystems.com> References: <485B9AF4.1060901@resolversystems.com> Message-ID: Just out of curiosity, what's the perf like when you utilize the "-X:Interpret" flag? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Christian Muirhead Sent: Friday, June 20, 2008 4:57 AM To: Discussion of IronPython Subject: [IronPython] upgrading to ip 2b3 in Resolver One Hi guys - I mentioned the other day that I was doing some work towards us porting Resolver One to IP 2b3. I've got it working (mostly), but hit some bumps along the way that I figured it would be worth mentioning here: * As I noted before, passing in arguments to the hosted engine was a bit obscure (although it sounds like the API for this is a work in progress). * Another thing I saw here was that you can't set __name__ in a scope when running a script loaded from a source file - that is, this: ScriptSource source = engine.CreateScriptSourceFromFile("test.py"); ScriptScope scope = e.CreateScope(); scope.SetVariable("__name__", "__main__"); source.Execute(scope); when test.py contains print __name__ prints "test" * Can't assign to an instance's __doc__ attribute - we use this for our documentation generation in one place. (This works in IP 1.1.1, and CPython.) Shouldn't be hard to work around in the meantime. * We get deprecation warnings when we access protected members of C# classes from IP subclasses - I can understand this for code outside of subclasses (which shouldn't work but does in IP 1.1.1), but it would be nice if it still worked from code in a subclass. (This would be easy to work around for us - the protected members are all on dialogs we define in C#, so we can change them to public if we need to.) D'oh - I was just about to tell you about a weird thing I had seen where calling ScriptScope.SetVariable(name, value) when value is None fails - it dispatches to the (string, ObjectHandle) overload for some reason. Then I realised that the problem was that I was trying to use the C# API from IP, when I could just call setattr with the scope instead. That works fine. (And now I remember the .Overloads property to select between them.) Now that it's working, the performance is about 4x slower than under 1.1.1. I'm in the process of drilling down into that for specific operations that are drastically different - hopefully they'll be nicely isolated. Thanks, Christian -- Christian Muirhead Resolver Systems christian.muirhead at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ Resolver Systems Ltd 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Fri Jun 20 20:41:37 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 20 Jun 2008 11:41:37 -0700 Subject: [IronPython] upgrading to ip 2b3 in Resolver One In-Reply-To: <485B9AF4.1060901@resolversystems.com> References: <485B9AF4.1060901@resolversystems.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C92C4BB7B@DF-GRTDANE-MSG.exchange.corp.microsoft.com> FYI the deprecation warning is definitely overly zealous and that should be fixed for beta 4. The other issues here do look like bugs and I'll go ahead and start opening them on CodePlex. The __name__ one is certainly interesting - __doc__ should be trivial to fix. On perf: I hope that the perf regression here is related to the regression we caught at the end of Beta 3. The short of this is that our perf lab was down for maintenance for a week and our check-ins all got back logged. Therefore we didn't catch the perf regression until the last minute. I think we're back up to date now so hopefully we can avoid that for future releases. Independent of our perf lab I was curious and ran Richards.py over the weekend and - we were about 10x slower on that due to a different perf regression vs Beta 2. That one is related to polymorphic call sites. Anyway, we should be fixing these regressions for the next release. If it's easy you might want to try running on Beta 2 and see what the perf difference is there. Otherwise I look forward to hearing your analysis. If you get stuck or have something you'd like us to take a look at let us know. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Christian Muirhead Sent: Friday, June 20, 2008 4:57 AM To: Discussion of IronPython Subject: [IronPython] upgrading to ip 2b3 in Resolver One Hi guys - I mentioned the other day that I was doing some work towards us porting Resolver One to IP 2b3. I've got it working (mostly), but hit some bumps along the way that I figured it would be worth mentioning here: * As I noted before, passing in arguments to the hosted engine was a bit obscure (although it sounds like the API for this is a work in progress). * Another thing I saw here was that you can't set __name__ in a scope when running a script loaded from a source file - that is, this: ScriptSource source = engine.CreateScriptSourceFromFile("test.py"); ScriptScope scope = e.CreateScope(); scope.SetVariable("__name__", "__main__"); source.Execute(scope); when test.py contains print __name__ prints "test" * Can't assign to an instance's __doc__ attribute - we use this for our documentation generation in one place. (This works in IP 1.1.1, and CPython.) Shouldn't be hard to work around in the meantime. * We get deprecation warnings when we access protected members of C# classes from IP subclasses - I can understand this for code outside of subclasses (which shouldn't work but does in IP 1.1.1), but it would be nice if it still worked from code in a subclass. (This would be easy to work around for us - the protected members are all on dialogs we define in C#, so we can change them to public if we need to.) D'oh - I was just about to tell you about a weird thing I had seen where calling ScriptScope.SetVariable(name, value) when value is None fails - it dispatches to the (string, ObjectHandle) overload for some reason. Then I realised that the problem was that I was trying to use the C# API from IP, when I could just call setattr with the scope instead. That works fine. (And now I remember the .Overloads property to select between them.) Now that it's working, the performance is about 4x slower than under 1.1.1. I'm in the process of drilling down into that for specific operations that are drastically different - hopefully they'll be nicely isolated. Thanks, Christian -- Christian Muirhead Resolver Systems christian.muirhead at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ Resolver Systems Ltd 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Mon Jun 23 17:19:21 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 23 Jun 2008 16:19:21 +0100 Subject: [IronPython] DataRows and IronPython 2.0 B3 Message-ID: <485FBEF9.6030007@voidspace.org.uk> Hello all, I'm further investigating potential compatibility issues with moving Resolver One to IronPython 2, and I've encountered a change in behaviour with respect to iterating over DataRows. The script below works in IronPython 1, printing all the data in the rows. In IronPython 2.0 B3 it raises an exception. IronPython 1: C:\compile>c:\Binaries\ironpython\ipy.exe test_data.py 0 System.Data.DataRow 0 A Big Boy Did It and Ran Away 1 System.Data.DataRow 0 Affective Computing 2 System.Data.DataRow 0 Clear and Present Danger IronPython 2: C:\compile>c:\Binaries\ironpython2\ipy.exe test_data.py 0 Traceback (most recent call last): File "test_data.py", line 29, in test_data.py TypeError: expected IEnumerator, got DataRow Test script: import clr clr.AddReference('System.Data') from System.Data import DataSet from System.Data.Odbc import OdbcConnection, OdbcDataAdapter connectString = ( "DRIVER={MySQL ODBC 3.51 Driver};" "blah blah blah" "OPTION=3;" ) query = "SELECT title FROM books WHERE price > 2 ORDER BY title" connection = OdbcConnection(connectString) adaptor = OdbcDataAdapter(query, connection) dataSet = DataSet() connection.Open() adaptor.Fill(dataSet) connection.Close() for rowIndex, row in enumerate(dataSet.Tables[0].Rows): print rowIndex, row for colIndex, data in enumerate(row): print ' ', colIndex, data Michael Foord http://www.ironpythoninaction.com/ From fuzzyman at voidspace.org.uk Mon Jun 23 17:30:21 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 23 Jun 2008 16:30:21 +0100 Subject: [IronPython] DataRows and IronPython 2.0 B3 In-Reply-To: <485FBEF9.6030007@voidspace.org.uk> References: <485FBEF9.6030007@voidspace.org.uk> Message-ID: <485FC18D.6010408@voidspace.org.uk> Note that we can fix it by iterating over 'row.ItemArray' instead, I just wondered if the breakage was intentional. Michael Foord Michael Foord wrote: > Hello all, > > I'm further investigating potential compatibility issues with moving > Resolver One to IronPython 2, and I've encountered a change in > behaviour with respect to iterating over DataRows. > > The script below works in IronPython 1, printing all the data in the > rows. In IronPython 2.0 B3 it raises an exception. > > IronPython 1: > C:\compile>c:\Binaries\ironpython\ipy.exe test_data.py > 0 System.Data.DataRow > 0 A Big Boy Did It and Ran Away > 1 System.Data.DataRow > 0 Affective Computing > 2 System.Data.DataRow > 0 Clear and Present Danger > > IronPython 2: > C:\compile>c:\Binaries\ironpython2\ipy.exe test_data.py > 0 [System.Data.DataRow]> > Traceback (most recent call last): > File "test_data.py", line 29, in test_data.py > TypeError: expected IEnumerator, got DataRow > > > Test script: > > import clr > clr.AddReference('System.Data') > > from System.Data import DataSet > from System.Data.Odbc import OdbcConnection, OdbcDataAdapter > > > connectString = ( > "DRIVER={MySQL ODBC 3.51 Driver};" > "blah blah blah" > "OPTION=3;" > ) > > query = "SELECT title FROM books WHERE price > 2 ORDER BY title" > > connection = OdbcConnection(connectString) > adaptor = OdbcDataAdapter(query, connection) > dataSet = DataSet() > connection.Open() > adaptor.Fill(dataSet) > connection.Close() > > for rowIndex, row in enumerate(dataSet.Tables[0].Rows): > print rowIndex, row > for colIndex, data in enumerate(row): > print ' ', colIndex, data > > Michael Foord > http://www.ironpythoninaction.com/ > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From curt at hagenlocher.org Mon Jun 23 17:37:28 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 23 Jun 2008 08:37:28 -0700 Subject: [IronPython] DataRows and IronPython 2.0 B3 In-Reply-To: <485FC18D.6010408@voidspace.org.uk> References: <485FBEF9.6030007@voidspace.org.uk> <485FC18D.6010408@voidspace.org.uk> Message-ID: It's very unlikely that this was intentional. I suspect that it's related to a change in the way we handle interfaces -- this wouldn't be the first unanticipated consequence of that change. :/ On Mon, Jun 23, 2008 at 8:30 AM, Michael Foord wrote: > Note that we can fix it by iterating over 'row.ItemArray' instead, I just > wondered if the breakage was intentional. > > Michael Foord > > > Michael Foord wrote: > >> Hello all, >> >> I'm further investigating potential compatibility issues with moving >> Resolver One to IronPython 2, and I've encountered a change in behaviour >> with respect to iterating over DataRows. >> >> The script below works in IronPython 1, printing all the data in the rows. >> In IronPython 2.0 B3 it raises an exception. >> >> IronPython 1: >> C:\compile>c:\Binaries\ironpython\ipy.exe test_data.py >> 0 System.Data.DataRow >> 0 A Big Boy Did It and Ran Away >> 1 System.Data.DataRow >> 0 Affective Computing >> 2 System.Data.DataRow >> 0 Clear and Present Danger >> >> IronPython 2: >> C:\compile>c:\Binaries\ironpython2\ipy.exe test_data.py >> 0 >> Traceback (most recent call last): >> File "test_data.py", line 29, in test_data.py >> TypeError: expected IEnumerator, got DataRow >> >> >> Test script: >> >> import clr >> clr.AddReference('System.Data') >> >> from System.Data import DataSet >> from System.Data.Odbc import OdbcConnection, OdbcDataAdapter >> >> >> connectString = ( >> "DRIVER={MySQL ODBC 3.51 Driver};" >> "blah blah blah" >> "OPTION=3;" >> ) >> >> query = "SELECT title FROM books WHERE price > 2 ORDER BY title" >> >> connection = OdbcConnection(connectString) >> adaptor = OdbcDataAdapter(query, connection) >> dataSet = DataSet() >> connection.Open() >> adaptor.Fill(dataSet) >> connection.Close() >> >> for rowIndex, row in enumerate(dataSet.Tables[0].Rows): >> print rowIndex, row >> for colIndex, data in enumerate(row): >> print ' ', colIndex, data >> >> Michael Foord >> http://www.ironpythoninaction.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 fuzzyman at voidspace.org.uk Mon Jun 23 17:41:40 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 23 Jun 2008 16:41:40 +0100 Subject: [IronPython] DataRows and IronPython 2.0 B3 In-Reply-To: References: <485FBEF9.6030007@voidspace.org.uk> <485FC18D.6010408@voidspace.org.uk> Message-ID: <485FC434.7050405@voidspace.org.uk> Curt Hagenlocher wrote: > It's very unlikely that this was intentional. I suspect that it's > related to a change in the way we handle interfaces -- this wouldn't > be the first unanticipated consequence of that change. :/ > :-) Michael > > On Mon, Jun 23, 2008 at 8:30 AM, Michael Foord > > wrote: > > Note that we can fix it by iterating over 'row.ItemArray' instead, > I just wondered if the breakage was intentional. > > Michael Foord > > > Michael Foord wrote: > > Hello all, > > I'm further investigating potential compatibility issues with > moving Resolver One to IronPython 2, and I've encountered a > change in behaviour with respect to iterating over DataRows. > > The script below works in IronPython 1, printing all the data > in the rows. In IronPython 2.0 B3 it raises an exception. > > IronPython 1: > C:\compile>c:\Binaries\ironpython\ipy.exe test_data.py > 0 System.Data.DataRow > 0 A Big Boy Did It and Ran Away > 1 System.Data.DataRow > 0 Affective Computing > 2 System.Data.DataRow > 0 Clear and Present Danger > > IronPython 2: > C:\compile>c:\Binaries\ironpython2\ipy.exe test_data.py > 0 [System.Data.DataRow]> > Traceback (most recent call last): > File "test_data.py", line 29, in test_data.py > TypeError: expected IEnumerator, got DataRow > > > Test script: > > import clr > clr.AddReference('System.Data') > > from System.Data import DataSet > from System.Data.Odbc import OdbcConnection, OdbcDataAdapter > > > connectString = ( > "DRIVER={MySQL ODBC 3.51 Driver};" > "blah blah blah" > "OPTION=3;" > ) > > query = "SELECT title FROM books WHERE price > 2 ORDER BY title" > > connection = OdbcConnection(connectString) > adaptor = OdbcDataAdapter(query, connection) > dataSet = DataSet() > connection.Open() > adaptor.Fill(dataSet) > connection.Close() > > for rowIndex, row in enumerate(dataSet.Tables[0].Rows): > print rowIndex, row > for colIndex, data in enumerate(row): > print ' ', colIndex, data > > Michael Foord > http://www.ironpythoninaction.com/ > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From dinov at exchange.microsoft.com Mon Jun 23 18:13:32 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 23 Jun 2008 09:13:32 -0700 Subject: [IronPython] DataRows and IronPython 2.0 B3 In-Reply-To: References: <485FBEF9.6030007@voidspace.org.uk> <485FC18D.6010408@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227012C92C4BD11@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Actually it's not related to the interfaces - DataRow implements no interfaces! Instead what it has is a default member which we of course map into __getitem__. And Python says that all things with __getitem__ can be enumerated by going from 0 until you get an exception. In 2.0 we apparently support this conversion on user defined types but not on built-in .NET types. I'm actually doing some work now which will unify the .NET vs User-Defined type code paths so this will go away but I've opened bug #17142 to track this (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=17142). That way afterwards we'll make sure we've got a test in place and it won't regress in the future. Now that being said you probably don't actually want to be doing this for performance reasons :). The way we know this iteration is complete is when an exception is thrown which is going to be bad for perf. Calling row.ItemArray is going to give you a real enumerable object which terminates w/o an exception so you may see better perf that way - of course that seems to make a copy of all the rows, so there's a trade-off to be made here... From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Monday, June 23, 2008 8:37 AM To: Discussion of IronPython Subject: Re: [IronPython] DataRows and IronPython 2.0 B3 It's very unlikely that this was intentional. I suspect that it's related to a change in the way we handle interfaces -- this wouldn't be the first unanticipated consequence of that change. :/ On Mon, Jun 23, 2008 at 8:30 AM, Michael Foord > wrote: Note that we can fix it by iterating over 'row.ItemArray' instead, I just wondered if the breakage was intentional. Michael Foord Michael Foord wrote: Hello all, I'm further investigating potential compatibility issues with moving Resolver One to IronPython 2, and I've encountered a change in behaviour with respect to iterating over DataRows. The script below works in IronPython 1, printing all the data in the rows. In IronPython 2.0 B3 it raises an exception. IronPython 1: C:\compile>c:\Binaries\ironpython\ipy.exe test_data.py 0 System.Data.DataRow 0 A Big Boy Did It and Ran Away 1 System.Data.DataRow 0 Affective Computing 2 System.Data.DataRow 0 Clear and Present Danger IronPython 2: C:\compile>c:\Binaries\ironpython2\ipy.exe test_data.py 0 Traceback (most recent call last): File "test_data.py", line 29, in test_data.py TypeError: expected IEnumerator, got DataRow Test script: import clr clr.AddReference('System.Data') from System.Data import DataSet from System.Data.Odbc import OdbcConnection, OdbcDataAdapter connectString = ( "DRIVER={MySQL ODBC 3.51 Driver};" "blah blah blah" "OPTION=3;" ) query = "SELECT title FROM books WHERE price > 2 ORDER BY title" connection = OdbcConnection(connectString) adaptor = OdbcDataAdapter(query, connection) dataSet = DataSet() connection.Open() adaptor.Fill(dataSet) connection.Close() for rowIndex, row in enumerate(dataSet.Tables[0].Rows): print rowIndex, row for colIndex, data in enumerate(row): print ' ', colIndex, data Michael Foord http://www.ironpythoninaction.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 curt at hagenlocher.org Mon Jun 23 18:29:59 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 23 Jun 2008 09:29:59 -0700 Subject: [IronPython] DataRows and IronPython 2.0 B3 In-Reply-To: <7AD436E4270DD54A94238001769C2227012C92C4BD11@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <485FBEF9.6030007@voidspace.org.uk> <485FC18D.6010408@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C92C4BD11@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Interesting; I would never have imagined that DataRow doesn't implement any interfaces. ItemArray doesn't look very expensive at all -- just a single allocation for the array, then the references are all copied over into it from an underlying ArrayList. On Mon, Jun 23, 2008 at 9:13 AM, Dino Viehland wrote: > Actually it's not related to the interfaces ? DataRow implements no > interfaces! Instead what it has is a default member which we of course map > into __getitem__. And Python says that all things with __getitem__ can be > enumerated by going from 0 until you get an exception. > > > > In 2.0 we apparently support this conversion on user defined types but not > on built-in .NET types. I'm actually doing some work now which will unify > the .NET vs User-Defined type code paths so this will go away but I've > opened bug #17142 to track this ( > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=17142). > That way afterwards we'll make sure we've got a test in place and it won't > regress in the future. > > > > Now that being said you probably don't actually want to be doing this for > performance reasons J. The way we know this iteration is complete is when > an exception is thrown which is going to be bad for perf. Calling > row.ItemArray is going to give you a real enumerable object which terminates > w/o an exception so you may see better perf that way - of course that seems > to make a copy of all the rows, so there's a trade-off to be made here? > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Curt Hagenlocher > *Sent:* Monday, June 23, 2008 8:37 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] DataRows and IronPython 2.0 B3 > > > > It's very unlikely that this was intentional. I suspect that it's related > to a change in the way we handle interfaces -- this wouldn't be the first > unanticipated consequence of that change. :/ > > > > > On Mon, Jun 23, 2008 at 8:30 AM, Michael Foord > wrote: > > Note that we can fix it by iterating over 'row.ItemArray' instead, I just > wondered if the breakage was intentional. > > Michael Foord > > > > Michael Foord wrote: > > Hello all, > > I'm further investigating potential compatibility issues with moving > Resolver One to IronPython 2, and I've encountered a change in behaviour > with respect to iterating over DataRows. > > The script below works in IronPython 1, printing all the data in the rows. > In IronPython 2.0 B3 it raises an exception. > > IronPython 1: > C:\compile>c:\Binaries\ironpython\ipy.exe test_data.py > 0 System.Data.DataRow > 0 A Big Boy Did It and Ran Away > 1 System.Data.DataRow > 0 Affective Computing > 2 System.Data.DataRow > 0 Clear and Present Danger > > IronPython 2: > C:\compile>c:\Binaries\ironpython2\ipy.exe test_data.py > 0 > Traceback (most recent call last): > File "test_data.py", line 29, in test_data.py > TypeError: expected IEnumerator, got DataRow > > > Test script: > > import clr > clr.AddReference('System.Data') > > from System.Data import DataSet > from System.Data.Odbc import OdbcConnection, OdbcDataAdapter > > > connectString = ( > "DRIVER={MySQL ODBC 3.51 Driver};" > "blah blah blah" > "OPTION=3;" > ) > > query = "SELECT title FROM books WHERE price > 2 ORDER BY title" > > connection = OdbcConnection(connectString) > adaptor = OdbcDataAdapter(query, connection) > dataSet = DataSet() > connection.Open() > adaptor.Fill(dataSet) > connection.Close() > > for rowIndex, row in enumerate(dataSet.Tables[0].Rows): > print rowIndex, row > for colIndex, data in enumerate(row): > print ' ', colIndex, data > > Michael Foord > http://www.ironpythoninaction.com/ > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maplab at gery.pl Mon Jun 23 21:50:24 2008 From: maplab at gery.pl (Artur Krosny) Date: Mon, 23 Jun 2008 21:50:24 +0200 Subject: [IronPython] DLR documentation Message-ID: <485FFE80.70404@gery.pl> Hi, Is there any DLR documentation available somewhere ? I am playing with ToyScript to learn it and I like to know if it would be possible to implement scope declarations for functions. Something like : static def test() {..} Artur From dan.eloff at gmail.com Tue Jun 24 01:25:15 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Mon, 23 Jun 2008 18:25:15 -0500 Subject: [IronPython] Is there an equiv for -X:Python25 in Silverlight? Message-ID: <4817b6fc0806231625i95739e9o2bb60a0d91f1a3f5@mail.gmail.com> I haven't actually tried from __future__ import with_statement, but I'm guessing it has the same issue that it will only work if IronPython was started using the -X:Python25 flag. But is there any way to enable that for silverlight? I took a look at the hosting APIs, but I could only see a method for getting compiler options, nothing for setting them. Thanks, -Dan From dinov at exchange.microsoft.com Tue Jun 24 01:34:41 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 23 Jun 2008 16:34:41 -0700 Subject: [IronPython] Is there an equiv for -X:Python25 in Silverlight? In-Reply-To: <4817b6fc0806231625i95739e9o2bb60a0d91f1a3f5@mail.gmail.com> References: <4817b6fc0806231625i95739e9o2bb60a0d91f1a3f5@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C92C4BE55@DF-GRTDANE-MSG.exchange.corp.microsoft.com> For Silverlight there's no need to pass -X:Python25 because IronPython 2.0 is 2.5 compatible by default. What you will need to do is make sure there's a __future__.py that includes with_statement = True (or any other value) that can be imported by your Silverlight app. Unfortunately from __future__ import [whatever] isn't so magical that it skips the import. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Monday, June 23, 2008 4:25 PM To: Discussion of IronPython Subject: [IronPython] Is there an equiv for -X:Python25 in Silverlight? I haven't actually tried from __future__ import with_statement, but I'm guessing it has the same issue that it will only work if IronPython was started using the -X:Python25 flag. But is there any way to enable that for silverlight? I took a look at the hosting APIs, but I could only see a method for getting compiler options, nothing for setting them. Thanks, -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Tue Jun 24 01:40:18 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Mon, 23 Jun 2008 18:40:18 -0500 Subject: [IronPython] Is there an equiv for -X:Python25 in Silverlight? In-Reply-To: <7AD436E4270DD54A94238001769C2227012C92C4BE55@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0806231625i95739e9o2bb60a0d91f1a3f5@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C92C4BE55@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0806231640l15643c85jb7fe2cc238971be5@mail.gmail.com> On Mon, Jun 23, 2008 at 6:34 PM, Dino Viehland wrote: > For Silverlight there's no need to pass -X:Python25 because IronPython 2.0 is 2.5 compatible by default. What you will need to do is make sure there's a __future__.py that includes with_statement = True (or any other value) that can be imported by your Silverlight app. Unfortunately from __future__ import [whatever] isn't so magical that it skips the import. Aha. I checked up on the __future__ module I was using, and for some reason it was from an older python, I copied the python25 one over and it works just great. Thanks. -Dan From dan.eloff at gmail.com Tue Jun 24 04:01:47 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Mon, 23 Jun 2008 21:01:47 -0500 Subject: [IronPython] NameError: locals() is not defined? Message-ID: <4817b6fc0806231901r32174203v60760864192b2ca1@mail.gmail.com> In IronPython b2 I get: >>> s = ''' ... def body(context): ... def ccall(): ... body = lambda: None ... context.update(locals()) ... ccall() ... ... ''' >>> d = {} >>> exec s in d >>> c = {} >>> d['body'](c) Traceback (most recent call last): File "", line 1, in File "", line unknown, in Interpreted_body_1 NameError: name 'locals' is not defined This works fine in CPython: >>> s = ''' ... def body(context): ... def ccall(): ... body = lambda: None ... context.update(locals()) ... ccall() ... ... ''' >>> exec s in d >>> c = {} >>> d['body'](c) >>> c {'body': at 0x0359CCB0>, 'context': {...}} Any idea why? Thanks, -Dan From dinov at exchange.microsoft.com Tue Jun 24 04:15:54 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 23 Jun 2008 19:15:54 -0700 Subject: [IronPython] NameError: locals() is not defined? In-Reply-To: <4817b6fc0806231901r32174203v60760864192b2ca1@mail.gmail.com> References: <4817b6fc0806231901r32174203v60760864192b2ca1@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C92C4BE9C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> It seems to be fixed in beta 3. It's probably a bug in the interpreter as writing the snippet out and executing w/ execfile, which doesn't run under the interpreter, works in beta 2 as well. The reason it got silently fixed was because between the two versions the interpreter was moved from M.S.Core.dll up to M.S.dll and a bunch of bugs were fixed along the way. In beta 3 the interpreter is also now always used for exec or eval - previously it avoided certain constructs it couldn't support. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Monday, June 23, 2008 7:02 PM To: Discussion of IronPython Subject: [IronPython] NameError: locals() is not defined? In IronPython b2 I get: >>> s = ''' ... def body(context): ... def ccall(): ... body = lambda: None ... context.update(locals()) ... ccall() ... ... ''' >>> d = {} >>> exec s in d >>> c = {} >>> d['body'](c) Traceback (most recent call last): File "", line 1, in File "", line unknown, in Interpreted_body_1 NameError: name 'locals' is not defined This works fine in CPython: >>> s = ''' ... def body(context): ... def ccall(): ... body = lambda: None ... context.update(locals()) ... ccall() ... ... ''' >>> exec s in d >>> c = {} >>> d['body'](c) >>> c {'body': at 0x0359CCB0>, 'context': {...}} Any idea why? Thanks, -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Tue Jun 24 04:20:13 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Mon, 23 Jun 2008 21:20:13 -0500 Subject: [IronPython] NameError: locals() is not defined? In-Reply-To: <7AD436E4270DD54A94238001769C2227012C92C4BE9C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0806231901r32174203v60760864192b2ca1@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C92C4BE9C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0806231920j212d0bf0i356b44df968e4061@mail.gmail.com> Thanks, Beta 3 here I come. -Dan On Mon, Jun 23, 2008 at 9:15 PM, Dino Viehland wrote: > It seems to be fixed in beta 3. It's probably a bug in the interpreter as writing the snippet out and executing w/ execfile, which doesn't run under the interpreter, works in beta 2 as well. > > The reason it got silently fixed was because between the two versions the interpreter was moved from M.S.Core.dll up to M.S.dll and a bunch of bugs were fixed along the way. In beta 3 the interpreter is also now always used for exec or eval - previously it avoided certain constructs it couldn't support. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Monday, June 23, 2008 7:02 PM > To: Discussion of IronPython > Subject: [IronPython] NameError: locals() is not defined? > > In IronPython b2 I get: > >>>> s = ''' > ... def body(context): > ... def ccall(): > ... body = lambda: None > ... context.update(locals()) > ... ccall() > ... > ... ''' >>>> d = {} >>>> exec s in d >>>> c = {} >>>> d['body'](c) > Traceback (most recent call last): > File "", line 1, in > File "", line unknown, in Interpreted_body_1 > NameError: name 'locals' is not defined > > This works fine in CPython: > >>>> s = ''' > ... def body(context): > ... def ccall(): > ... body = lambda: None > ... context.update(locals()) > ... ccall() > ... > ... ''' >>>> exec s in d >>>> c = {} >>>> d['body'](c) >>>> c > {'body': at 0x0359CCB0>, 'context': {...}} > > Any idea why? > > Thanks, > -Dan > _______________________________________________ > 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 jonathan at slenders.be Tue Jun 24 09:41:56 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Tue, 24 Jun 2008 09:41:56 +0200 Subject: [IronPython] NameError: locals() is not defined? In-Reply-To: <7AD436E4270DD54A94238001769C2227012C92C4BE9C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0806231901r32174203v60760864192b2ca1@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C92C4BE9C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Does this mean that issue 16884 will be fixed as well in beta 3? 2008/6/24 Dino Viehland : > It seems to be fixed in beta 3. It's probably a bug in the interpreter as > writing the snippet out and executing w/ execfile, which doesn't run under > the interpreter, works in beta 2 as well. > > The reason it got silently fixed was because between the two versions the > interpreter was moved from M.S.Core.dll up to M.S.dll and a bunch of bugs > were fixed along the way. In beta 3 the interpreter is also now always used > for exec or eval - previously it avoided certain constructs it couldn't > support. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Monday, June 23, 2008 7:02 PM > To: Discussion of IronPython > Subject: [IronPython] NameError: locals() is not defined? > > In IronPython b2 I get: > > >>> s = ''' > ... def body(context): > ... def ccall(): > ... body = lambda: None > ... context.update(locals()) > ... ccall() > ... > ... ''' > >>> d = {} > >>> exec s in d > >>> c = {} > >>> d['body'](c) > Traceback (most recent call last): > File "", line 1, in > File "", line unknown, in Interpreted_body_1 > NameError: name 'locals' is not defined > > This works fine in CPython: > > >>> s = ''' > ... def body(context): > ... def ccall(): > ... body = lambda: None > ... context.update(locals()) > ... ccall() > ... > ... ''' > >>> exec s in d > >>> c = {} > >>> d['body'](c) > >>> c > {'body': at 0x0359CCB0>, 'context': {...}} > > Any idea why? > > Thanks, > -Dan > _______________________________________________ > 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 curt at hagenlocher.org Tue Jun 24 13:47:05 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 24 Jun 2008 04:47:05 -0700 Subject: [IronPython] NameError: locals() is not defined? In-Reply-To: References: <4817b6fc0806231901r32174203v60760864192b2ca1@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C92C4BE9C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Despite "locals" being involved, 16884 is not a related issue. The problem in 16884 is with the delegate that's created for function a and the way that it's bound to the context in which the function was declared. And alas, 16884 is not fixed in beta 3. On Tue, Jun 24, 2008 at 12:41 AM, Jonathan Slenders wrote: > Does this mean that issue 16884 will be fixed as well in beta 3? > > 2008/6/24 Dino Viehland : > > It seems to be fixed in beta 3. It's probably a bug in the interpreter as >> writing the snippet out and executing w/ execfile, which doesn't run under >> the interpreter, works in beta 2 as well. >> >> The reason it got silently fixed was because between the two versions the >> interpreter was moved from M.S.Core.dll up to M.S.dll and a bunch of bugs >> were fixed along the way. In beta 3 the interpreter is also now always used >> for exec or eval - previously it avoided certain constructs it couldn't >> support. >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff >> Sent: Monday, June 23, 2008 7:02 PM >> To: Discussion of IronPython >> Subject: [IronPython] NameError: locals() is not defined? >> >> In IronPython b2 I get: >> >> >>> s = ''' >> ... def body(context): >> ... def ccall(): >> ... body = lambda: None >> ... context.update(locals()) >> ... ccall() >> ... >> ... ''' >> >>> d = {} >> >>> exec s in d >> >>> c = {} >> >>> d['body'](c) >> Traceback (most recent call last): >> File "", line 1, in >> File "", line unknown, in Interpreted_body_1 >> NameError: name 'locals' is not defined >> >> This works fine in CPython: >> >> >>> s = ''' >> ... def body(context): >> ... def ccall(): >> ... body = lambda: None >> ... context.update(locals()) >> ... ccall() >> ... >> ... ''' >> >>> exec s in d >> >>> c = {} >> >>> d['body'](c) >> >>> c >> {'body': at 0x0359CCB0>, 'context': {...}} >> >> Any idea why? >> >> Thanks, >> -Dan >> _______________________________________________ >> 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 curt at hagenlocher.org Tue Jun 24 16:30:40 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 24 Jun 2008 07:30:40 -0700 Subject: [IronPython] DLR documentation In-Reply-To: <485FFE80.70404@gery.pl> References: <485FFE80.70404@gery.pl> Message-ID: The DLR is pretty sparsely documented today. Some of the available resources are the hosting spec: http://compilerlab.members.winisp.net/dlr-spec-hosting.pdf And some blogs that talk about implementing languages on the DLR: http://blogs.msdn.com/mmaly/ http://www.dotnetguru.org/us/dlrus/DLR2.htm On Mon, Jun 23, 2008 at 12:50 PM, Artur Krosny wrote: > Hi, > > Is there any DLR documentation available somewhere ? > I am playing with ToyScript to learn it and I like > to know if it would be possible to implement scope > declarations for functions. Something like : > static def test() {..} > > Artur > _______________________________________________ > 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 Shri.Borde at microsoft.com Tue Jun 24 19:23:48 2008 From: Shri.Borde at microsoft.com (Shri Borde) Date: Tue, 24 Jun 2008 10:23:48 -0700 Subject: [IronPython] DLR documentation In-Reply-To: References: <485FFE80.70404@gery.pl> Message-ID: <50B69702CA6E6D4E849D30CD4989AB8EE90F4B6C7C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Take a look at http://blogs.msdn.com/ironpython/archive/2008/03/16/dlr-resources.aspx as well for a list of useful links. Thanks, Shri From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Tuesday, June 24, 2008 7:31 AM To: Discussion of IronPython Subject: Re: [IronPython] DLR documentation The DLR is pretty sparsely documented today. Some of the available resources are the hosting spec: http://compilerlab.members.winisp.net/dlr-spec-hosting.pdf And some blogs that talk about implementing languages on the DLR: http://blogs.msdn.com/mmaly/ http://www.dotnetguru.org/us/dlrus/DLR2.htm On Mon, Jun 23, 2008 at 12:50 PM, Artur Krosny wrote: Hi, Is there any DLR documentation available somewhere ? I am playing with ToyScript to learn it and I like to know if it would be possible to implement scope declarations for functions. Something like : static def test() {..} Artur _______________________________________________ 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 falcon at uwyo.edu Tue Jun 24 23:35:59 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Tue, 24 Jun 2008 15:35:59 -0600 Subject: [IronPython] Problems with Iron Python Studio Message-ID: I have two instances where I can't get intellisense to work. Is it something I am doing or something wrong with Python Studio. I have attached a generated project. Problem 1: I can't access base class methods Problem 2: I can't access things declared in RT.py despite importing it.. The closest that that will work is import RT RT.dbg()// intellisense works! but i shouldnt need to call RT directly Any help would be appreciated. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: project.zip Type: application/zip Size: 6270 bytes Desc: not available URL: From curt at hagenlocher.org Tue Jun 24 23:49:35 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 24 Jun 2008 14:49:35 -0700 Subject: [IronPython] Problems with Iron Python Studio In-Reply-To: References: Message-ID: I don't understand from your description what you expect to see in "Problem 2". On Tue, Jun 24, 2008 at 2:35 PM, Michael Stephens wrote: > I have two instances where I can't get intellisense to work. Is it > something I am doing or something wrong with Python Studio. I have attached > a generated project. > > Problem 1: > I can't access base class methods > Problem 2: > I can't access things declared in RT.py despite importing it.. > The closest that that will work is > import RT > RT.dbg()// intellisense works! but i shouldnt need to call RT directly > > Any help would be appreciated. > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.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 falcon at uwyo.edu Tue Jun 24 23:52:26 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Tue, 24 Jun 2008 15:52:26 -0600 Subject: [IronPython] Problems with Iron Python Studio In-Reply-To: References: Message-ID: I should be able to just say dbg("test") should present intellisense at least for what dbg takes as an argument. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Tue, Jun 24, 2008 at 3:49 PM, Curt Hagenlocher wrote: > I don't understand from your description what you expect to see in "Problem > 2". > > On Tue, Jun 24, 2008 at 2:35 PM, Michael Stephens wrote: > >> I have two instances where I can't get intellisense to work. Is it >> something I am doing or something wrong with Python Studio. I have attached >> a generated project. >> >> Problem 1: >> I can't access base class methods >> Problem 2: >> I can't access things declared in RT.py despite importing it.. >> The closest that that will work is >> import RT >> RT.dbg()// intellisense works! but i shouldnt need to call RT directly >> >> Any help would be appreciated. >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu or 89iroc at gmail.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 fuzzyman at voidspace.org.uk Tue Jun 24 23:56:09 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 24 Jun 2008 22:56:09 +0100 Subject: [IronPython] Problems with Iron Python Studio In-Reply-To: References: Message-ID: <48616D79.40307@voidspace.org.uk> Michael Stephens wrote: > I should be able to just say > dbg("test") should present intellisense at least for what dbg takes > as an argument. > "import" in Python is not the same as the C# using directive. If you do the following: import RT Then you can only access members of the RT module using: RT.attribute and you said that worked? If you want to be able to just type dbg("test") then you would need to do something like: from RT import dbg You can only use names you have specifically imported. I have no idea how good the IronPython Studio intellisense is though. Michael Foord > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > > On Tue, Jun 24, 2008 at 3:49 PM, Curt Hagenlocher > > wrote: > > I don't understand from your description what you expect to see in > "Problem 2". > > On Tue, Jun 24, 2008 at 2:35 PM, Michael Stephens > wrote: > > I have two instances where I can't get intellisense to work. > Is it something I am doing or something wrong with Python > Studio. I have attached a generated project. > > Problem 1: > I can't access base class methods > Problem 2: > I can't access things declared in RT.py despite importing it.. > The closest that that will work is > import RT > RT.dbg()// intellisense works! but i shouldnt need to call > RT directly > > Any help would be appreciated. > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From falcon at uwyo.edu Wed Jun 25 00:11:53 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Tue, 24 Jun 2008 16:11:53 -0600 Subject: [IronPython] Problems with Iron Python Studio In-Reply-To: <48616D79.40307@voidspace.org.uk> References: <48616D79.40307@voidspace.org.uk> Message-ID: It looks like the *only* way intellisense will pickup is if everything is in one file. A moderate workaround except for the lack of class navigator+function navigator Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Tue, Jun 24, 2008 at 3:56 PM, Michael Foord wrote: > Michael Stephens wrote: > >> I should be able to just say >> dbg("test") should present intellisense at least for what dbg takes as an >> argument. >> >> > "import" in Python is not the same as the C# using directive. If you do the > following: > > import RT > > Then you can only access members of the RT module using: > > RT.attribute > > and you said that worked? > > If you want to be able to just type dbg("test") then you would need to do > something like: > > from RT import dbg > > You can only use names you have specifically imported. I have no idea how > good the IronPython Studio intellisense is though. > > Michael Foord > > > Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu or 89iroc at gmail.com > 89iroc at gmail.com> >> >> On Tue, Jun 24, 2008 at 3:49 PM, Curt Hagenlocher > curt at hagenlocher.org>> wrote: >> >> I don't understand from your description what you expect to see in >> "Problem 2". >> >> On Tue, Jun 24, 2008 at 2:35 PM, Michael Stephens > > wrote: >> >> I have two instances where I can't get intellisense to work. >> Is it something I am doing or something wrong with Python >> Studio. I have attached a generated project. >> Problem 1: >> I can't access base class methods >> Problem 2: >> I can't access things declared in RT.py despite importing it.. >> The closest that that will work is >> import RT >> RT.dbg()// intellisense works! but i shouldnt need to call >> RT directly >> Any help would be appreciated. >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu or 89iroc at gmail.com >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > > _______________________________________________ > 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 fuzzyman at voidspace.org.uk Wed Jun 25 00:16:00 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 24 Jun 2008 23:16:00 +0100 Subject: [IronPython] Problems with Iron Python Studio In-Reply-To: References: <48616D79.40307@voidspace.org.uk> Message-ID: <48617220.50905@voidspace.org.uk> Michael Stephens wrote: > It looks like the *only* way intellisense will pickup is if everything > is in one file. A moderate workaround except for the lack of class > navigator+function navigator You are likely to find the intellisense in Python IDEs like Wing and Komodo much better. They don't have Windows Forms or WPF designers though. You can still use Visual Studio / IronPython Studio to do your code generation - although I intensely dislike the code that IronPython Studio generates. Some Resolver One developers have an odd penchant for Vim as an IDE, which has intellisense of sorts... Michael Foord > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > > On Tue, Jun 24, 2008 at 3:56 PM, Michael Foord > > wrote: > > Michael Stephens wrote: > > I should be able to just say > dbg("test") should present intellisense at least for what dbg > takes as an argument. > > > "import" in Python is not the same as the C# using directive. If > you do the following: > > import RT > > Then you can only access members of the RT module using: > > RT.attribute > > and you said that worked? > > If you want to be able to just type dbg("test") then you would > need to do something like: > > from RT import dbg > > You can only use names you have specifically imported. I have no > idea how good the IronPython Studio intellisense is though. > > Michael Foord > > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu > > or > 89iroc at gmail.com > > > > > On Tue, Jun 24, 2008 at 3:49 PM, Curt Hagenlocher > > >> > wrote: > > I don't understand from your description what you expect to > see in > "Problem 2". > > On Tue, Jun 24, 2008 at 2:35 PM, Michael Stephens > > >> wrote: > > I have two instances where I can't get intellisense to > work. Is it something I am doing or something wrong > with Python > Studio. I have attached a generated project. > Problem 1: > I can't access base class methods > Problem 2: > I can't access things declared in RT.py despite > importing it.. > The closest that that will work is > import RT > RT.dbg()// intellisense works! but i shouldnt need > to call > RT directly > Any help would be appreciated. > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu > > or > 89iroc at gmail.com > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From falcon at uwyo.edu Wed Jun 25 00:22:06 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Tue, 24 Jun 2008 16:22:06 -0600 Subject: [IronPython] Problems with Iron Python Studio In-Reply-To: <48617220.50905@voidspace.org.uk> References: <48616D79.40307@voidspace.org.uk> <48617220.50905@voidspace.org.uk> Message-ID: My main reason for using Irony Python is that break points will get hit. Do these other IDE's support break points. We are using the embedded PythonEngine class. I found that if you launched our application from VS it would attach the debugger and actually debug our python code even though its hosted internally. If there is another solution please let me know. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Tue, Jun 24, 2008 at 4:16 PM, Michael Foord wrote: > Michael Stephens wrote: > >> It looks like the *only* way intellisense will pickup is if everything is >> in one file. A moderate workaround except for the lack of class >> navigator+function navigator >> > > You are likely to find the intellisense in Python IDEs like Wing and Komodo > much better. They don't have Windows Forms or WPF designers though. You can > still use Visual Studio / IronPython Studio to do your code generation - > although I intensely dislike the code that IronPython Studio generates. > > Some Resolver One developers have an odd penchant for Vim as an IDE, which > has intellisense of sorts... > > Michael Foord > > >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu or 89iroc at gmail.com > 89iroc at gmail.com> >> >> On Tue, Jun 24, 2008 at 3:56 PM, Michael Foord > fuzzyman at voidspace.org.uk>> wrote: >> >> Michael Stephens wrote: >> >> I should be able to just say >> dbg("test") should present intellisense at least for what dbg >> takes as an argument. >> >> >> "import" in Python is not the same as the C# using directive. If >> you do the following: >> >> import RT >> >> Then you can only access members of the RT module using: >> >> RT.attribute >> >> and you said that worked? >> >> If you want to be able to just type dbg("test") then you would >> need to do something like: >> >> from RT import dbg >> >> You can only use names you have specifically imported. I have no >> idea how good the IronPython Studio intellisense is though. >> >> Michael Foord >> >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu >> > or >> 89iroc at gmail.com >> > >> >> >> On Tue, Jun 24, 2008 at 3:49 PM, Curt Hagenlocher >> >> >> >> wrote: >> >> I don't understand from your description what you expect to >> see in >> "Problem 2". >> >> On Tue, Jun 24, 2008 at 2:35 PM, Michael Stephens >> >> >> wrote: >> >> I have two instances where I can't get intellisense to >> work. Is it something I am doing or something wrong >> with Python >> Studio. I have attached a generated project. >> Problem 1: >> I can't access base class methods >> Problem 2: >> I can't access things declared in RT.py despite >> importing it.. >> The closest that that will work is >> import RT >> RT.dbg()// intellisense works! but i shouldnt need >> to call >> RT directly >> Any help would be appreciated. >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu >> > or >> 89iroc at gmail.com >> > >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> >> > > >> >> >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> >> > > >> >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> >> _______________________________________________ >> 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 >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 Jimmy.Schementi at microsoft.com Wed Jun 25 00:28:01 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 24 Jun 2008 15:28:01 -0700 Subject: [IronPython] Problems with Iron Python Studio In-Reply-To: Message-ID: That's really the only "IronPython debugging" solution, unless there's some other IDE that supports .NET debugging (MonoDevelop?). ~js On 6/24/08 3:22 PM, "Michael Stephens" wrote: My main reason for using Irony Python is that break points will get hit. Do these other IDE's support break points. We are using the embedded PythonEngine class. I found that if you launched our application from VS it would attach the debugger and actually debug our python code even though its hosted internally. If there is another solution please let me know. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Tue, Jun 24, 2008 at 4:16 PM, Michael Foord wrote: Michael Stephens wrote: It looks like the *only* way intellisense will pickup is if everything is in one file. A moderate workaround except for the lack of class navigator+function navigator You are likely to find the intellisense in Python IDEs like Wing and Komodo much better. They don't have Windows Forms or WPF designers though. You can still use Visual Studio / IronPython Studio to do your code generation - although I intensely dislike the code that IronPython Studio generates. Some Resolver One developers have an odd penchant for Vim as an IDE, which has intellisense of sorts... Michael Foord Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Tue, Jun 24, 2008 at 3:56 PM, Michael Foord > wrote: Michael Stephens wrote: I should be able to just say dbg("test") should present intellisense at least for what dbg takes as an argument. "import" in Python is not the same as the C# using directive. If you do the following: import RT Then you can only access members of the RT module using: RT.attribute and you said that worked? If you want to be able to just type dbg("test") then you would need to do something like: from RT import dbg You can only use names you have specifically imported. I have no idea how good the IronPython Studio intellisense is though. Michael Foord Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu > or 89iroc at gmail.com > On Tue, Jun 24, 2008 at 3:49 PM, Curt Hagenlocher >> wrote: I don't understand from your description what you expect to see in "Problem 2". On Tue, Jun 24, 2008 at 2:35 PM, Michael Stephens >> wrote: I have two instances where I can't get intellisense to work. Is it something I am doing or something wrong with Python Studio. I have attached a generated project. Problem 1: I can't access base class methods Problem 2: I can't access things declared in RT.py despite importing it.. The closest that that will work is import RT RT.dbg()// intellisense works! but i shouldnt need to call RT directly Any help would be appreciated. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu > or 89iroc at gmail.com > _______________________________________________ Users mailing list Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ------------------------------------------------------------------------ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ 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 fuzzyman at voidspace.org.uk Wed Jun 25 00:26:26 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 24 Jun 2008 23:26:26 +0100 Subject: [IronPython] Problems with Iron Python Studio In-Reply-To: References: <48616D79.40307@voidspace.org.uk> <48617220.50905@voidspace.org.uk> Message-ID: <48617492.5090406@voidspace.org.uk> Michael Stephens wrote: > My main reason for using Irony Python is that break points will get > hit. Do these other IDE's support break points. > > We are using the embedded PythonEngine class. I found that if you > launched our application from VS it would attach the debugger and > actually debug our python code even though its hosted internally. If > there is another solution please let me know. No - other IDEs aren't as well integrated with the .NET debugger (although there are some fine CPython debuggers around and the Wing one is especially good). Can you develop code with other IDEs and then use IronPython Studio debugger? Michael Foord > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > > On Tue, Jun 24, 2008 at 4:16 PM, Michael Foord > > wrote: > > Michael Stephens wrote: > > It looks like the *only* way intellisense will pickup is if > everything is in one file. A moderate workaround except for > the lack of class navigator+function navigator > > > You are likely to find the intellisense in Python IDEs like Wing > and Komodo much better. They don't have Windows Forms or WPF > designers though. You can still use Visual Studio / IronPython > Studio to do your code generation - although I intensely dislike > the code that IronPython Studio generates. > > Some Resolver One developers have an odd penchant for Vim as an > IDE, which has intellisense of sorts... > > Michael Foord > > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu > > or > 89iroc at gmail.com > > > > On Tue, Jun 24, 2008 at 3:56 PM, Michael Foord > > >> wrote: > > Michael Stephens wrote: > > I should be able to just say > dbg("test") should present intellisense at least for > what dbg > takes as an argument. > > > "import" in Python is not the same as the C# using > directive. If > you do the following: > > import RT > > Then you can only access members of the RT module using: > > RT.attribute > > and you said that worked? > > If you want to be able to just type dbg("test") then you would > need to do something like: > > from RT import dbg > > You can only use names you have specifically imported. I > have no > idea how good the IronPython Studio intellisense is though. > > Michael Foord > > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu > > > > >> or > > 89iroc at gmail.com > > > > >> > > > > On Tue, Jun 24, 2008 at 3:49 PM, Curt Hagenlocher > > > > >>> > > wrote: > > I don't understand from your description what you > expect to > see in > "Problem 2". > > On Tue, Jun 24, 2008 at 2:35 PM, Michael Stephens > > > > > >>> wrote: > > I have two instances where I can't get > intellisense to > work. Is it something I am doing or something wrong > with Python > Studio. I have attached a generated project. > Problem 1: > I can't access base class methods > Problem 2: > I can't access things declared in RT.py despite > importing it.. > The closest that that will work is > import RT > RT.dbg()// intellisense works! but i > shouldnt need > to call > RT directly > Any help would be appreciated. > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu > > > > >> or > > 89iroc at gmail.com > > > >> > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > > > > > >> > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > > > > > >> > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > -- http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > > _______________________________________________ > 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 > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From riltim at gmail.com Wed Jun 25 00:38:41 2008 From: riltim at gmail.com (Tim Riley) Date: Tue, 24 Jun 2008 18:38:41 -0400 Subject: [IronPython] Problems with Iron Python Studio In-Reply-To: <48617220.50905@voidspace.org.uk> References: <48616D79.40307@voidspace.org.uk> <48617220.50905@voidspace.org.uk> Message-ID: What's wrong with good old SharpDevelop? If you grab a recent build from the build server it comes with IronPython 1.1, C#, VB.NET, Boo and F# support out of the box. I have been using this for all my .NET development needs. I'm not 100% certain if you can use the .NET debugger with IronPython, and I can't till I get to work tomorrow and get on a windows box, but I'm fairly certain it does. ~Tim On Tue, Jun 24, 2008 at 6:16 PM, Michael Foord wrote: > Michael Stephens wrote: >> >> It looks like the *only* way intellisense will pickup is if everything is >> in one file. A moderate workaround except for the lack of class >> navigator+function navigator > > You are likely to find the intellisense in Python IDEs like Wing and Komodo > much better. They don't have Windows Forms or WPF designers though. You can > still use Visual Studio / IronPython Studio to do your code generation - > although I intensely dislike the code that IronPython Studio generates. > > Some Resolver One developers have an odd penchant for Vim as an IDE, which > has intellisense of sorts... > > Michael Foord > >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu or 89iroc at gmail.com >> >> >> On Tue, Jun 24, 2008 at 3:56 PM, Michael Foord > > wrote: >> >> Michael Stephens wrote: >> >> I should be able to just say >> dbg("test") should present intellisense at least for what dbg >> takes as an argument. >> >> >> "import" in Python is not the same as the C# using directive. If >> you do the following: >> >> import RT >> >> Then you can only access members of the RT module using: >> >> RT.attribute >> >> and you said that worked? >> >> If you want to be able to just type dbg("test") then you would >> need to do something like: >> >> from RT import dbg >> >> You can only use names you have specifically imported. I have no >> idea how good the IronPython Studio intellisense is though. >> >> Michael Foord >> >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu >> > or >> 89iroc at gmail.com >> > >> >> >> On Tue, Jun 24, 2008 at 3:49 PM, Curt Hagenlocher >> >> >> >> wrote: >> >> I don't understand from your description what you expect to >> see in >> "Problem 2". >> >> On Tue, Jun 24, 2008 at 2:35 PM, Michael Stephens >> >> >> wrote: >> >> I have two instances where I can't get intellisense to >> work. Is it something I am doing or something wrong >> with Python >> Studio. I have attached a generated project. >> Problem 1: >> I can't access base class methods >> Problem 2: >> I can't access things declared in RT.py despite >> importing it.. >> The closest that that will work is >> import RT >> RT.dbg()// intellisense works! but i shouldnt need >> to call >> RT directly >> Any help would be appreciated. >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu >> > or >> 89iroc at gmail.com >> > >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> >> > > >> >> >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> >> > > >> >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> >> _______________________________________________ >> 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 >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From jusylves at videotron.ca Wed Jun 25 01:51:46 2008 From: jusylves at videotron.ca (Julien Sylvestre) Date: Tue, 24 Jun 2008 19:51:46 -0400 Subject: [IronPython] events in PowerPoint Message-ID: <48618892.3040504@videotron.ca> Hello, I'm new at Ironpython, I've been looking at a way to interact dynamically with PowerPoint. I got some simple code to work to access the text in a box which is selected in PowerPoint: import clr from System.Runtime.InteropServices import Marshal clr.AddReference("Microsoft.Office.Interop.PowerPoint") import Microsoft.Office.Interop.PowerPoint as PowerPoint ppt = Marshal.GetActiveObject("PowerPoint.Application") sel = ppt.ActiveWindow.Selection.TextRange print sel.Text This is nice, because if I change the text that was initially selected in PowerPoint, and do "print sel.Text" again, I get the updated text in Python (i.e., I get a reference to the TextRange object, which I can interogate with the Text method when changes are made in PowerPoint). My question is: is there a way to register an event handler to do some action automatically when the text is modified in PowerPoint? Ideally, I'd like my Python script to execute some actions whenever the TextRange object is modified in PowerPoint. If that's not feasible, I could also run those actions when the user does something particular (like changing his selection, or saving his PPT file). I've been trying to introspect my Python objects, but couldn't locate anything that would allow me to setup my event handler. Any comment or suggestion would be greatly appreciated. Thanks, Julien. From dan.eloff at gmail.com Wed Jun 25 01:56:34 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Tue, 24 Jun 2008 18:56:34 -0500 Subject: [IronPython] The slow part of IronPython Message-ID: <4817b6fc0806241656p6150f1bdg6c9509b1e349cee1@mail.gmail.com> In my experience IronPython 2 is fast, I find it to be 3x CPython for some common tasks like serialization. But one area where it still lags way behind is module importing. I've noticed module importing to be an order of magnitude, over 20x, slower in most cases. I've got to think that if it's so expensive to import modules, following the CPython approach of caching generated code in .pyc files makes a lot of sense. I notice with Silverlight that when a project gets large enough, the module importing actually takes more time than network transfer! I'm seriously considering preloading modules in background threads to save time on multi core/processor machines. Are there any plans afoot to address this? -Dan From dinov at exchange.microsoft.com Wed Jun 25 02:28:11 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 24 Jun 2008 17:28:11 -0700 Subject: [IronPython] The slow part of IronPython In-Reply-To: <4817b6fc0806241656p6150f1bdg6c9509b1e349cee1@mail.gmail.com> References: <4817b6fc0806241656p6150f1bdg6c9509b1e349cee1@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C92C4C0CF@DF-GRTDANE-MSG.exchange.corp.microsoft.com> There's a couple of plans a foot. We have been working on a pre-compilation feature like .pyc for IronPython 2.0 It's actually in Beta 3 but unfortunately it doesn't quite work yet which is the reason we haven't said anything. It will be there (and working!) in beta 4. That's the short term solution but unfortunately it won't really work with Silverlight - there's no way to compile against the Silverlight mscorlib from the desktop CLR and Silverlight doesn't support saving assemblies to disk. Another option which generally reduces compilation cost, but still not enough, is to use the -X:LightweightScopes command line option. But again that's not available in Silverlight :(. We may switch to using this mode by default at some point in the future but it needs a little more tuning - right now there's a noticeable difference between throughput perf in the two modes. Longer term we'd like to leverage the interpreter mode. This would result in importing a module initially just bringing up the Python AST for the module and then interpreting that until methods start getting called frequently. The bulk of the import time is going to compilation so doing this would fix a huge amount of the problem. Unfortunately we probably won't get to that for IronPython 2.0 as we're mostly focused on a few final DLR changes and then lots of bug fixing. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Tuesday, June 24, 2008 4:57 PM To: Discussion of IronPython Subject: [IronPython] The slow part of IronPython In my experience IronPython 2 is fast, I find it to be 3x CPython for some common tasks like serialization. But one area where it still lags way behind is module importing. I've noticed module importing to be an order of magnitude, over 20x, slower in most cases. I've got to think that if it's so expensive to import modules, following the CPython approach of caching generated code in .pyc files makes a lot of sense. I notice with Silverlight that when a project gets large enough, the module importing actually takes more time than network transfer! I'm seriously considering preloading modules in background threads to save time on multi core/processor machines. Are there any plans afoot to address this? -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dan.eloff at gmail.com Wed Jun 25 02:57:39 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Tue, 24 Jun 2008 19:57:39 -0500 Subject: [IronPython] The slow part of IronPython In-Reply-To: <7AD436E4270DD54A94238001769C2227012C92C4C0CF@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0806241656p6150f1bdg6c9509b1e349cee1@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C92C4C0CF@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0806241757v577dbdd1iccf1ff1f4f9dda99@mail.gmail.com> > There's a couple of plans a foot. We have been working on a pre-compilation feature like .pyc for IronPython 2.0 It's actually in Beta 3 but unfortunately it doesn't quite work yet which is the reason we haven't said anything. It will be there (and working!) in beta 4. Wow, looking forward to that! >that's the short term solution but unfortunately it won't really work with Silverlight - there's no way to compile against the Silverlight mscorlib from the desktop CLR and Silverlight doesn't support saving assemblies to disk. That seems more like a Silverlight problem than an IronPython one. However, I can in Silverlight save arbitrary data to IsolatedStorage (client side). This would, I think, enable caching the compiled modules and loading them again on a per user basis, if only I have the right api in IronPython to get the compiled module as byte array/string and load from the same. I could then tweak the importing machinery (import hook? it can be done in CPython) slightly to check IsolatedStorage first for the compiled module and load that if possible, falling back to the standard importing mechanism, with the minor difference of saving the compiled module to IsolatedStorage. i.e. build in the .pyc saving/loading in python using IsolatedStorage instead of the file system. Any chance you guys could provide that api? Because it would be a dream to see IronPython totally scream in the browser. -Dan From curt at hagenlocher.org Wed Jun 25 03:21:28 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 24 Jun 2008 18:21:28 -0700 Subject: [IronPython] events in PowerPoint In-Reply-To: <48618892.3040504@videotron.ca> References: <48618892.3040504@videotron.ca> Message-ID: There's a reference for the TextRange object at http://msdn.microsoft.com/en-us/library/bb251500.aspx. It doesn't look like it supports any events. From what I can tell, all the events for PowerPoint are defined on the Application object: http://msdn.microsoft.com/en-us/library/bb251405.aspx. Perhaps the WindowSelectionChange event will do what you want. On Tue, Jun 24, 2008 at 4:51 PM, Julien Sylvestre wrote: > Hello, > I'm new at Ironpython, I've been looking at a way to interact dynamically > with PowerPoint. > > I got some simple code to work to access the text in a box which is > selected in PowerPoint: > > import clr > from System.Runtime.InteropServices import Marshal > clr.AddReference("Microsoft.Office.Interop.PowerPoint") > import Microsoft.Office.Interop.PowerPoint as PowerPoint > ppt = Marshal.GetActiveObject("PowerPoint.Application") > sel = ppt.ActiveWindow.Selection.TextRange > print sel.Text > > This is nice, because if I change the text that was initially selected in > PowerPoint, and do "print sel.Text" again, I get the updated text in Python > (i.e., I get a reference to the TextRange object, which I can interogate > with the Text method when changes are made in PowerPoint). > > My question is: is there a way to register an event handler to do some > action automatically when the text is modified in PowerPoint? Ideally, I'd > like my Python script to execute some actions whenever the TextRange object > is modified in PowerPoint. If that's not feasible, I could also run those > actions when the user does something particular (like changing his > selection, or saving his PPT file). > > I've been trying to introspect my Python objects, but couldn't locate > anything that would allow me to setup my event handler. > > Any comment or suggestion would be greatly appreciated. > > Thanks, > Julien. > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jun 25 03:22:11 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 24 Jun 2008 18:22:11 -0700 Subject: [IronPython] The slow part of IronPython In-Reply-To: <4817b6fc0806241757v577dbdd1iccf1ff1f4f9dda99@mail.gmail.com> References: <4817b6fc0806241656p6150f1bdg6c9509b1e349cee1@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C92C4C0CF@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0806241757v577dbdd1iccf1ff1f4f9dda99@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C92C4C0ED@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Well IsolatedStorage probably isn't good enough. The problem is we actually save a real .NET assembly to disk and do so using reflection - which is the only way this offers any benefits - the slow part is generally compilation. So Reflection.Emit would have to support IsolatedStorage for this to work. If you really wanted to use it out of Silverlight you could probably save it to disk on the desktop CLR, ildasm it, edit it, update the references to the Silverlight assemblies, and then ilasm it (or programmatically w/ something like Cecil I suppose). But we'd never actually support that or advise you do it :) You'll also want to measure the benefit you get w/ your code before you even try - the speed improvement of pre-compilation can be less significant than you'd really like. The best improvements come when you can compile multiple modules into a single file. But compiling one module per file ends up not being much of a gain. It's also not free - it has the same performance cost as the lightweight scopes I mentioned before. And there's still a lot of code gen for user-defined types and call sites. The good news, I suppose, is startup is now our own biggest performance concern - working set's at the top of the list as well. Throughput is largely higher across the board in 2.0 except for in some crazy dynamic scenarios. So it's definitely where our performance work will focus on in the future and we also have a few more ideas to consider as well. Likely it'll be a combination of many things that ultimately speeds this up. Sorry it won't get immediately better - I'm as unhappy about it as you :(. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Tuesday, June 24, 2008 5:58 PM To: Discussion of IronPython Subject: Re: [IronPython] The slow part of IronPython > There's a couple of plans a foot. We have been working on a pre-compilation feature like .pyc for IronPython 2.0 It's actually in Beta 3 but unfortunately it doesn't quite work yet which is the reason we haven't said anything. It will be there (and working!) in beta 4. Wow, looking forward to that! >that's the short term solution but unfortunately it won't really work with Silverlight - there's no way to compile against the Silverlight mscorlib from the desktop CLR and Silverlight doesn't support saving assemblies to disk. That seems more like a Silverlight problem than an IronPython one. However, I can in Silverlight save arbitrary data to IsolatedStorage (client side). This would, I think, enable caching the compiled modules and loading them again on a per user basis, if only I have the right api in IronPython to get the compiled module as byte array/string and load from the same. I could then tweak the importing machinery (import hook? it can be done in CPython) slightly to check IsolatedStorage first for the compiled module and load that if possible, falling back to the standard importing mechanism, with the minor difference of saving the compiled module to IsolatedStorage. i.e. build in the .pyc saving/loading in python using IsolatedStorage instead of the file system. Any chance you guys could provide that api? Because it would be a dream to see IronPython totally scream in the browser. -Dan _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kf9150 at gmail.com Wed Jun 25 09:31:40 2008 From: kf9150 at gmail.com (Kelie) Date: Wed, 25 Jun 2008 00:31:40 -0700 (PDT) Subject: [IronPython] events in PowerPoint In-Reply-To: References: <48618892.3040504@videotron.ca> Message-ID: <6bde1012-f58d-4677-af39-524d67ab7418@i36g2000prf.googlegroups.com> Not sure if this will help. I wrote something like this a while back, probably using IronPython 1.1. And it was for a different software. import clr from System.Runtime.InteropServices import Marshal clr.AddReference("Microsoft.Office.Interop.PowerPoint") import Microsoft.Office.Interop.PowerPoint as PowerPoint ppt = Marshal.GetActiveObject("PowerPoint.Application") def onWindowSelectionChange(selection): print "Window selection changed." ppt.WindowSelectionChange += onWindowSelectionChange From fuzzyman at voidspace.org.uk Wed Jun 25 12:59:36 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 25 Jun 2008 11:59:36 +0100 Subject: [IronPython] The slow part of IronPython In-Reply-To: <7AD436E4270DD54A94238001769C2227012C92C4C0CF@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0806241656p6150f1bdg6c9509b1e349cee1@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C92C4C0CF@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <48622518.2020009@voidspace.org.uk> Dino Viehland wrote: > There's a couple of plans a foot. We have been working on a pre-compilation feature like .pyc for IronPython 2.0 It's actually in Beta 3 but unfortunately it doesn't quite work yet which is the reason we haven't said anything. It will be there (and working!) in beta 4. Import performance is something we would desperately like to see improved for Resolver One. Resolver One takes too long to start, and only a small part of that is the IronPython startup time - the lions share is in importing Python files. IronPython is substantially slower than CPython here. Resolver One is currently based on IronPython 1, and we are already using precompiled modules (one assembly per Python file) - but it does little to improve import performance. Thanks Michael Foord > That's the short term solution but unfortunately it won't really work with Silverlight - there's no way to compile against the Silverlight mscorlib from the desktop CLR and Silverlight doesn't support saving assemblies to disk. > > Another option which generally reduces compilation cost, but still not enough, is to use the -X:LightweightScopes command line option. But again that's not available in Silverlight :(. We may switch to using this mode by default at some point in the future but it needs a little more tuning - right now there's a noticeable difference between throughput perf in the two modes. > > Longer term we'd like to leverage the interpreter mode. This would result in importing a module initially just bringing up the Python AST for the module and then interpreting that until methods start getting called frequently. The bulk of the import time is going to compilation so doing this would fix a huge amount of the problem. Unfortunately we probably won't get to that for IronPython 2.0 as we're mostly focused on a few final DLR changes and then lots of bug fixing. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Tuesday, June 24, 2008 4:57 PM > To: Discussion of IronPython > Subject: [IronPython] The slow part of IronPython > > In my experience IronPython 2 is fast, I find it to be 3x CPython for > some common tasks like serialization. > > But one area where it still lags way behind is module importing. I've > noticed module importing to be an order of magnitude, over 20x, slower > in most cases. > > I've got to think that if it's so expensive to import modules, > following the CPython approach of caching generated code in .pyc files > makes a lot of sense. I notice with Silverlight that when a project > gets large enough, the module importing actually takes more time than > network transfer! I'm seriously considering preloading modules in > background threads to save time on multi core/processor machines. > > Are there any plans afoot to address this? > > -Dan > _______________________________________________ > 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 jusylves at videotron.ca Wed Jun 25 14:38:09 2008 From: jusylves at videotron.ca (jusylves at videotron.ca) Date: Wed, 25 Jun 2008 08:38:09 -0400 Subject: [IronPython] Re : Re: events in PowerPoint In-Reply-To: <6bde1012-f58d-4677-af39-524d67ab7418@i36g2000prf.googlegroups.com> References: <48618892.3040504@videotron.ca> <6bde1012-f58d-4677-af39-524d67ab7418@i36g2000prf.googlegroups.com> Message-ID: An HTML attachment was scrubbed... URL: From Sathish.Kaveripakam at phonak.com Wed Jun 25 17:17:37 2008 From: Sathish.Kaveripakam at phonak.com (Kaveripakam, Sathish) Date: Wed, 25 Jun 2008 17:17:37 +0200 Subject: [IronPython] ironpython and NUNIT Message-ID: Hello All, i am trying to use the NUNIT with Ironpython using VS2005, .NET 2.0 version ( http://blog.bittercoder.com/CommentView,guid,ef0c495d-6804-4d6e-9537-ce2 38b6047c3.aspx#commentstart ), but I am not able to get the things going. Could any one had issues with the usage ? Are there any test frameworks available which will work with iron python ? any pointers/hints are welcome. ******************** Legal Notice: The information in this electronic transmission may contain confidential or legally privileged information and is intended solely for the individual(s) named above. If you are not an intended recipient or an authorized agent, you are hereby notified that reading, distributing, or otherwise disseminating, copying or taking any action based on the contents of this transmission is strictly prohibited. Any unauthorized interception of this transmission is illegal under law. If you have received this transmission in error, please notify the sender by telephone [at the number indicated above/ on +41 58 928 0101] as soon as possible and then destroy all copies of this transmission. ******************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Wed Jun 25 18:00:52 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 25 Jun 2008 09:00:52 -0700 Subject: [IronPython] ironpython and NUNIT In-Reply-To: References: Message-ID: I haven't tried to use Alex's adapter, though it looks rather interesting. The reason why the adapter is necessary is that frameworks like NUnit rely on the ability to attach CLR attributes to your methods, something which we can't do today for IronPython. Have you considered using the native "unittest" library? Granted, it doesn't have "a nice GUI", but it works pretty well. The module itself is part of the standard CPython library, which we're not yet including with IronPython so you'll have to download it yourself from python.org. You can see documentation for it at http://docs.python.org/lib/module-unittest.html. One advantage of unittest.py is that it should work the same for IronPython 1.x and 2.x because it's implemented in pure Python and therefore not dependent on the IronPython hosting APIs. On Wed, Jun 25, 2008 at 8:17 AM, Kaveripakam, Sathish < Sathish.Kaveripakam at phonak.com> wrote: > Hello All, > > i am trying to use the NUNIT with Ironpython using VS2005, .NET 2.0 > version ( > http://blog.bittercoder.com/CommentView,guid,ef0c495d-6804-4d6e-9537-ce238b6047c3.aspx#commentstart ), > but I am not able to get the things going. Could any one had issues with the > usage ? > > Are there any test frameworks available which will work with iron python ? > any pointers/hints are welcome. > > ------------------------------ > *Legal Notice:* > The information in this electronic transmission may contain confidential or > legally privileged information and is intended solely for the individual(s) > named above. If you are not an intended recipient or an authorized agent, > you are hereby notified that reading, distributing, or otherwise > disseminating, copying or taking any action based on the contents of this > transmission is strictly prohibited. Any unauthorized interception of this > transmission is illegal under law. If you have received this transmission in > error, please notify the sender by telephone [at the number indicated > above/on +41 58 928 0101] as soon as possible and then destroy all copies of > this transmission. > ------------------------------ > > > _______________________________________________ > 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 dfugate at microsoft.com Wed Jun 25 18:05:06 2008 From: dfugate at microsoft.com (Dave Fugate) Date: Wed, 25 Jun 2008 09:05:06 -0700 Subject: [IronPython] ironpython and NUNIT In-Reply-To: References: Message-ID: You might want to check out the tests we have in the source distribution of IronPython in IronPython-2.0B3\Src\Tests. Our tests are based on a custom test harness, lib.assert_util, and look similar to py.test tests. The general pattern they follow is: from lib.assert_util import * def test_someTestCaseName(): AreEqual(..., ...) AssertError(OSError, nt.mkdir, bad_dir) #You get the idea #More "test_*" functions... run_test(__name__) Hope that helps! From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kaveripakam, Sathish Sent: Wednesday, June 25, 2008 8:18 AM To: users at lists.ironpython.com Subject: [IronPython] ironpython and NUNIT Hello All, i am trying to use the NUNIT with Ironpython using VS2005, .NET 2.0 version ( http://blog.bittercoder.com/CommentView,guid,ef0c495d-6804-4d6e-9537-ce238b6047c3.aspx#commentstart ), but I am not able to get the things going. Could any one had issues with the usage ? Are there any test frameworks available which will work with iron python ? any pointers/hints are welcome. ________________________________ Legal Notice: The information in this electronic transmission may contain confidential or legally privileged information and is intended solely for the individual(s) named above. If you are not an intended recipient or an authorized agent, you are hereby notified that reading, distributing, or otherwise disseminating, copying or taking any action based on the contents of this transmission is strictly prohibited. Any unauthorized interception of this transmission is illegal under law. If you have received this transmission in error, please notify the sender by telephone [at the number indicated above/on +41 58 928 0101] as soon as possible and then destroy all copies of this transmission. ________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Wed Jun 25 18:11:10 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Wed, 25 Jun 2008 11:11:10 -0500 Subject: [IronPython] The slow part of IronPython In-Reply-To: <7AD436E4270DD54A94238001769C2227012C92C4C0ED@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4817b6fc0806241656p6150f1bdg6c9509b1e349cee1@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C92C4C0CF@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0806241757v577dbdd1iccf1ff1f4f9dda99@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C92C4C0ED@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4817b6fc0806250911v59840da7p34678334e9c22c38@mail.gmail.com> What if I used background threads to import some packages at program start? I imagine there is a race condition here if the background thread is still importing module x and the main thread starts to do the same, but if the worst case is it's parsed/compiled twice, but imported once, it doesn't matter. The work the background thread does is free on a multi-core machine. I may also be able to tweak my code to import some modules at runtime if they aren't used in the initial startup code path. IronPython is slow to startup, but really, as Foord pointed out, it's not noticeable once you start importing. On Tue, Jun 24, 2008 at 8:22 PM, Dino Viehland wrote: > Well IsolatedStorage probably isn't good enough. The problem is we actually save a real .NET assembly to disk and do so using reflection - which is the only way this offers any benefits - the slow part is generally compilation. So Reflection.Emit would have to support IsolatedStorage for this to work. > > If you really wanted to use it out of Silverlight you could probably save it to disk on the desktop CLR, ildasm it, edit it, update the references to the Silverlight assemblies, and then ilasm it (or programmatically w/ something like Cecil I suppose). But we'd never actually support that or advise you do it :) > > You'll also want to measure the benefit you get w/ your code before you even try - the speed improvement of pre-compilation can be less significant than you'd really like. The best improvements come when you can compile multiple modules into a single file. But compiling one module per file ends up not being much of a gain. It's also not free - it has the same performance cost as the lightweight scopes I mentioned before. And there's still a lot of code gen for user-defined types and call sites. > > The good news, I suppose, is startup is now our own biggest performance concern - working set's at the top of the list as well. Throughput is largely higher across the board in 2.0 except for in some crazy dynamic scenarios. So it's definitely where our performance work will focus on in the future and we also have a few more ideas to consider as well. Likely it'll be a combination of many things that ultimately speeds this up. Sorry it won't get immediately better - I'm as unhappy about it as you :(. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Tuesday, June 24, 2008 5:58 PM > To: Discussion of IronPython > Subject: Re: [IronPython] The slow part of IronPython > >> There's a couple of plans a foot. We have been working on a pre-compilation feature like .pyc for IronPython 2.0 It's actually in Beta 3 but unfortunately it doesn't quite work yet which is the reason we haven't said anything. It will be there (and working!) in beta 4. > > Wow, looking forward to that! > >>that's the short term solution but unfortunately it won't really work with Silverlight - there's no way to compile against the Silverlight mscorlib from the desktop CLR and Silverlight doesn't support saving assemblies to disk. > > That seems more like a Silverlight problem than an IronPython one. > However, I can in Silverlight save arbitrary data to IsolatedStorage > (client side). This would, I think, enable caching the compiled > modules and loading them again on a per user basis, if only I have the > right api in IronPython to get the compiled module as byte > array/string and load from the same. I could then tweak the importing > machinery (import hook? it can be done in CPython) slightly to check > IsolatedStorage first for the compiled module and load that if > possible, falling back to the standard importing mechanism, with the > minor difference of saving the compiled module to IsolatedStorage. > i.e. build in the .pyc saving/loading in python using IsolatedStorage > instead of the file system. > > Any chance you guys could provide that api? Because it would be a > dream to see IronPython totally scream in the browser. > > -Dan > _______________________________________________ > 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 gigs at hi.t-com.hr Wed Jun 25 21:18:19 2008 From: gigs at hi.t-com.hr (Gigs_) Date: Wed, 25 Jun 2008 21:18:19 +0200 Subject: [IronPython] ironpython xna problem In-Reply-To: <7AD436E4270DD54A94238001769C2227012BC9F4FD9F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4856DECC.5000908@hi.t-com.hr> <4857BEBF.8020403@iinet.net.au> <4857DD82.4030301@hi.t-com.hr> <4857E0D7.2070301@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012BC9F4FD9F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <486299FB.8090903@hi.t-com.hr> Dino Viehland wrote: > Is this on a 64-bit machine? IronPython is a neutral EXE so it'll run at 64-bit on a 64-bit machine and 32-bit on a 32-bit machine. It looks like XNA is a 32-bit only assembly: http://www.start64.com/index.php?option=com_content&task=view&id=1932&Itemid=114 > > If this is the problem then the answer is that unfortunately we don't ship a 32-bit ipy.exe. You could write a simple 32-bit wrapper that does a AppDomain.ExecuteAssembly on ipy.exe though. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Tuesday, June 17, 2008 9:06 AM > To: Discussion of IronPython > Subject: Re: [IronPython] ironpython xna problem > > Hello Gigs_, > > That error definitely means that IronPython isn't finding the assemblies. > > What happens if you copy the XNA assemblies into the same directory as > the IronPython interpreter and execute the following into the > interactive interpreter: > > > import clr > > clr.AddReference('Microsoft.Xna.Framework') > clr.AddReference('Microsoft.Xna.Framework.Game') > > from Microsoft.Xna.Framework import * > from Microsoft.Xna.Framework.Graphics import * > from Microsoft.Xna.Framework.Content import * > > Gigs_ wrote: > >> Paul Turbett wrote: >> >>> Are the XNA assemblies in the same directory as your script? I don't >>> think they are in the GAC, so unless they in the same place as the >>> ipy script, or a directory in your path, they won't be loaded. >>> >>> L8r, Paul >>> >>> Gigs_ wrote: >>> >>>> Hi all! >>>> >>>> >>>> i want to run some ironpython xna script, but all the tim im getting >>>> error. I tried this in c# and it is working, i have installed >>>> directx runtime, xna studio 2.0 and xna framework. later i tried >>>> with xna 3.0 and same thing >>>> this is error: >>>> >>>> Could not load file or assembly 'Microsoft.Xna.Framework, >>>> Version=2.0.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d' >>>> or one of its dependencies. The system cannot find the file specified. >>>> >>>> import clr >>>> >>>> clr.AddReference('Microsoft.Xna.Framework') >>>> clr.AddReference('Microsoft.Xna.Framework.Game') >>>> >>>> from Microsoft.Xna.Framework import * >>>> from Microsoft.Xna.Framework.Graphics import * >>>> from Microsoft.Xna.Framework.Content import * >>>> >>>> class MyGame(Game): >>>> def __init__(self): >>>> self.spriteX = self.spriteY = 0 >>>> self.spriteSpeedX = self.spriteSpeedY = 1 >>>> self.initializeComponent() def initializeComponent(self): >>>> self.graphics = GraphicsDeviceManager(self) >>>> self.content = ContentManager(self.Services) >>>> ... >>>> >>>> >>>> Can someon help me with this_ thanks! >>>> _______________________________________________ >>>> 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 >>> >>> __________ Information from ESET NOD32 Antivirus, version of virus >>> signature database 3194 (20080617) __________ >>> >>> The message was checked by ESET NOD32 Antivirus. >>> >>> http://www.eset.com >>> >>> >>> >>> >> thez are in the gac, and when i copy them to working dir nothing >> change. i will blow, i really need ironpython for xna for testing >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > > > -- > http://www.ironpythoninaction.com/ > http://www.theotherdelia.co.uk/ > http://www.voidspace.org.uk/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > > __________ Information from ESET NOD32 Antivirus, version of virus signature database 3194 (20080617) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.eset.com > > > > i think that this will work. I will download ironpython 1.1 source and build it for x86 platform. From gigs at hi.t-com.hr Wed Jun 25 21:21:07 2008 From: gigs at hi.t-com.hr (Gigs_) Date: Wed, 25 Jun 2008 21:21:07 +0200 Subject: [IronPython] ironpython xna problem In-Reply-To: <486299FB.8090903@hi.t-com.hr> References: <4856DECC.5000908@hi.t-com.hr> <4857BEBF.8020403@iinet.net.au> <4857DD82.4030301@hi.t-com.hr> <4857E0D7.2070301@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012BC9F4FD9F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <486299FB.8090903@hi.t-com.hr> Message-ID: <48629AA3.6030208@hi.t-com.hr> Gigs_ wrote: > Dino Viehland wrote: >> Is this on a 64-bit machine? IronPython is a neutral EXE so it'll >> run at 64-bit on a 64-bit machine and 32-bit on a 32-bit machine. It >> looks like XNA is a 32-bit only assembly: >> http://www.start64.com/index.php?option=com_content&task=view&id=1932&Itemid=114 >> >> >> If this is the problem then the answer is that unfortunately we don't >> ship a 32-bit ipy.exe. You could write a simple 32-bit wrapper that >> does a AppDomain.ExecuteAssembly on ipy.exe though. >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com >> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Tuesday, June 17, 2008 9:06 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] ironpython xna problem >> >> Hello Gigs_, >> >> That error definitely means that IronPython isn't finding the >> assemblies. >> >> What happens if you copy the XNA assemblies into the same directory as >> the IronPython interpreter and execute the following into the >> interactive interpreter: >> >> >> import clr >> >> clr.AddReference('Microsoft.Xna.Framework') >> clr.AddReference('Microsoft.Xna.Framework.Game') >> >> from Microsoft.Xna.Framework import * >> from Microsoft.Xna.Framework.Graphics import * >> from Microsoft.Xna.Framework.Content import * >> >> Gigs_ wrote: >> >>> Paul Turbett wrote: >>> >>>> Are the XNA assemblies in the same directory as your script? I don't >>>> think they are in the GAC, so unless they in the same place as the >>>> ipy script, or a directory in your path, they won't be loaded. >>>> >>>> L8r, Paul >>>> >>>> Gigs_ wrote: >>>> >>>>> Hi all! >>>>> >>>>> >>>>> i want to run some ironpython xna script, but all the tim im getting >>>>> error. I tried this in c# and it is working, i have installed >>>>> directx runtime, xna studio 2.0 and xna framework. later i tried >>>>> with xna 3.0 and same thing >>>>> this is error: >>>>> >>>>> Could not load file or assembly 'Microsoft.Xna.Framework, >>>>> Version=2.0.0.0, Culture=neutral, PublicKeyToken=6d5c3888ef60e27d' >>>>> or one of its dependencies. The system cannot find the file >>>>> specified. >>>>> >>>>> import clr >>>>> >>>>> clr.AddReference('Microsoft.Xna.Framework') >>>>> clr.AddReference('Microsoft.Xna.Framework.Game') >>>>> >>>>> from Microsoft.Xna.Framework import * >>>>> from Microsoft.Xna.Framework.Graphics import * >>>>> from Microsoft.Xna.Framework.Content import * >>>>> >>>>> class MyGame(Game): >>>>> def __init__(self): >>>>> self.spriteX = self.spriteY = 0 >>>>> self.spriteSpeedX = self.spriteSpeedY = 1 >>>>> self.initializeComponent() def initializeComponent(self): >>>>> self.graphics = GraphicsDeviceManager(self) >>>>> self.content = ContentManager(self.Services) >>>>> ... >>>>> >>>>> >>>>> Can someon help me with this_ thanks! >>>>> _______________________________________________ >>>>> 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 >>>> >>>> __________ Information from ESET NOD32 Antivirus, version of virus >>>> signature database 3194 (20080617) __________ >>>> >>>> The message was checked by ESET NOD32 Antivirus. >>>> >>>> http://www.eset.com >>>> >>>> >>>> >>>> >>> thez are in the gac, and when i copy them to working dir nothing >>> change. i will blow, i really need ironpython for xna for testing >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >> >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.theotherdelia.co.uk/ >> http://www.voidspace.org.uk/ >> http://www.ironpython.info/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> __________ Information from ESET NOD32 Antivirus, version of virus >> signature database 3194 (20080617) __________ >> >> The message was checked by ESET NOD32 Antivirus. >> >> http://www.eset.com >> >> >> >> > i think that this will work. I will download ironpython 1.1 source and > build it for x86 platform. > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > __________ Information from ESET NOD32 Antivirus, version of virus > signature database 3218 (20080625) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.eset.com > > > yes it is working (nice). thanks dino From jusylves at videotron.ca Thu Jun 26 02:09:20 2008 From: jusylves at videotron.ca (Julien Sylvestre) Date: Wed, 25 Jun 2008 20:09:20 -0400 Subject: [IronPython] events in PowerPoint In-Reply-To: <6bde1012-f58d-4677-af39-524d67ab7418@i36g2000prf.googlegroups.com> References: <48618892.3040504@videotron.ca> <6bde1012-f58d-4677-af39-524d67ab7418@i36g2000prf.googlegroups.com> Message-ID: <4862DE30.4030904@videotron.ca> I've sent the following this morning, but the message appeared all scambled in the mailing list's archive (was testing a new mail client), and I'm afraid it didn't make it in an intelligible manner to people on the list. My most sincere apologies for cluttering your mailboxes. --------------------------------------------------------------------------------------------- Thanks for the quick reply. The line ppt.WindowSelectionChange += onWindowSelectionChange doesn't work for me. It looks like my ppt object (type __ComObject) doesn't have the WindowSelectionChange attribute (see below for a dir on my ppt object). I've looked at other objects in ppt (ActiveWindow, ActiveWindow.Application, etc.), and I can't find WindowSelectionChange (or any other event) anywhere by running recursive dir() on my ppt object and its attributes. I'm puzzled. My ppt object probably isn't the Application object to which event handlers are attached (I'm ashamed to say that I'm not sure what class my ppt object is instantiated from, or what's the type of its attributes). Or maybe I need to do something particular to enable events? Any help would be greatly appreciated. Many thanks, Julien. dir(ppt), where ppt = Marshal.GetActiveObject("PowerPoint.Application") ['Activate', 'Active', 'ActivePresentation', 'ActivePrinter', 'ActiveWindow', 'A ddIns', 'AnswerWizard', 'Assistant', 'AutoCorrect', 'AutomationSecurity', 'Build ', 'COMAddIns', 'Caption', 'CommandBars', 'CreateObjRef', 'Creator', 'DefaultWeb Options', 'Dialogs', 'DisplayAlerts', 'DisplayGridLines', 'Equals', 'FeatureInst all', 'FileFind', 'FileSearch', 'Finalize', 'GetHashCode', 'GetLifetimeService', 'GetOptionFlag', 'GetType', 'HWND', 'Height', 'Help', 'InitializeLifetimeServic e', 'LanguageSettings', 'LaunchSpelling', 'Left', 'Marker', 'MemberwiseClone', ' MsoDebugOptions', 'Name', 'NewPresentation', 'OperatingSystem', 'Options', 'PPFi leDialog', 'Path', 'Presentations', 'ProductCode', 'Quit', 'Run', 'SetOptionFlag ', 'SetPerfMarker', 'ShowStartupDialog', 'ShowWindowsInTaskbar', 'SlideShowWindo ws', 'ToString', 'Top', 'VBE', 'Version', 'Visible', 'Width', 'WindowState', 'Wi ndows', '__class__', '__doc__', '__init__', '__module__', '__new__', '__reduce__ ', '__reduce_ex__', '__repr__'] Kelie wrote: > Not sure if this will help. I wrote something like this a while back, > probably using IronPython 1.1. And it was for a different software. > > import clr > from System.Runtime.InteropServices import Marshal > clr.AddReference("Microsoft.Office.Interop.PowerPoint") > import Microsoft.Office.Interop.PowerPoint as PowerPoint > ppt = Marshal.GetActiveObject("PowerPoint.Application") > > def onWindowSelectionChange(selection): > print "Window selection changed." > > ppt.WindowSelectionChange += onWindowSelectionChange > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From Jimmy.Schementi at microsoft.com Thu Jun 26 02:55:59 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 25 Jun 2008 17:55:59 -0700 Subject: [IronPython] StaticResources + DLR + Silverlight In-Reply-To: <4817b6fc0805050643g61cf500fy91c17510b5661c6a@mail.gmail.com> References: <4817b6fc0805050643g61cf500fy91c17510b5661c6a@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE215@NA-EXMSG-C116.redmond.corp.microsoft.com> [Catching up w/old mail, sorry! =(] Dan, Using a dynamic language in Silverlight is no different than in C#/VB wrt StaticResources; you can have a app.xaml file which looks like this: And load it in app.py like this: Application.LoadComponent(Application.current, Uri("app.xaml", UriKind.Relative)) I omit this "StaticResource XAML file" from our templates since I figured they'd only add confusion, but do you think this should be in there regardless? ~Jimmy > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Monday, May 05, 2008 6:44 AM > To: Discussion of IronPython > Subject: [IronPython] StaticResources + DLR + Silverlight > > I notice if you use C#/VB, you have in your main xaml > file. In there you can place resources that can be used from anywhere > in your other xaml files. Using the {StaticResource foo} markup > extension. > > If you are using a dynamic language, there is no > equivalent (please correct me if I'm wrong), most examples I've seen > use . > > The trouble is placing your resources in makes > them off limit to {StaticResource foo} in any other xaml files (again > please correct me if I'm wrong) > > So I find myself in a nightmare of duplicating resources across files > and setting styles in code from > Application.Current.RootVisual.Resources['foo'], neither of which is > pleasant. Are there really no better alternatives? > > -Dan > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Thu Jun 26 02:58:26 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 25 Jun 2008 17:58:26 -0700 Subject: [IronPython] StaticResources + DLR + Silverlight In-Reply-To: <4817b6fc0805110738y3b1c7c70mdf373d7c95a7d7b1@mail.gmail.com> References: <4817b6fc0805050643g61cf500fy91c17510b5661c6a@mail.gmail.com> <5283CA0A4168DF4FBBD71AE9ECA5A3284580380A77@NA-EXMSG-C116.redmond.corp.microsoft.com> <4817b6fc0805110738y3b1c7c70mdf373d7c95a7d7b1@mail.gmail.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE219@NA-EXMSG-C116.redmond.corp.microsoft.com> I'd hope using Application.LoadComponent would work better =) > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Sunday, May 11, 2008 7:38 AM > To: Discussion of IronPython > Subject: Re: [IronPython] StaticResources + DLR + Silverlight > > Ok, I think I have discovered an answer to this one. I haven't tested > it because I no longer use xaml files for anything but resources, but > it *should* work. Make a xaml file for just application level > resources, it should simply consist of a . Use > XamlReader.Load() to read it, now you have a dictionary of your global > styles and things. Programmatically merge that dictionary into the > Application.Current.Resources dictionary. If that works, you should be > able to use {StaticResource } to refer to your resources from > anywhere. > > But bottom line is XAML cannot use Python objects and controls, so for > anything but the very simple, it soon becomes a liability. I've made a > module that simplifies the process of creating controls in Python > (which I hope to place in the IronPython cookbook soon.) > > Here's an example: > > x.Canvas(Width=400, Height=400)( > x.Rectangle(Width=200, Height=200, Canvas_Top=100, Canvas_Left=100, > > Fill=x.VerticalGradient([(x.Colors.DarkTurquoise, 0), > (x.Color('#4169e1'), 1)]) > ) > > It's about half the size of the equivalent xaml, but no static error > checking, and very little in the way of auto completion and > intellisense, so I consider it about a wash. The advantage is that you > can now use Python controls and objects, and you can use anything > python has to offer, like loops, closures, or conditionals, when > constructing your interface. > > -Dan > > On Tue, May 6, 2008 at 2:04 AM, Jimmy Schementi > wrote: > > Dan, > > > > It's a very good question, and I'm a little embarrassed not to have a > solution for you. Give me some time to poke around and find the best > way to do this. > > > > ~js > > > >> -----Original Message----- > >> From: users-bounces at lists.ironpython.com [mailto:users- > >> bounces at lists.ironpython.com] On Behalf Of Dan Eloff > >> Sent: Monday, May 05, 2008 6:44 AM > >> To: Discussion of IronPython > >> Subject: [IronPython] StaticResources + DLR + Silverlight > >> > >> I notice if you use C#/VB, you have in your main xaml > >> file. In there you can place resources that can be used from > anywhere > >> in your other xaml files. Using the {StaticResource foo} markup > >> extension. > >> > >> If you are using a dynamic language, there is no > > >> equivalent (please correct me if I'm wrong), most examples I've seen > >> use . > >> > >> The trouble is placing your resources in > makes > >> them off limit to {StaticResource foo} in any other xaml files > (again > >> please correct me if I'm wrong) > >> > >> So I find myself in a nightmare of duplicating resources across > files > >> and setting styles in code from > >> Application.Current.RootVisual.Resources['foo'], neither of which is > >> pleasant. Are there really no better alternatives? > >> > >> -Dan > >> _______________________________________________ > >> Users mailing list > >> Users at lists.ironpython.com > >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Thu Jun 26 06:08:41 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 25 Jun 2008 21:08:41 -0700 Subject: [IronPython] Silverlight and Catching HttpWebRequest Errors In-Reply-To: <482B606D.60205@voidspace.org.uk> References: <4827F8A4.7020504@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A328457FE34E1D@NA-EXMSG-C116.redmond.corp.microsoft.com> <530a79a6-0bce-471b-843e-10db132795c9@k13g2000hse.googlegroups.com> <482B5FA3.6070506@voidspace.org.uk> <482B606D.60205@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE2A4@NA-EXMSG-C116.redmond.corp.microsoft.com> So, did some homework on this. Taking a look at BrowserHttpWebRequest with Reflector, it definitely has a public ProgressFailed event, but it says it's read-only. Dino/Curt, could this behavior happen because BrowserHttpWebRequest has a methods and events by exactly the same name? private EventHandler ProgressChanged; private EventHandler ProgressCompleted; private EventHandler ProgressFailed; // Events public event EventHandler ProgressChanged; public event EventHandler ProgressCompleted; public event EventHandler ProgressFailed; Michael, regardless, for simple downloading I'd use WebClient; the code is much more concise: from System.Net import WebClient from System import Uri def Downloaded(sender, args): print args.Result uri = Uri('http://localhost:2060/index.html') req = WebClient() req.DownloadStringCompleted += Downloaded req.DownloadStringAsync(uri) Do you still have time to change your book's example? =P ~Jimmy > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Wednesday, May 14, 2008 2:58 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Silverlight and Catching HttpWebRequest > Errors > > Michael Foord wrote: > > Michael Foord wrote: > >> On May 12, 9:17 am, Jimmy Schementi > >> wrote: > >> > >>> The actual type returned by HttpWebRequest.Create() is a > >>> BrowserHttpWebRequest, but it's internal (not sure why). Anyway, it > >>> has a ProgressFailed event you can hook. > >>> > >> > >> Hello Jimmy, > >> > >> As far as I can tell it *doesn't* have the 'ProgressFailed' event. > >> > > > > The actual failure I see is: > > > > Exception: [Arg_COMException] > > Arguments: > > Debugging resource strings are unavailable. Often the key and > > arguments provide sufficient information to diagnose the problem. See > > > http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.1&File= > mscorlib.dll&Key=Arg_COMException > > > > > > > > Sorry for the noise. This one is actually for the sake of google (and > all who sail in her). > > Exception > at MS.Internal.XcpImports.GetDownloaderBytes(IntPtr element, IntPtr& > outBytes, Int32& outSize) > at MS.Internal.InternalWebRequest.GetResponseStream() > at System.Net.BrowserHttpWebRequest.Completed(Object sender, > EventArgs e) > at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 > typeIndex, Delegate handlerDelegate, Object sender, Object args) > at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr > unmanagedObjArgs, Int32 argsTypeIndex, String eventName) > > Michael > > > This is using Safari. As I'm developing on the Mac I can't use > > debugging, nor can I test in Firefox because of the bug in Chiron. > > > > It looks like some people have similar errors: > > > > http://silverlight.net/forums/p/12500/40967.aspx#40967 > > > > and a guy in the comments here: > > > > > > http://www.cameronalbert.com/post/2008/03/HttpWebRequest-Helper-for- > Silverlight-2.aspx > > > > > > All the best, > > > > Michael Foord > > http://www.ironpythoninaction.com/ > > > >> I need to make cross-domain POST, and although the request gets made > >> successfully I'm getting a COM Arg Exception everytime (I think > >> because the server is slow to respond). This is screwing me at the > >> moment. > >> > >> FYI - when I execute the following code in Silverlight: > >> > >> from System.Net import WebRequest > >> from System import Uri > >> > >> u = Uri('http://www.v.com') > >> req = WebRequest.Create(u) > >> print req.ProgressFailed > >> > >> I get the following exception: > >> > >> Traceback (most recent call last): > >> File "None", line 6, in > >> AttributeError: 'BrowserHttpWebRequest' object has no attribute > >> 'ProgressFailed' > >> > >> All the best, > >> > >> Michael Foord > >> http://www.ironpythoninaction.com/ > >> > >> > >>> PS. If you REALLY want synchronous downloading, just hack on > >>> XMLHttpRequest > >>> > >>> def download(url): > >>> request = HtmlPage.Window.CreateInstance("XMLHttpRequest") > >>> request.Invoke("open", "GET", url, false) # false means > synchronous > >>> request.Invoke("send", "") > >>> return request.GetProperty("responseText") > >>> > >>> :) > >>> > >>> ~js > >>> ________________________________________ > >>> From: users-boun... at lists.ironpython.com > >>> [users-boun... at lists.ironpython.com] On Behalf Of Michael Foord > >>> [fuzzy... at voidspace.org.uk] > >>> Sent: Monday, May 12, 2008 12:58 AM > >>> To: Discussion of IronPython > >>> Subject: [IronPython] Silverlight and Catching HttpWebRequest > Errors > >>> > >>> Hello guys, > >>> > >>> I have a problem with catching network errors raised by > HttpWebRequest > >>> in Silverlight. (Not necessarily an IronPython specific question - > but > >>> you guys are so intelligent you are always the first place I > turn...) > >>> > >>> HttpWebRequest uses an async model for fetching resources. If there > >>> is a > >>> problem (triggered usually by a slow response from the server), > then it > >>> can happen *after* I have made the request - but before my callback > is > >>> invoked. This gives me nowhere to catch the exception, as > >>> effectively it > >>> happens 'inside Silverlight'. I wondered if there was a solution... > ? > >>> > >>> def callback(asyncResult): > >>> ... > >>> > >>> uri = Uri(some_url) > >>> req = HttpWebRequest.Create(uri) > >>> > >>> req.BeginGetResponse(AsyncCallback(callback), object()) > >>> > >>> The error occurs after BeginGetResponse, but before calback. Any > ideas > >>> for catching it? > >>> > >>> Michael Foordhttp://www.ironpythoninaction.com/ > >>> > >>> _______________________________________________ > >>> Users mailing list > >>> > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/user > s-ironpython.com > >>> > >>> _______________________________________________ > >>> Users mailing list > >>> > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/user > s-ironpython.com > >>> > >>> > >> _______________________________________________ > >> Users mailing list > >> Users at lists.ironpython.com > >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >> > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Thu Jun 26 06:22:35 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 25 Jun 2008 21:22:35 -0700 Subject: [IronPython] Silverlight and Catching HttpWebRequest Errors In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE2A4@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4827F8A4.7020504@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A328457FE34E1D@NA-EXMSG-C116.redmond.corp.microsoft.com> <530a79a6-0bce-471b-843e-10db132795c9@k13g2000hse.googlegroups.com> <482B5FA3.6070506@voidspace.org.uk> <482B606D.60205@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE2A4@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C92C4C355@DF-GRTDANE-MSG.exchange.corp.microsoft.com> While it might look like those events are public they aren't really. BrowserHttpWebRequest is an internal type so its members are not directly exposed - even if those members are public. If it were overriding some methods on a base class or interface that were public we could then access them. It does implement an interface which has those members, INetworkProgress, but that interface is also internal! So even though there are public methods there is no publicly accessible way for us to get to those events :(. If the interface was public we'd be able to access them. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi Sent: Wednesday, June 25, 2008 9:09 PM To: Discussion of IronPython Subject: Re: [IronPython] Silverlight and Catching HttpWebRequest Errors So, did some homework on this. Taking a look at BrowserHttpWebRequest with Reflector, it definitely has a public ProgressFailed event, but it says it's read-only. Dino/Curt, could this behavior happen because BrowserHttpWebRequest has a methods and events by exactly the same name? private EventHandler ProgressChanged; private EventHandler ProgressCompleted; private EventHandler ProgressFailed; // Events public event EventHandler ProgressChanged; public event EventHandler ProgressCompleted; public event EventHandler ProgressFailed; Michael, regardless, for simple downloading I'd use WebClient; the code is much more concise: from System.Net import WebClient from System import Uri def Downloaded(sender, args): print args.Result uri = Uri('http://localhost:2060/index.html') req = WebClient() req.DownloadStringCompleted += Downloaded req.DownloadStringAsync(uri) Do you still have time to change your book's example? =P ~Jimmy > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Wednesday, May 14, 2008 2:58 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Silverlight and Catching HttpWebRequest > Errors > > Michael Foord wrote: > > Michael Foord wrote: > >> On May 12, 9:17 am, Jimmy Schementi > >> wrote: > >> > >>> The actual type returned by HttpWebRequest.Create() is a > >>> BrowserHttpWebRequest, but it's internal (not sure why). Anyway, it > >>> has a ProgressFailed event you can hook. > >>> > >> > >> Hello Jimmy, > >> > >> As far as I can tell it *doesn't* have the 'ProgressFailed' event. > >> > > > > The actual failure I see is: > > > > Exception: [Arg_COMException] > > Arguments: > > Debugging resource strings are unavailable. Often the key and > > arguments provide sufficient information to diagnose the problem. See > > > http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.1&File= > mscorlib.dll&Key=Arg_COMException > > > > > > > > Sorry for the noise. This one is actually for the sake of google (and > all who sail in her). > > Exception > at MS.Internal.XcpImports.GetDownloaderBytes(IntPtr element, IntPtr& > outBytes, Int32& outSize) > at MS.Internal.InternalWebRequest.GetResponseStream() > at System.Net.BrowserHttpWebRequest.Completed(Object sender, > EventArgs e) > at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 > typeIndex, Delegate handlerDelegate, Object sender, Object args) > at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr > unmanagedObjArgs, Int32 argsTypeIndex, String eventName) > > Michael > > > This is using Safari. As I'm developing on the Mac I can't use > > debugging, nor can I test in Firefox because of the bug in Chiron. > > > > It looks like some people have similar errors: > > > > http://silverlight.net/forums/p/12500/40967.aspx#40967 > > > > and a guy in the comments here: > > > > > > http://www.cameronalbert.com/post/2008/03/HttpWebRequest-Helper-for- > Silverlight-2.aspx > > > > > > All the best, > > > > Michael Foord > > http://www.ironpythoninaction.com/ > > > >> I need to make cross-domain POST, and although the request gets made > >> successfully I'm getting a COM Arg Exception everytime (I think > >> because the server is slow to respond). This is screwing me at the > >> moment. > >> > >> FYI - when I execute the following code in Silverlight: > >> > >> from System.Net import WebRequest > >> from System import Uri > >> > >> u = Uri('http://www.v.com') > >> req = WebRequest.Create(u) > >> print req.ProgressFailed > >> > >> I get the following exception: > >> > >> Traceback (most recent call last): > >> File "None", line 6, in > >> AttributeError: 'BrowserHttpWebRequest' object has no attribute > >> 'ProgressFailed' > >> > >> All the best, > >> > >> Michael Foord > >> http://www.ironpythoninaction.com/ > >> > >> > >>> PS. If you REALLY want synchronous downloading, just hack on > >>> XMLHttpRequest > >>> > >>> def download(url): > >>> request = HtmlPage.Window.CreateInstance("XMLHttpRequest") > >>> request.Invoke("open", "GET", url, false) # false means > synchronous > >>> request.Invoke("send", "") > >>> return request.GetProperty("responseText") > >>> > >>> :) > >>> > >>> ~js > >>> ________________________________________ > >>> From: users-boun... at lists.ironpython.com > >>> [users-boun... at lists.ironpython.com] On Behalf Of Michael Foord > >>> [fuzzy... at voidspace.org.uk] > >>> Sent: Monday, May 12, 2008 12:58 AM > >>> To: Discussion of IronPython > >>> Subject: [IronPython] Silverlight and Catching HttpWebRequest > Errors > >>> > >>> Hello guys, > >>> > >>> I have a problem with catching network errors raised by > HttpWebRequest > >>> in Silverlight. (Not necessarily an IronPython specific question - > but > >>> you guys are so intelligent you are always the first place I > turn...) > >>> > >>> HttpWebRequest uses an async model for fetching resources. If there > >>> is a > >>> problem (triggered usually by a slow response from the server), > then it > >>> can happen *after* I have made the request - but before my callback > is > >>> invoked. This gives me nowhere to catch the exception, as > >>> effectively it > >>> happens 'inside Silverlight'. I wondered if there was a solution... > ? > >>> > >>> def callback(asyncResult): > >>> ... > >>> > >>> uri = Uri(some_url) > >>> req = HttpWebRequest.Create(uri) > >>> > >>> req.BeginGetResponse(AsyncCallback(callback), object()) > >>> > >>> The error occurs after BeginGetResponse, but before calback. Any > ideas > >>> for catching it? > >>> > >>> Michael Foordhttp://www.ironpythoninaction.com/ > >>> > >>> _______________________________________________ > >>> Users mailing list > >>> > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/user > s-ironpython.com > >>> > >>> _______________________________________________ > >>> Users mailing list > >>> > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/user > s-ironpython.com > >>> > >>> > >> _______________________________________________ > >> Users mailing list > >> Users at lists.ironpython.com > >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >> > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Thu Jun 26 06:27:32 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 25 Jun 2008 21:27:32 -0700 Subject: [IronPython] Silverlight and Catching HttpWebRequest Errors In-Reply-To: <7AD436E4270DD54A94238001769C2227012C92C4C355@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4827F8A4.7020504@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A328457FE34E1D@NA-EXMSG-C116.redmond.corp.microsoft.com> <530a79a6-0bce-471b-843e-10db132795c9@k13g2000hse.googlegroups.com> <482B5FA3.6070506@voidspace.org.uk> <482B606D.60205@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE2A4@NA-EXMSG-C116.redmond.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227012C92C4C355@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE2B2@NA-EXMSG-C116.redmond.corp.microsoft.com> Thanks Dino. I'll bug the Networking guys about this. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Wednesday, June 25, 2008 9:23 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Silverlight and Catching HttpWebRequest > Errors > > While it might look like those events are public they aren't really. > BrowserHttpWebRequest is an internal type so its members are not > directly exposed - even if those members are public. If it were > overriding some methods on a base class or interface that were public > we could then access them. It does implement an interface which has > those members, INetworkProgress, but that interface is also internal! > So even though there are public methods there is no publicly accessible > way for us to get to those events :(. If the interface was public we'd > be able to access them. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi > Sent: Wednesday, June 25, 2008 9:09 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Silverlight and Catching HttpWebRequest > Errors > > So, did some homework on this. Taking a look at BrowserHttpWebRequest > with Reflector, it definitely has a public ProgressFailed event, but it > says it's read-only. > > Dino/Curt, could this behavior happen because BrowserHttpWebRequest has > a methods and events by exactly the same name? > > private EventHandler > ProgressChanged; > private EventHandler > ProgressCompleted; > private EventHandler > ProgressFailed; > > // Events > public event EventHandler > ProgressChanged; > public event EventHandler > ProgressCompleted; > public event EventHandler > ProgressFailed; > > Michael, regardless, for simple downloading I'd use WebClient; the code > is much more concise: > > from System.Net import WebClient > from System import Uri > > def Downloaded(sender, args): > print args.Result > > uri = Uri('http://localhost:2060/index.html') > req = WebClient() > req.DownloadStringCompleted += Downloaded > req.DownloadStringAsync(uri) > > Do you still have time to change your book's example? =P > > ~Jimmy > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > > bounces at lists.ironpython.com] On Behalf Of Michael Foord > > Sent: Wednesday, May 14, 2008 2:58 PM > > To: Discussion of IronPython > > Subject: Re: [IronPython] Silverlight and Catching HttpWebRequest > > Errors > > > > Michael Foord wrote: > > > Michael Foord wrote: > > >> On May 12, 9:17 am, Jimmy Schementi > > > >> wrote: > > >> > > >>> The actual type returned by HttpWebRequest.Create() is a > > >>> BrowserHttpWebRequest, but it's internal (not sure why). Anyway, > it > > >>> has a ProgressFailed event you can hook. > > >>> > > >> > > >> Hello Jimmy, > > >> > > >> As far as I can tell it *doesn't* have the 'ProgressFailed' event. > > >> > > > > > > The actual failure I see is: > > > > > > Exception: [Arg_COMException] > > > Arguments: > > > Debugging resource strings are unavailable. Often the key and > > > arguments provide sufficient information to diagnose the problem. > See > > > > > > http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.1&File= > > mscorlib.dll&Key=Arg_COMException > > > > > > > > > > > > > Sorry for the noise. This one is actually for the sake of google (and > > all who sail in her). > > > > Exception > > at MS.Internal.XcpImports.GetDownloaderBytes(IntPtr element, > IntPtr& > > outBytes, Int32& outSize) > > at MS.Internal.InternalWebRequest.GetResponseStream() > > at System.Net.BrowserHttpWebRequest.Completed(Object sender, > > EventArgs e) > > at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 > > typeIndex, Delegate handlerDelegate, Object sender, Object args) > > at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr > > unmanagedObjArgs, Int32 argsTypeIndex, String eventName) > > > > Michael > > > > > This is using Safari. As I'm developing on the Mac I can't use > > > debugging, nor can I test in Firefox because of the bug in Chiron. > > > > > > It looks like some people have similar errors: > > > > > > http://silverlight.net/forums/p/12500/40967.aspx#40967 > > > > > > and a guy in the comments here: > > > > > > > > > http://www.cameronalbert.com/post/2008/03/HttpWebRequest-Helper- > for- > > Silverlight-2.aspx > > > > > > > > > All the best, > > > > > > Michael Foord > > > http://www.ironpythoninaction.com/ > > > > > >> I need to make cross-domain POST, and although the request gets > made > > >> successfully I'm getting a COM Arg Exception everytime (I think > > >> because the server is slow to respond). This is screwing me at the > > >> moment. > > >> > > >> FYI - when I execute the following code in Silverlight: > > >> > > >> from System.Net import WebRequest > > >> from System import Uri > > >> > > >> u = Uri('http://www.v.com') > > >> req = WebRequest.Create(u) > > >> print req.ProgressFailed > > >> > > >> I get the following exception: > > >> > > >> Traceback (most recent call last): > > >> File "None", line 6, in > > >> AttributeError: 'BrowserHttpWebRequest' object has no attribute > > >> 'ProgressFailed' > > >> > > >> All the best, > > >> > > >> Michael Foord > > >> http://www.ironpythoninaction.com/ > > >> > > >> > > >>> PS. If you REALLY want synchronous downloading, just hack on > > >>> XMLHttpRequest > > >>> > > >>> def download(url): > > >>> request = HtmlPage.Window.CreateInstance("XMLHttpRequest") > > >>> request.Invoke("open", "GET", url, false) # false means > > synchronous > > >>> request.Invoke("send", "") > > >>> return request.GetProperty("responseText") > > >>> > > >>> :) > > >>> > > >>> ~js > > >>> ________________________________________ > > >>> From: users-boun... at lists.ironpython.com > > >>> [users-boun... at lists.ironpython.com] On Behalf Of Michael Foord > > >>> [fuzzy... at voidspace.org.uk] > > >>> Sent: Monday, May 12, 2008 12:58 AM > > >>> To: Discussion of IronPython > > >>> Subject: [IronPython] Silverlight and Catching HttpWebRequest > > Errors > > >>> > > >>> Hello guys, > > >>> > > >>> I have a problem with catching network errors raised by > > HttpWebRequest > > >>> in Silverlight. (Not necessarily an IronPython specific question > - > > but > > >>> you guys are so intelligent you are always the first place I > > turn...) > > >>> > > >>> HttpWebRequest uses an async model for fetching resources. If > there > > >>> is a > > >>> problem (triggered usually by a slow response from the server), > > then it > > >>> can happen *after* I have made the request - but before my > callback > > is > > >>> invoked. This gives me nowhere to catch the exception, as > > >>> effectively it > > >>> happens 'inside Silverlight'. I wondered if there was a > solution... > > ? > > >>> > > >>> def callback(asyncResult): > > >>> ... > > >>> > > >>> uri = Uri(some_url) > > >>> req = HttpWebRequest.Create(uri) > > >>> > > >>> req.BeginGetResponse(AsyncCallback(callback), object()) > > >>> > > >>> The error occurs after BeginGetResponse, but before calback. Any > > ideas > > >>> for catching it? > > >>> > > >>> Michael Foordhttp://www.ironpythoninaction.com/ > > >>> > > >>> _______________________________________________ > > >>> Users mailing list > > >>> > > > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/user > > s-ironpython.com > > >>> > > >>> _______________________________________________ > > >>> Users mailing list > > >>> > > > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/user > > s-ironpython.com > > >>> > > >>> > > >> _______________________________________________ > > >> Users mailing list > > >> Users at lists.ironpython.com > > >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > >> > > > > > > _______________________________________________ > > > Users mailing list > > > Users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > 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 fuzzyman at voidspace.org.uk Thu Jun 26 11:45:49 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 26 Jun 2008 10:45:49 +0100 Subject: [IronPython] Silverlight and Catching HttpWebRequest Errors In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE2A4@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4827F8A4.7020504@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A328457FE34E1D@NA-EXMSG-C116.redmond.corp.microsoft.com> <530a79a6-0bce-471b-843e-10db132795c9@k13g2000hse.googlegroups.com> <482B5FA3.6070506@voidspace.org.uk> <482B606D.60205@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE2A4@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <4863654D.1010207@voidspace.org.uk> Jimmy Schementi wrote: > So, did some homework on this. Taking a look at BrowserHttpWebRequest with Reflector, it definitely has a public ProgressFailed event, but it says it's read-only. > > Dino/Curt, could this behavior happen because BrowserHttpWebRequest has a methods and events by exactly the same name? > > private EventHandler ProgressChanged; > private EventHandler ProgressCompleted; > private EventHandler ProgressFailed; > > // Events > public event EventHandler ProgressChanged; > public event EventHandler ProgressCompleted; > public event EventHandler ProgressFailed; > > Michael, regardless, for simple downloading I'd use WebClient; the code is much more concise: > In beta 1 you couldn't do POST requests with WebClient I don't think. Has that changed in beta 2? Once I have finished chapter 15 of IronPython in Action I need to go through all my Silverlight stuff and update it to beta 2. Michael Foord > from System.Net import WebClient > from System import Uri > > def Downloaded(sender, args): > print args.Result > > uri = Uri('http://localhost:2060/index.html') > req = WebClient() > req.DownloadStringCompleted += Downloaded > req.DownloadStringAsync(uri) > > Do you still have time to change your book's example? =P > > ~Jimmy > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Wednesday, May 14, 2008 2:58 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Silverlight and Catching HttpWebRequest >> Errors >> >> Michael Foord wrote: >> >>> Michael Foord wrote: >>> >>>> On May 12, 9:17 am, Jimmy Schementi >>>> wrote: >>>> >>>> >>>>> The actual type returned by HttpWebRequest.Create() is a >>>>> BrowserHttpWebRequest, but it's internal (not sure why). Anyway, it >>>>> has a ProgressFailed event you can hook. >>>>> >>>>> >>>> Hello Jimmy, >>>> >>>> As far as I can tell it *doesn't* have the 'ProgressFailed' event. >>>> >>>> >>> The actual failure I see is: >>> >>> Exception: [Arg_COMException] >>> Arguments: >>> Debugging resource strings are unavailable. Often the key and >>> arguments provide sufficient information to diagnose the problem. See >>> >>> >> http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.1&File= >> mscorlib.dll&Key=Arg_COMException >> >>> >>> >> Sorry for the noise. This one is actually for the sake of google (and >> all who sail in her). >> >> Exception >> at MS.Internal.XcpImports.GetDownloaderBytes(IntPtr element, IntPtr& >> outBytes, Int32& outSize) >> at MS.Internal.InternalWebRequest.GetResponseStream() >> at System.Net.BrowserHttpWebRequest.Completed(Object sender, >> EventArgs e) >> at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 >> typeIndex, Delegate handlerDelegate, Object sender, Object args) >> at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr >> unmanagedObjArgs, Int32 argsTypeIndex, String eventName) >> >> Michael >> >> >>> This is using Safari. As I'm developing on the Mac I can't use >>> debugging, nor can I test in Firefox because of the bug in Chiron. >>> >>> It looks like some people have similar errors: >>> >>> http://silverlight.net/forums/p/12500/40967.aspx#40967 >>> >>> and a guy in the comments here: >>> >>> >>> http://www.cameronalbert.com/post/2008/03/HttpWebRequest-Helper-for- >>> >> Silverlight-2.aspx >> >>> All the best, >>> >>> Michael Foord >>> http://www.ironpythoninaction.com/ >>> >>> >>>> I need to make cross-domain POST, and although the request gets made >>>> successfully I'm getting a COM Arg Exception everytime (I think >>>> because the server is slow to respond). This is screwing me at the >>>> moment. >>>> >>>> FYI - when I execute the following code in Silverlight: >>>> >>>> from System.Net import WebRequest >>>> from System import Uri >>>> >>>> u = Uri('http://www.v.com') >>>> req = WebRequest.Create(u) >>>> print req.ProgressFailed >>>> >>>> I get the following exception: >>>> >>>> Traceback (most recent call last): >>>> File "None", line 6, in >>>> AttributeError: 'BrowserHttpWebRequest' object has no attribute >>>> 'ProgressFailed' >>>> >>>> All the best, >>>> >>>> Michael Foord >>>> http://www.ironpythoninaction.com/ >>>> >>>> >>>> >>>>> PS. If you REALLY want synchronous downloading, just hack on >>>>> XMLHttpRequest >>>>> >>>>> def download(url): >>>>> request = HtmlPage.Window.CreateInstance("XMLHttpRequest") >>>>> request.Invoke("open", "GET", url, false) # false means >>>>> >> synchronous >> >>>>> request.Invoke("send", "") >>>>> return request.GetProperty("responseText") >>>>> >>>>> :) >>>>> >>>>> ~js >>>>> ________________________________________ >>>>> From: users-boun... at lists.ironpython.com >>>>> [users-boun... at lists.ironpython.com] On Behalf Of Michael Foord >>>>> [fuzzy... at voidspace.org.uk] >>>>> Sent: Monday, May 12, 2008 12:58 AM >>>>> To: Discussion of IronPython >>>>> Subject: [IronPython] Silverlight and Catching HttpWebRequest >>>>> >> Errors >> >>>>> Hello guys, >>>>> >>>>> I have a problem with catching network errors raised by >>>>> >> HttpWebRequest >> >>>>> in Silverlight. (Not necessarily an IronPython specific question - >>>>> >> but >> >>>>> you guys are so intelligent you are always the first place I >>>>> >> turn...) >> >>>>> HttpWebRequest uses an async model for fetching resources. If there >>>>> is a >>>>> problem (triggered usually by a slow response from the server), >>>>> >> then it >> >>>>> can happen *after* I have made the request - but before my callback >>>>> >> is >> >>>>> invoked. This gives me nowhere to catch the exception, as >>>>> effectively it >>>>> happens 'inside Silverlight'. I wondered if there was a solution... >>>>> >> ? >> >>>>> def callback(asyncResult): >>>>> ... >>>>> >>>>> uri = Uri(some_url) >>>>> req = HttpWebRequest.Create(uri) >>>>> >>>>> req.BeginGetResponse(AsyncCallback(callback), object()) >>>>> >>>>> The error occurs after BeginGetResponse, but before calback. Any >>>>> >> ideas >> >>>>> for catching it? >>>>> >>>>> Michael Foordhttp://www.ironpythoninaction.com/ >>>>> >>>>> _______________________________________________ >>>>> Users mailing list >>>>> >>>>> >> Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/user >> s-ironpython.com >> >>>>> _______________________________________________ >>>>> Users mailing list >>>>> >>>>> >> Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/user >> s-ironpython.com >> >>>>> >>>> _______________________________________________ >>>> Users mailing list >>>> Users at lists.ironpython.com >>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>>> >>>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From fuzzyman at voidspace.org.uk Thu Jun 26 13:02:08 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 26 Jun 2008 12:02:08 +0100 Subject: [IronPython] ironpython and NUNIT In-Reply-To: References: Message-ID: <48637730.7000803@voidspace.org.uk> Curt Hagenlocher wrote: > I haven't tried to use Alex's adapter, though it looks rather > interesting. The reason why the adapter is necessary is that > frameworks like NUnit rely on the ability to attach CLR attributes to > your methods, something which we can't do today for IronPython. > > Have you considered using the native "unittest" library? Granted, it > doesn't have "a nice GUI", but it works pretty well. The module > itself is part of the standard CPython library, which we're not yet > including with IronPython so you'll have to download it yourself from > python.org . You can see documentation for it at > http://docs.python.org/lib/module-unittest.html. > > One advantage of unittest.py is that it should work the same for > IronPython 1.x and 2.x because it's implemented in pure Python and > therefore not dependent on the IronPython hosting APIs. > +1 Our whole test framework at Resolver Systems is built on unittest and it works very well with IronPython (as well as being the 'standard' Python testing framework). Michael Foord > On Wed, Jun 25, 2008 at 8:17 AM, Kaveripakam, Sathish > > wrote: > > Hello All, > > i am trying to use the NUNIT with Ironpython using VS2005, .NET > 2.0 version ( > http://blog.bittercoder.com/CommentView,guid,ef0c495d-6804-4d6e-9537-ce238b6047c3.aspx#commentstart ), > but I am not able to get the things going. Could any one had > issues with the usage ? > > Are there any test frameworks available which will work with iron > python ? any pointers/hints are welcome. > > ------------------------------------------------------------------------ > _Legal Notice:_ > The information in this electronic transmission may contain > confidential or legally privileged information and is intended > solely for the individual(s) named above. If you are not an > intended recipient or an authorized agent, you are hereby notified > that reading, distributing, or otherwise disseminating, copying or > taking any action based on the contents of this transmission is > strictly prohibited. Any unauthorized interception of this > transmission is illegal under law. If you have received this > transmission in error, please notify the sender by telephone [at > the number indicated above/on +41 58 928 0101] as soon as possible > and then destroy all copies of this transmission. > ------------------------------------------------------------------------ > > > _______________________________________________ > 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 kf9150 at gmail.com Thu Jun 26 19:06:04 2008 From: kf9150 at gmail.com (Kelie) Date: Thu, 26 Jun 2008 10:06:04 -0700 (PDT) Subject: [IronPython] events in PowerPoint In-Reply-To: <4862DE30.4030904@videotron.ca> References: <48618892.3040504@videotron.ca> <6bde1012-f58d-4677-af39-524d67ab7418@i36g2000prf.googlegroups.com> <4862DE30.4030904@videotron.ca> Message-ID: Try the code below. It works in my test, using Microsoft Office 2003 and IronPython 2. import time import clr from System.Runtime.InteropServices import Marshal clr.AddReference("Microsoft.Office.Interop.PowerPoint") import Microsoft.Office.Interop.PowerPoint as PowerPoint def onWindowSelectionChange(selection): print "Window selection changed." if __name__ == "__main__": ppt = Marshal.GetActiveObject("PowerPoint.Application") ppt.WindowSelectionChange += onWindowSelectionChange while True: time.sleep(1) From Shri.Borde at microsoft.com Thu Jun 26 19:59:08 2008 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 26 Jun 2008 10:59:08 -0700 Subject: [IronPython] The slow part of IronPython In-Reply-To: <4817b6fc0806250911v59840da7p34678334e9c22c38@mail.gmail.com> References: <4817b6fc0806241656p6150f1bdg6c9509b1e349cee1@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C92C4C0CF@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0806241757v577dbdd1iccf1ff1f4f9dda99@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C92C4C0ED@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <4817b6fc0806250911v59840da7p34678334e9c22c38@mail.gmail.com> Message-ID: <50B69702CA6E6D4E849D30CD4989AB8EE90FB816FD@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Dan, you could try turning on interpretation for all of your scripts. It might hurt your throughput (depending on how compute-intensive your script is), but it would be an interesting exercise to see how much it helps startup. The way to do this on the desktop is to use "ipy.exe -X:Interpret". Since you are looking at Silverlight, the steps are more complicated. Here are the steps. Include a C# dll with the following code: using System; using Microsoft.Scripting.Runtime; namespace ScriptingHelpers { public class ScriptingHelper { public static LanguageContext GetCurrentLanguageContext(CodeContext context) { return context.LanguageContext; } } >From your startup Python script, do the following: # This should be the very first Python file that is executed import clr clr.AddReference("ScriptingHelpers.dll") from ScriptingHelpers import ScriptingHelper # The DLR will automatically pass in a CodeContext to the function call currentContext = ScriptingHelper.GetCurrentLanguageContext() currentContext.Options.InterpretedMode = True # Now import the rest of the Python scripts. # These should hopefully load faster since they will be interpreted import someLargeModule1 import someLargeModule2 -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff Sent: Wednesday, June 25, 2008 9:11 AM To: Discussion of IronPython Subject: Re: [IronPython] The slow part of IronPython What if I used background threads to import some packages at program start? I imagine there is a race condition here if the background thread is still importing module x and the main thread starts to do the same, but if the worst case is it's parsed/compiled twice, but imported once, it doesn't matter. The work the background thread does is free on a multi-core machine. I may also be able to tweak my code to import some modules at runtime if they aren't used in the initial startup code path. IronPython is slow to startup, but really, as Foord pointed out, it's not noticeable once you start importing. On Tue, Jun 24, 2008 at 8:22 PM, Dino Viehland wrote: > Well IsolatedStorage probably isn't good enough. The problem is we actually save a real .NET assembly to disk and do so using reflection - which is the only way this offers any benefits - the slow part is generally compilation. So Reflection.Emit would have to support IsolatedStorage for this to work. > > If you really wanted to use it out of Silverlight you could probably save it to disk on the desktop CLR, ildasm it, edit it, update the references to the Silverlight assemblies, and then ilasm it (or programmatically w/ something like Cecil I suppose). But we'd never actually support that or advise you do it :) > > You'll also want to measure the benefit you get w/ your code before you even try - the speed improvement of pre-compilation can be less significant than you'd really like. The best improvements come when you can compile multiple modules into a single file. But compiling one module per file ends up not being much of a gain. It's also not free - it has the same performance cost as the lightweight scopes I mentioned before. And there's still a lot of code gen for user-defined types and call sites. > > The good news, I suppose, is startup is now our own biggest performance concern - working set's at the top of the list as well. Throughput is largely higher across the board in 2.0 except for in some crazy dynamic scenarios. So it's definitely where our performance work will focus on in the future and we also have a few more ideas to consider as well. Likely it'll be a combination of many things that ultimately speeds this up. Sorry it won't get immediately better - I'm as unhappy about it as you :(. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Eloff > Sent: Tuesday, June 24, 2008 5:58 PM > To: Discussion of IronPython > Subject: Re: [IronPython] The slow part of IronPython > >> There's a couple of plans a foot. We have been working on a pre-compilation feature like .pyc for IronPython 2.0 It's actually in Beta 3 but unfortunately it doesn't quite work yet which is the reason we haven't said anything. It will be there (and working!) in beta 4. > > Wow, looking forward to that! > >>that's the short term solution but unfortunately it won't really work with Silverlight - there's no way to compile against the Silverlight mscorlib from the desktop CLR and Silverlight doesn't support saving assemblies to disk. > > That seems more like a Silverlight problem than an IronPython one. > However, I can in Silverlight save arbitrary data to IsolatedStorage > (client side). This would, I think, enable caching the compiled > modules and loading them again on a per user basis, if only I have the > right api in IronPython to get the compiled module as byte > array/string and load from the same. I could then tweak the importing > machinery (import hook? it can be done in CPython) slightly to check > IsolatedStorage first for the compiled module and load that if > possible, falling back to the standard importing mechanism, with the > minor difference of saving the compiled module to IsolatedStorage. > i.e. build in the .pyc saving/loading in python using IsolatedStorage > instead of the file system. > > Any chance you guys could provide that api? Because it would be a > dream to see IronPython totally scream in the browser. > > -Dan > _______________________________________________ > 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 Jimmy.Schementi at microsoft.com Thu Jun 26 20:01:06 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 26 Jun 2008 11:01:06 -0700 Subject: [IronPython] Silverlight and Catching HttpWebRequest Errors In-Reply-To: <4863654D.1010207@voidspace.org.uk> References: <4827F8A4.7020504@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A328457FE34E1D@NA-EXMSG-C116.redmond.corp.microsoft.com> <530a79a6-0bce-471b-843e-10db132795c9@k13g2000hse.googlegroups.com> <482B5FA3.6070506@voidspace.org.uk> <482B606D.60205@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE2A4@NA-EXMSG-C116.redmond.corp.microsoft.com> <4863654D.1010207@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE4C3@NA-EXMSG-C116.redmond.corp.microsoft.com> Michael Foord wrote: > Jimmy Schementi wrote: > > So, did some homework on this. Taking a look at BrowserHttpWebRequest > with Reflector, it definitely has a public ProgressFailed event, but it > says it's read-only. > > > > Dino/Curt, could this behavior happen because BrowserHttpWebRequest > has a methods and events by exactly the same name? > > > > private EventHandler > ProgressChanged; > > private EventHandler > ProgressCompleted; > > private EventHandler > ProgressFailed; > > > > // Events > > public event EventHandler > ProgressChanged; > > public event EventHandler > ProgressCompleted; > > public event EventHandler > ProgressFailed; > > > > Michael, regardless, for simple downloading I'd use WebClient; the > code is much more concise: > > > > In beta 1 you couldn't do POST requests with WebClient I don't think. > Has that changed in beta 2? > > Once I have finished chapter 15 of IronPython in Action I need to go > through all my Silverlight stuff and update it to beta 2. > > Michael Foord Yep, POST is now supported by WebClient. For cross-domain post, you must have something like in the clientaccesspolicy.xml file on the server. ~js > > from System.Net import WebClient > > from System import Uri > > > > def Downloaded(sender, args): > > print args.Result > > > > uri = Uri('http://localhost:2060/index.html') > > req = WebClient() > > req.DownloadStringCompleted += Downloaded > > req.DownloadStringAsync(uri) > > > > Do you still have time to change your book's example? =P > > > > ~Jimmy > > > > > >> -----Original Message----- > >> From: users-bounces at lists.ironpython.com [mailto:users- > >> bounces at lists.ironpython.com] On Behalf Of Michael Foord > >> Sent: Wednesday, May 14, 2008 2:58 PM > >> To: Discussion of IronPython > >> Subject: Re: [IronPython] Silverlight and Catching HttpWebRequest > >> Errors > >> > >> Michael Foord wrote: > >> > >>> Michael Foord wrote: > >>> > >>>> On May 12, 9:17 am, Jimmy Schementi > > >>>> wrote: > >>>> > >>>> > >>>>> The actual type returned by HttpWebRequest.Create() is a > >>>>> BrowserHttpWebRequest, but it's internal (not sure why). Anyway, > it > >>>>> has a ProgressFailed event you can hook. > >>>>> > >>>>> > >>>> Hello Jimmy, > >>>> > >>>> As far as I can tell it *doesn't* have the 'ProgressFailed' event. > >>>> > >>>> > >>> The actual failure I see is: > >>> > >>> Exception: [Arg_COMException] > >>> Arguments: > >>> Debugging resource strings are unavailable. Often the key and > >>> arguments provide sufficient information to diagnose the problem. > See > >>> > >>> > >> > http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.1&File= > >> mscorlib.dll&Key=Arg_COMException > >> > >>> > >>> > >> Sorry for the noise. This one is actually for the sake of google > (and > >> all who sail in her). > >> > >> Exception > >> at MS.Internal.XcpImports.GetDownloaderBytes(IntPtr element, > IntPtr& > >> outBytes, Int32& outSize) > >> at MS.Internal.InternalWebRequest.GetResponseStream() > >> at System.Net.BrowserHttpWebRequest.Completed(Object sender, > >> EventArgs e) > >> at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 > >> typeIndex, Delegate handlerDelegate, Object sender, Object args) > >> at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr > >> unmanagedObjArgs, Int32 argsTypeIndex, String eventName) > >> > >> Michael > >> > >> > >>> This is using Safari. As I'm developing on the Mac I can't use > >>> debugging, nor can I test in Firefox because of the bug in Chiron. > >>> > >>> It looks like some people have similar errors: > >>> > >>> http://silverlight.net/forums/p/12500/40967.aspx#40967 > >>> > >>> and a guy in the comments here: > >>> > >>> > >>> http://www.cameronalbert.com/post/2008/03/HttpWebRequest-Helper- > for- > >>> > >> Silverlight-2.aspx > >> > >>> All the best, > >>> > >>> Michael Foord > >>> http://www.ironpythoninaction.com/ > >>> > >>> > >>>> I need to make cross-domain POST, and although the request gets > made > >>>> successfully I'm getting a COM Arg Exception everytime (I think > >>>> because the server is slow to respond). This is screwing me at the > >>>> moment. > >>>> > >>>> FYI - when I execute the following code in Silverlight: > >>>> > >>>> from System.Net import WebRequest > >>>> from System import Uri > >>>> > >>>> u = Uri('http://www.v.com') > >>>> req = WebRequest.Create(u) > >>>> print req.ProgressFailed > >>>> > >>>> I get the following exception: > >>>> > >>>> Traceback (most recent call last): > >>>> File "None", line 6, in > >>>> AttributeError: 'BrowserHttpWebRequest' object has no attribute > >>>> 'ProgressFailed' > >>>> > >>>> All the best, > >>>> > >>>> Michael Foord > >>>> http://www.ironpythoninaction.com/ > >>>> > >>>> > >>>> > >>>>> PS. If you REALLY want synchronous downloading, just hack on > >>>>> XMLHttpRequest > >>>>> > >>>>> def download(url): > >>>>> request = HtmlPage.Window.CreateInstance("XMLHttpRequest") > >>>>> request.Invoke("open", "GET", url, false) # false means > >>>>> > >> synchronous > >> > >>>>> request.Invoke("send", "") > >>>>> return request.GetProperty("responseText") > >>>>> > >>>>> :) > >>>>> > >>>>> ~js > >>>>> ________________________________________ > >>>>> From: users-boun... at lists.ironpython.com > >>>>> [users-boun... at lists.ironpython.com] On Behalf Of Michael Foord > >>>>> [fuzzy... at voidspace.org.uk] > >>>>> Sent: Monday, May 12, 2008 12:58 AM > >>>>> To: Discussion of IronPython > >>>>> Subject: [IronPython] Silverlight and Catching HttpWebRequest > >>>>> > >> Errors > >> > >>>>> Hello guys, > >>>>> > >>>>> I have a problem with catching network errors raised by > >>>>> > >> HttpWebRequest > >> > >>>>> in Silverlight. (Not necessarily an IronPython specific question > - > >>>>> > >> but > >> > >>>>> you guys are so intelligent you are always the first place I > >>>>> > >> turn...) > >> > >>>>> HttpWebRequest uses an async model for fetching resources. If > there > >>>>> is a > >>>>> problem (triggered usually by a slow response from the server), > >>>>> > >> then it > >> > >>>>> can happen *after* I have made the request - but before my > callback > >>>>> > >> is > >> > >>>>> invoked. This gives me nowhere to catch the exception, as > >>>>> effectively it > >>>>> happens 'inside Silverlight'. I wondered if there was a > solution... > >>>>> > >> ? > >> > >>>>> def callback(asyncResult): > >>>>> ... > >>>>> > >>>>> uri = Uri(some_url) > >>>>> req = HttpWebRequest.Create(uri) > >>>>> > >>>>> req.BeginGetResponse(AsyncCallback(callback), object()) > >>>>> > >>>>> The error occurs after BeginGetResponse, but before calback. Any > >>>>> > >> ideas > >> > >>>>> for catching it? > >>>>> > >>>>> Michael Foordhttp://www.ironpythoninaction.com/ > >>>>> > >>>>> _______________________________________________ > >>>>> Users mailing list > >>>>> > >>>>> > >> > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/user > >> s-ironpython.com > >> > >>>>> _______________________________________________ > >>>>> Users mailing list > >>>>> > >>>>> > >> > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/user > >> s-ironpython.com > >> > >>>>> > >>>> _______________________________________________ > >>>> Users mailing list > >>>> Users at lists.ironpython.com > >>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >>>> > >>>> > >>> _______________________________________________ > >>> Users mailing list > >>> Users at lists.ironpython.com > >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >>> > >> _______________________________________________ > >> Users mailing list > >> Users at lists.ironpython.com > >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >> > > _______________________________________________ > > 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 fuzzyman at voidspace.org.uk Thu Jun 26 22:21:04 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 26 Jun 2008 21:21:04 +0100 Subject: [IronPython] Silverlight and Catching HttpWebRequest Errors In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE4C3@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4827F8A4.7020504@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A328457FE34E1D@NA-EXMSG-C116.redmond.corp.microsoft.com> <530a79a6-0bce-471b-843e-10db132795c9@k13g2000hse.googlegroups.com> <482B5FA3.6070506@voidspace.org.uk> <482B606D.60205@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE2A4@NA-EXMSG-C116.redmond.corp.microsoft.com> <4863654D.1010207@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE4C3@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <4863FA30.5090406@voidspace.org.uk> Jimmy Schementi wrote: > Michael Foord wrote: > >> Jimmy Schementi wrote: >> >>> So, did some homework on this. Taking a look at BrowserHttpWebRequest >>> >> with Reflector, it definitely has a public ProgressFailed event, but it >> says it's read-only. >> >>> Dino/Curt, could this behavior happen because BrowserHttpWebRequest >>> >> has a methods and events by exactly the same name? >> >>> private EventHandler >>> >> ProgressChanged; >> >>> private EventHandler >>> >> ProgressCompleted; >> >>> private EventHandler >>> >> ProgressFailed; >> >>> // Events >>> public event EventHandler >>> >> ProgressChanged; >> >>> public event EventHandler >>> >> ProgressCompleted; >> >>> public event EventHandler >>> >> ProgressFailed; >> >>> Michael, regardless, for simple downloading I'd use WebClient; the >>> >> code is much more concise: >> >> In beta 1 you couldn't do POST requests with WebClient I don't think. >> Has that changed in beta 2? >> >> Once I have finished chapter 15 of IronPython in Action I need to go >> through all my Silverlight stuff and update it to beta 2. >> >> Michael Foord >> > > Yep, POST is now supported by WebClient. For cross-domain post, you must have something like in the clientaccesspolicy.xml file on the server. > Thanks. Michael > ~js > > >>> from System.Net import WebClient >>> from System import Uri >>> >>> def Downloaded(sender, args): >>> print args.Result >>> >>> uri = Uri('http://localhost:2060/index.html') >>> req = WebClient() >>> req.DownloadStringCompleted += Downloaded >>> req.DownloadStringAsync(uri) >>> >>> Do you still have time to change your book's example? =P >>> >>> ~Jimmy >>> >>> >>> >>>> -----Original Message----- >>>> From: users-bounces at lists.ironpython.com [mailto:users- >>>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>>> Sent: Wednesday, May 14, 2008 2:58 PM >>>> To: Discussion of IronPython >>>> Subject: Re: [IronPython] Silverlight and Catching HttpWebRequest >>>> Errors >>>> >>>> Michael Foord wrote: >>>> >>>> >>>>> Michael Foord wrote: >>>>> >>>>> >>>>>> On May 12, 9:17 am, Jimmy Schementi >>>>>> >> >> >>>>>> wrote: >>>>>> >>>>>> >>>>>> >>>>>>> The actual type returned by HttpWebRequest.Create() is a >>>>>>> BrowserHttpWebRequest, but it's internal (not sure why). Anyway, >>>>>>> >> it >> >>>>>>> has a ProgressFailed event you can hook. >>>>>>> >>>>>>> >>>>>>> >>>>>> Hello Jimmy, >>>>>> >>>>>> As far as I can tell it *doesn't* have the 'ProgressFailed' event. >>>>>> >>>>>> >>>>>> >>>>> The actual failure I see is: >>>>> >>>>> Exception: [Arg_COMException] >>>>> Arguments: >>>>> Debugging resource strings are unavailable. Often the key and >>>>> arguments provide sufficient information to diagnose the problem. >>>>> >> See >> >>>>> >> http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.1&File= >> >>>> mscorlib.dll&Key=Arg_COMException >>>> >>>> >>>>> >>>> Sorry for the noise. This one is actually for the sake of google >>>> >> (and >> >>>> all who sail in her). >>>> >>>> Exception >>>> at MS.Internal.XcpImports.GetDownloaderBytes(IntPtr element, >>>> >> IntPtr& >> >>>> outBytes, Int32& outSize) >>>> at MS.Internal.InternalWebRequest.GetResponseStream() >>>> at System.Net.BrowserHttpWebRequest.Completed(Object sender, >>>> EventArgs e) >>>> at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 >>>> typeIndex, Delegate handlerDelegate, Object sender, Object args) >>>> at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr >>>> unmanagedObjArgs, Int32 argsTypeIndex, String eventName) >>>> >>>> Michael >>>> >>>> >>>> >>>>> This is using Safari. As I'm developing on the Mac I can't use >>>>> debugging, nor can I test in Firefox because of the bug in Chiron. >>>>> >>>>> It looks like some people have similar errors: >>>>> >>>>> http://silverlight.net/forums/p/12500/40967.aspx#40967 >>>>> >>>>> and a guy in the comments here: >>>>> >>>>> >>>>> http://www.cameronalbert.com/post/2008/03/HttpWebRequest-Helper- >>>>> >> for- >> >>>> Silverlight-2.aspx >>>> >>>> >>>>> All the best, >>>>> >>>>> Michael Foord >>>>> http://www.ironpythoninaction.com/ >>>>> >>>>> >>>>> >>>>>> I need to make cross-domain POST, and although the request gets >>>>>> >> made >> >>>>>> successfully I'm getting a COM Arg Exception everytime (I think >>>>>> because the server is slow to respond). This is screwing me at the >>>>>> moment. >>>>>> >>>>>> FYI - when I execute the following code in Silverlight: >>>>>> >>>>>> from System.Net import WebRequest >>>>>> from System import Uri >>>>>> >>>>>> u = Uri('http://www.v.com') >>>>>> req = WebRequest.Create(u) >>>>>> print req.ProgressFailed >>>>>> >>>>>> I get the following exception: >>>>>> >>>>>> Traceback (most recent call last): >>>>>> File "None", line 6, in >>>>>> AttributeError: 'BrowserHttpWebRequest' object has no attribute >>>>>> 'ProgressFailed' >>>>>> >>>>>> All the best, >>>>>> >>>>>> Michael Foord >>>>>> http://www.ironpythoninaction.com/ >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> PS. If you REALLY want synchronous downloading, just hack on >>>>>>> XMLHttpRequest >>>>>>> >>>>>>> def download(url): >>>>>>> request = HtmlPage.Window.CreateInstance("XMLHttpRequest") >>>>>>> request.Invoke("open", "GET", url, false) # false means >>>>>>> >>>>>>> >>>> synchronous >>>> >>>> >>>>>>> request.Invoke("send", "") >>>>>>> return request.GetProperty("responseText") >>>>>>> >>>>>>> :) >>>>>>> >>>>>>> ~js >>>>>>> ________________________________________ >>>>>>> From: users-boun... at lists.ironpython.com >>>>>>> [users-boun... at lists.ironpython.com] On Behalf Of Michael Foord >>>>>>> [fuzzy... at voidspace.org.uk] >>>>>>> Sent: Monday, May 12, 2008 12:58 AM >>>>>>> To: Discussion of IronPython >>>>>>> Subject: [IronPython] Silverlight and Catching HttpWebRequest >>>>>>> >>>>>>> >>>> Errors >>>> >>>> >>>>>>> Hello guys, >>>>>>> >>>>>>> I have a problem with catching network errors raised by >>>>>>> >>>>>>> >>>> HttpWebRequest >>>> >>>> >>>>>>> in Silverlight. (Not necessarily an IronPython specific question >>>>>>> >> - >> >>>> but >>>> >>>> >>>>>>> you guys are so intelligent you are always the first place I >>>>>>> >>>>>>> >>>> turn...) >>>> >>>> >>>>>>> HttpWebRequest uses an async model for fetching resources. If >>>>>>> >> there >> >>>>>>> is a >>>>>>> problem (triggered usually by a slow response from the server), >>>>>>> >>>>>>> >>>> then it >>>> >>>> >>>>>>> can happen *after* I have made the request - but before my >>>>>>> >> callback >> >>>> is >>>> >>>> >>>>>>> invoked. This gives me nowhere to catch the exception, as >>>>>>> effectively it >>>>>>> happens 'inside Silverlight'. I wondered if there was a >>>>>>> >> solution... >> >>>> ? >>>> >>>> >>>>>>> def callback(asyncResult): >>>>>>> ... >>>>>>> >>>>>>> uri = Uri(some_url) >>>>>>> req = HttpWebRequest.Create(uri) >>>>>>> >>>>>>> req.BeginGetResponse(AsyncCallback(callback), object()) >>>>>>> >>>>>>> The error occurs after BeginGetResponse, but before calback. Any >>>>>>> >>>>>>> >>>> ideas >>>> >>>> >>>>>>> for catching it? >>>>>>> >>>>>>> Michael Foordhttp://www.ironpythoninaction.com/ >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Users mailing list >>>>>>> >>>>>>> >>>>>>> >> Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/user >> >>>> s-ironpython.com >>>> >>>> >>>>>>> _______________________________________________ >>>>>>> Users mailing list >>>>>>> >>>>>>> >>>>>>> >> Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/user >> >>>> s-ironpython.com >>>> >>>> >>>>>> _______________________________________________ >>>>>> Users mailing list >>>>>> Users at lists.ironpython.com >>>>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>>>>> >>>>>> >>>>>> >>>>> _______________________________________________ >>>>> Users mailing list >>>>> Users at lists.ironpython.com >>>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>>>> >>>>> >>>> _______________________________________________ >>>> Users mailing list >>>> Users at lists.ironpython.com >>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>>> >>>> >>> _______________________________________________ >>> 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From fuzzyman at voidspace.org.uk Thu Jun 26 23:58:55 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 26 Jun 2008 22:58:55 +0100 Subject: [IronPython] Viewlets: Any F# experts here? Message-ID: <4864111F.6010309@voidspace.org.uk> The viewlets that come with VSLab look *really* cool. They're based on F# so I decided to see if they could be used from IronPython. http://www.codeplex.com/vslab The dependencies are pretty hefty. You need F# installed *and* Managed DirectX (June 2008 SDK ~450mb seems to fulfil the dependency). To get at the viewlet assemblies you need Visual Studio Pro installed as well, but they can be extracted from the VSLabs msi installer without VS Pro. Ok, so with all the dependencies installed I attempt to use them - and *boom*. Anyone here got any ideas? IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReference('vslabfsicore') >>> clr.AddReference('vslabviewlets') >>> clr.AddReference('vslabcore') >>> from GraphViewlet import GraphControl >>> g = GraphControl() Traceback (most recent call last): File "", line 1, in File "vslabviewlets", line unknown, in .ctor File "vslabfsicore", line unknown, in .ctor File "System.Windows.Forms", line unknown, in get_Controls File "System.Windows.Forms", line unknown, in get_Properties SystemError: Object reference not set to an instance of an object. Interesting that the explosion is inside winforms. Referencing that assembly first makes knows difference. Michael Foord -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From Jimmy.Schementi at microsoft.com Fri Jun 27 00:04:27 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 26 Jun 2008 15:04:27 -0700 Subject: [IronPython] Viewlets: Any F# experts here? In-Reply-To: <4864111F.6010309@voidspace.org.uk> References: <4864111F.6010309@voidspace.org.uk> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE6FA@NA-EXMSG-C116.redmond.corp.microsoft.com> Adding Luke Hoban, the F# ninja at Microsoft =) Luke, any ideas? Swing by my office if you are confused. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Thursday, June 26, 2008 2:59 PM > To: Discussion of IronPython > Subject: [IronPython] Viewlets: Any F# experts here? > > The viewlets that come with VSLab look *really* cool. They're based on > F# so I decided to see if they could be used from IronPython. > > http://www.codeplex.com/vslab > > The dependencies are pretty hefty. You need F# installed *and* Managed > DirectX (June 2008 SDK ~450mb seems to fulfil the dependency). > > To get at the viewlet assemblies you need Visual Studio Pro installed > as > well, but they can be extracted from the VSLabs msi installer without > VS > Pro. > > Ok, so with all the dependencies installed I attempt to use them - and > *boom*. Anyone here got any ideas? > > IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import clr > >>> clr.AddReference('vslabfsicore') > >>> clr.AddReference('vslabviewlets') > >>> clr.AddReference('vslabcore') > >>> from GraphViewlet import GraphControl > >>> g = GraphControl() > Traceback (most recent call last): > File "", line 1, in > File "vslabviewlets", line unknown, in .ctor > File "vslabfsicore", line unknown, in .ctor > File "System.Windows.Forms", line unknown, in get_Controls > File "System.Windows.Forms", line unknown, in get_Properties > SystemError: Object reference not set to an instance of an object. > > > Interesting that the explosion is inside winforms. Referencing that > assembly first makes knows difference. > > Michael Foord > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Shri.Borde at microsoft.com Fri Jun 27 00:27:22 2008 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 26 Jun 2008 15:27:22 -0700 Subject: [IronPython] Viewlets: Any F# experts here? In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE6FA@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <4864111F.6010309@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE6FA@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <50B69702CA6E6D4E849D30CD4989AB8EE90FB818A1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Michael, what is the CLR stack trace (-X:ShowClrExceptions)? -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi Sent: Thursday, June 26, 2008 3:04 PM To: Discussion of IronPython Cc: Luke Hoban Subject: Re: [IronPython] Viewlets: Any F# experts here? Adding Luke Hoban, the F# ninja at Microsoft =) Luke, any ideas? Swing by my office if you are confused. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Thursday, June 26, 2008 2:59 PM > To: Discussion of IronPython > Subject: [IronPython] Viewlets: Any F# experts here? > > The viewlets that come with VSLab look *really* cool. They're based on > F# so I decided to see if they could be used from IronPython. > > http://www.codeplex.com/vslab > > The dependencies are pretty hefty. You need F# installed *and* Managed > DirectX (June 2008 SDK ~450mb seems to fulfil the dependency). > > To get at the viewlet assemblies you need Visual Studio Pro installed > as > well, but they can be extracted from the VSLabs msi installer without > VS > Pro. > > Ok, so with all the dependencies installed I attempt to use them - and > *boom*. Anyone here got any ideas? > > IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import clr > >>> clr.AddReference('vslabfsicore') > >>> clr.AddReference('vslabviewlets') > >>> clr.AddReference('vslabcore') > >>> from GraphViewlet import GraphControl > >>> g = GraphControl() > Traceback (most recent call last): > File "", line 1, in > File "vslabviewlets", line unknown, in .ctor > File "vslabfsicore", line unknown, in .ctor > File "System.Windows.Forms", line unknown, in get_Controls > File "System.Windows.Forms", line unknown, in get_Properties > SystemError: Object reference not set to an instance of an object. > > > Interesting that the explosion is inside winforms. Referencing that > assembly first makes knows difference. > > Michael Foord > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 fuzzyman at voidspace.org.uk Fri Jun 27 00:39:22 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 26 Jun 2008 23:39:22 +0100 Subject: [IronPython] Viewlets: Any F# experts here? In-Reply-To: <50B69702CA6E6D4E849D30CD4989AB8EE90FB818A1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4864111F.6010309@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE6FA@NA-EXMSG-C116.redmond.corp.microsoft.com> <50B69702CA6E6D4E849D30CD4989AB8EE90FB818A1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <48641A9A.20307@voidspace.org.uk> Shri Borde wrote: > Michael, what is the CLR stack trace (-X:ShowClrExceptions)? > Not much more useful I'm afraid. C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe -X:ShowClrExceptions viewle t.py Traceback (most recent call last): File "viewlet.py", line 4, in viewlet.py File "vslabviewlets", line unknown, in .ctor File "vslabfsicore", line unknown, in .ctor File "System.Windows.Forms", line unknown, in get_Controls File "System.Windows.Forms", line unknown, in get_Properties SystemError: Object reference not set to an instance of an object. CLR Exception: NullReferenceException : Object reference not set to an instance of an object. Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi > Sent: Thursday, June 26, 2008 3:04 PM > To: Discussion of IronPython > Cc: Luke Hoban > Subject: Re: [IronPython] Viewlets: Any F# experts here? > > Adding Luke Hoban, the F# ninja at Microsoft =) > > Luke, any ideas? Swing by my office if you are confused. > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Thursday, June 26, 2008 2:59 PM >> To: Discussion of IronPython >> Subject: [IronPython] Viewlets: Any F# experts here? >> >> The viewlets that come with VSLab look *really* cool. They're based on >> F# so I decided to see if they could be used from IronPython. >> >> http://www.codeplex.com/vslab >> >> The dependencies are pretty hefty. You need F# installed *and* Managed >> DirectX (June 2008 SDK ~450mb seems to fulfil the dependency). >> >> To get at the viewlet assemblies you need Visual Studio Pro installed >> as >> well, but they can be extracted from the VSLabs msi installer without >> VS >> Pro. >> >> Ok, so with all the dependencies installed I attempt to use them - and >> *boom*. Anyone here got any ideas? >> >> IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434 >> Copyright (c) Microsoft Corporation. All rights reserved. >> >>> import clr >> >>> clr.AddReference('vslabfsicore') >> >>> clr.AddReference('vslabviewlets') >> >>> clr.AddReference('vslabcore') >> >>> from GraphViewlet import GraphControl >> >>> g = GraphControl() >> Traceback (most recent call last): >> File "", line 1, in >> File "vslabviewlets", line unknown, in .ctor >> File "vslabfsicore", line unknown, in .ctor >> File "System.Windows.Forms", line unknown, in get_Controls >> File "System.Windows.Forms", line unknown, in get_Properties >> SystemError: Object reference not set to an instance of an object. >> >> >> Interesting that the explosion is inside winforms. Referencing that >> assembly first makes knows difference. >> >> Michael Foord >> >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From falcon at uwyo.edu Fri Jun 27 00:44:20 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Thu, 26 Jun 2008 16:44:20 -0600 Subject: [IronPython] DLR question Message-ID: I have a DLR question and was wondering if you guys knew. We have a python scripting system for our application. We would like to add iron python to it as well. My question is can I define a ruby function and an iron python function in the same class? That way they can write ruby functions and python functions and they can all be bound with the same local variables and class state etc. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From Shri.Borde at microsoft.com Fri Jun 27 00:51:39 2008 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 26 Jun 2008 15:51:39 -0700 Subject: [IronPython] Viewlets: Any F# experts here? In-Reply-To: <48641A9A.20307@voidspace.org.uk> References: <4864111F.6010309@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE6FA@NA-EXMSG-C116.redmond.corp.microsoft.com> <50B69702CA6E6D4E849D30CD4989AB8EE90FB818A1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <48641A9A.20307@voidspace.org.uk> Message-ID: <50B69702CA6E6D4E849D30CD4989AB8EE90FB818B9@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Actually, -X:ExceptionDetail is the more important option. Could you try that? It will you the System.Exception stack trace. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Thursday, June 26, 2008 3:39 PM To: Discussion of IronPython Subject: Re: [IronPython] Viewlets: Any F# experts here? Shri Borde wrote: > Michael, what is the CLR stack trace (-X:ShowClrExceptions)? > Not much more useful I'm afraid. C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe -X:ShowClrExceptions viewle t.py Traceback (most recent call last): File "viewlet.py", line 4, in viewlet.py File "vslabviewlets", line unknown, in .ctor File "vslabfsicore", line unknown, in .ctor File "System.Windows.Forms", line unknown, in get_Controls File "System.Windows.Forms", line unknown, in get_Properties SystemError: Object reference not set to an instance of an object. CLR Exception: NullReferenceException : Object reference not set to an instance of an object. Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi > Sent: Thursday, June 26, 2008 3:04 PM > To: Discussion of IronPython > Cc: Luke Hoban > Subject: Re: [IronPython] Viewlets: Any F# experts here? > > Adding Luke Hoban, the F# ninja at Microsoft =) > > Luke, any ideas? Swing by my office if you are confused. > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Thursday, June 26, 2008 2:59 PM >> To: Discussion of IronPython >> Subject: [IronPython] Viewlets: Any F# experts here? >> >> The viewlets that come with VSLab look *really* cool. They're based on >> F# so I decided to see if they could be used from IronPython. >> >> http://www.codeplex.com/vslab >> >> The dependencies are pretty hefty. You need F# installed *and* Managed >> DirectX (June 2008 SDK ~450mb seems to fulfil the dependency). >> >> To get at the viewlet assemblies you need Visual Studio Pro installed >> as >> well, but they can be extracted from the VSLabs msi installer without >> VS >> Pro. >> >> Ok, so with all the dependencies installed I attempt to use them - and >> *boom*. Anyone here got any ideas? >> >> IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434 >> Copyright (c) Microsoft Corporation. All rights reserved. >> >>> import clr >> >>> clr.AddReference('vslabfsicore') >> >>> clr.AddReference('vslabviewlets') >> >>> clr.AddReference('vslabcore') >> >>> from GraphViewlet import GraphControl >> >>> g = GraphControl() >> Traceback (most recent call last): >> File "", line 1, in >> File "vslabviewlets", line unknown, in .ctor >> File "vslabfsicore", line unknown, in .ctor >> File "System.Windows.Forms", line unknown, in get_Controls >> File "System.Windows.Forms", line unknown, in get_Properties >> SystemError: Object reference not set to an instance of an object. >> >> >> Interesting that the explosion is inside winforms. Referencing that >> assembly first makes knows difference. >> >> Michael Foord >> >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Fri Jun 27 02:01:46 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 26 Jun 2008 17:01:46 -0700 Subject: [IronPython] DLR question In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227012C92C4C541@DF-GRTDANE-MSG.exchange.corp.microsoft.com> The short answer to this is yes. But there's a longer answer too :) First off, it's not like you're going to be able to do: class MyPythonClass(object): def MyPythonFunc(self): pass def MyRubyFunc end or anything like that. There's also no plans to support subclassing because generally the type systems are just too different. But you can monkey patch all you want. So you could do: class MyPythonClass(object): pass then in Ruby: MyPythonClass.someFunc = someProcOrBlockOrWhateverThoseRubyGuysDo And you could get crazy with metaclasses or other such magic to make this more seamless. The other part of the long answer is that this doesn't necessarily work today - I'm actually not sure whether it does or not today. We're actually in the process of finalizing the interop protocol right now and when that's done and all the languages have adopted the new protocol we'll start testing this and ensuring we have good interop. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens Sent: Thursday, June 26, 2008 3:44 PM To: Discussion of IronPython Subject: [IronPython] DLR question I have a DLR question and was wondering if you guys knew. We have a python scripting system for our application. We would like to add iron python to it as well. My question is can I define a ruby function and an iron python function in the same class? That way they can write ruby functions and python functions and they can all be bound with the same local variables and class state etc. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben2004uk at googlemail.com Fri Jun 27 02:09:27 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Fri, 27 Jun 2008 01:09:27 +0100 Subject: [IronPython] DLR question In-Reply-To: <7AD436E4270DD54A94238001769C2227012C92C4C541@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227012C92C4C541@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Will we ever be in a position where, for example, Rails could run on top of Python and that level of interop? Ben On Fri, Jun 27, 2008 at 1:01 AM, Dino Viehland wrote: > The short answer to this is yes. But there's a longer answer too J > > > > First off, it's not like you're going to be able to do: > > > > class MyPythonClass(object): > > def MyPythonFunc(self): pass > > def MyRubyFunc > > end > > > > or anything like that. There's also no plans to support subclassing because > generally the type systems are just too different. But you can monkey patch > all you want. So you could do: > > > > class MyPythonClass(object): pass > > > > then in Ruby: > > > > MyPythonClass.someFunc = someProcOrBlockOrWhateverThoseRubyGuysDo > > > > And you could get crazy with metaclasses or other such magic to make this > more seamless. > > > > The other part of the long answer is that this doesn't necessarily work > today ? I'm actually not sure whether it does or not today. We're actually > in the process of finalizing the interop protocol right now and when that's > done and all the languages have adopted the new protocol we'll start testing > this and ensuring we have good interop. > > > > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens > Sent: Thursday, June 26, 2008 3:44 PM > To: Discussion of IronPython > Subject: [IronPython] DLR question > > > > I have a DLR question and was wondering if you guys knew. We have a python > scripting system for our application. We would like to add iron python to > it as well. My question is can I define a ruby function and an iron python > function in the same class? That way they can write ruby functions and > python functions and they can all be bound with the same local variables and > class state etc. > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From dinov at exchange.microsoft.com Fri Jun 27 02:26:22 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 26 Jun 2008 17:26:22 -0700 Subject: [IronPython] DLR question In-Reply-To: References: <7AD436E4270DD54A94238001769C2227012C92C4C541@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C92C4C550@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Maybe? :) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ben Hall Sent: Thursday, June 26, 2008 5:09 PM To: Discussion of IronPython Subject: Re: [IronPython] DLR question Will we ever be in a position where, for example, Rails could run on top of Python and that level of interop? Ben On Fri, Jun 27, 2008 at 1:01 AM, Dino Viehland wrote: > The short answer to this is yes. But there's a longer answer too J > > > > First off, it's not like you're going to be able to do: > > > > class MyPythonClass(object): > > def MyPythonFunc(self): pass > > def MyRubyFunc > > end > > > > or anything like that. There's also no plans to support subclassing because > generally the type systems are just too different. But you can monkey patch > all you want. So you could do: > > > > class MyPythonClass(object): pass > > > > then in Ruby: > > > > MyPythonClass.someFunc = someProcOrBlockOrWhateverThoseRubyGuysDo > > > > And you could get crazy with metaclasses or other such magic to make this > more seamless. > > > > The other part of the long answer is that this doesn't necessarily work > today - I'm actually not sure whether it does or not today. We're actually > in the process of finalizing the interop protocol right now and when that's > done and all the languages have adopted the new protocol we'll start testing > this and ensuring we have good interop. > > > > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Stephens > Sent: Thursday, June 26, 2008 3:44 PM > To: Discussion of IronPython > Subject: [IronPython] DLR question > > > > I have a DLR question and was wondering if you guys knew. We have a python > scripting system for our application. We would like to add iron python to > it as well. My question is can I define a ruby function and an iron python > function in the same class? That way they can write ruby functions and > python functions and they can all be bound with the same local variables and > class state etc. > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Fri Jun 27 03:42:35 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 26 Jun 2008 18:42:35 -0700 Subject: [IronPython] DLR question In-Reply-To: <7AD436E4270DD54A94238001769C2227012C92C4C550@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227012C92C4C541@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227012C92C4C550@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE836@NA-EXMSG-C116.redmond.corp.microsoft.com> Let's break it down: 1. Will IronRuby will run real ruby programs? Yes 2. Is Rails is a real ruby program? Yes So, those two points say that IronRuby will run Rails. We run "hello world" today. Cool. 3. Will IronRuby and IronPython will be able to interop? Yes, but in a constrained way. So, you'll be able to use IronRuby code from IronPython, and visa versa. However, this is constrained. As Dino said, you won't be able to subclass. So ... 4. Will IronPython run Rails? No, not pure vanilla Rails. Rails controller/models depend on subclassing, so you wouldn't be able to do this: class MyPythonController(ActionController.Base): def index(): render(partial='foo') ... though it does seem awesome! So, someone need to write a layer in between to create an IronPython API for Rails. But I'm not sure any Python developer would want to ever do that. :) ~Jimmy > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Thursday, June 26, 2008 5:26 PM > To: Discussion of IronPython > Subject: Re: [IronPython] DLR question > > Maybe? :) > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Ben Hall > Sent: Thursday, June 26, 2008 5:09 PM > To: Discussion of IronPython > Subject: Re: [IronPython] DLR question > > Will we ever be in a position where, for example, Rails could run on > top of Python and that level of interop? > > Ben > > > On Fri, Jun 27, 2008 at 1:01 AM, Dino Viehland > wrote: > > The short answer to this is yes. But there's a longer answer too J > > > > > > > > First off, it's not like you're going to be able to do: > > > > > > > > class MyPythonClass(object): > > > > def MyPythonFunc(self): pass > > > > def MyRubyFunc > > > > end > > > > > > > > or anything like that. There's also no plans to support subclassing > because > > generally the type systems are just too different. But you can > monkey patch > > all you want. So you could do: > > > > > > > > class MyPythonClass(object): pass > > > > > > > > then in Ruby: > > > > > > > > MyPythonClass.someFunc = someProcOrBlockOrWhateverThoseRubyGuysDo > > > > > > > > And you could get crazy with metaclasses or other such magic to make > this > > more seamless. > > > > > > > > The other part of the long answer is that this doesn't necessarily > work > > today - I'm actually not sure whether it does or not today. We're > actually > > in the process of finalizing the interop protocol right now and when > that's > > done and all the languages have adopted the new protocol we'll start > testing > > this and ensuring we have good interop. > > > > > > > > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael > Stephens > > Sent: Thursday, June 26, 2008 3:44 PM > > To: Discussion of IronPython > > Subject: [IronPython] DLR question > > > > > > > > I have a DLR question and was wondering if you guys knew. We have a > python > > scripting system for our application. We would like to add iron > python to > > it as well. My question is can I define a ruby function and an iron > python > > function in the same class? That way they can write ruby functions > and > > python functions and they can all be bound with the same local > variables and > > class state etc. > > > > Michael Stephens > > > > Electrical Engineering Graduate Student > > University of Wyoming > > falcon at uwyo.edu or 89iroc at gmail.com > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Fri Jun 27 12:06:04 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 27 Jun 2008 11:06:04 +0100 Subject: [IronPython] Viewlets: Any F# experts here? In-Reply-To: <50B69702CA6E6D4E849D30CD4989AB8EE90FB818B9@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4864111F.6010309@voidspace.org.uk> <5283CA0A4168DF4FBBD71AE9ECA5A32845D42AE6FA@NA-EXMSG-C116.redmond.corp.microsoft.com> <50B69702CA6E6D4E849D30CD4989AB8EE90FB818A1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <48641A9A.20307@voidspace.org.uk> <50B69702CA6E6D4E849D30CD4989AB8EE90FB818B9@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <4864BB8C.5010906@voidspace.org.uk> Shri Borde wrote: > Actually, -X:ExceptionDetail is the more important option. Could you try that? It will you the System.Exception stack trace. > Hmmm... still not sure it is more useful. C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe -X:ExceptionDetail viewlet. py Object reference not set to an instance of an object. at System.Windows.Forms.Control.get_Properties() at System.Windows.Forms.Control.get_Controls() at VSLabFSICore.Viewlet..ctor() at GraphViewlet.GraphControl..ctor() at _stub_$22##20(Closure , CallSite , CodeContext , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at S$2.Initialize(CodeContext ) at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) SystemError: Object reference not set to an instance of an object. C:\compile\VSLab> > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Thursday, June 26, 2008 3:39 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Viewlets: Any F# experts here? > > Shri Borde wrote: > >> Michael, what is the CLR stack trace (-X:ShowClrExceptions)? >> >> > > Not much more useful I'm afraid. > > > C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe > -X:ShowClrExceptions viewle > t.py > Traceback (most recent call last): > File "viewlet.py", line 4, in viewlet.py > File "vslabviewlets", line unknown, in .ctor > File "vslabfsicore", line unknown, in .ctor > File "System.Windows.Forms", line unknown, in get_Controls > File "System.Windows.Forms", line unknown, in get_Properties > SystemError: Object reference not set to an instance of an object. > CLR Exception: > NullReferenceException > : > Object reference not set to an instance of an object. > > Michael > > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi >> Sent: Thursday, June 26, 2008 3:04 PM >> To: Discussion of IronPython >> Cc: Luke Hoban >> Subject: Re: [IronPython] Viewlets: Any F# experts here? >> >> Adding Luke Hoban, the F# ninja at Microsoft =) >> >> Luke, any ideas? Swing by my office if you are confused. >> >> >> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com [mailto:users- >>> bounces at lists.ironpython.com] On Behalf Of Michael Foord >>> Sent: Thursday, June 26, 2008 2:59 PM >>> To: Discussion of IronPython >>> Subject: [IronPython] Viewlets: Any F# experts here? >>> >>> The viewlets that come with VSLab look *really* cool. They're based on >>> F# so I decided to see if they could be used from IronPython. >>> >>> http://www.codeplex.com/vslab >>> >>> The dependencies are pretty hefty. You need F# installed *and* Managed >>> DirectX (June 2008 SDK ~450mb seems to fulfil the dependency). >>> >>> To get at the viewlet assemblies you need Visual Studio Pro installed >>> as >>> well, but they can be extracted from the VSLabs msi installer without >>> VS >>> Pro. >>> >>> Ok, so with all the dependencies installed I attempt to use them - and >>> *boom*. Anyone here got any ideas? >>> >>> IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434 >>> Copyright (c) Microsoft Corporation. All rights reserved. >>> >>> import clr >>> >>> clr.AddReference('vslabfsicore') >>> >>> clr.AddReference('vslabviewlets') >>> >>> clr.AddReference('vslabcore') >>> >>> from GraphViewlet import GraphControl >>> >>> g = GraphControl() >>> Traceback (most recent call last): >>> File "", line 1, in >>> File "vslabviewlets", line unknown, in .ctor >>> File "vslabfsicore", line unknown, in .ctor >>> File "System.Windows.Forms", line unknown, in get_Controls >>> File "System.Windows.Forms", line unknown, in get_Properties >>> SystemError: Object reference not set to an instance of an object. >>> >>> >>> Interesting that the explosion is inside winforms. Referencing that >>> assembly first makes knows difference. >>> >>> Michael Foord >>> >>> >>> -- >>> http://www.ironpythoninaction.com/ >>> http://www.voidspace.org.uk/ >>> http://www.trypython.org/ >>> http://www.ironpython.info/ >>> http://www.theotherdelia.co.uk/ >>> http://www.resolverhacks.net/ >>> >>> _______________________________________________ >>> 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 >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From curt at hagenlocher.org Fri Jun 27 15:32:59 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 27 Jun 2008 06:32:59 -0700 Subject: [IronPython] Viewlets: Any F# experts here? In-Reply-To: <4864111F.6010309@voidspace.org.uk> References: <4864111F.6010309@voidspace.org.uk> Message-ID: A bit of quality time with Reflector shows that there's a _viewletsProxy object which hasn't been initialized. You probably need to call VSLabFSICore.Viewlets.Init() first. It's static, and in the vslabfsicore module. On Thu, Jun 26, 2008 at 2:58 PM, Michael Foord wrote: > The viewlets that come with VSLab look *really* cool. They're based on F# > so I decided to see if they could be used from IronPython. > > http://www.codeplex.com/vslab > > The dependencies are pretty hefty. You need F# installed *and* Managed > DirectX (June 2008 SDK ~450mb seems to fulfil the dependency). > > To get at the viewlet assemblies you need Visual Studio Pro installed as > well, but they can be extracted from the VSLabs msi installer without VS > Pro. > > Ok, so with all the dependencies installed I attempt to use them - and > *boom*. Anyone here got any ideas? > > IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import clr > >>> clr.AddReference('vslabfsicore') > >>> clr.AddReference('vslabviewlets') > >>> clr.AddReference('vslabcore') > >>> from GraphViewlet import GraphControl > >>> g = GraphControl() > Traceback (most recent call last): > File "", line 1, in > File "vslabviewlets", line unknown, in .ctor > File "vslabfsicore", line unknown, in .ctor > File "System.Windows.Forms", line unknown, in get_Controls > File "System.Windows.Forms", line unknown, in get_Properties > SystemError: Object reference not set to an instance of an object. > > > Interesting that the explosion is inside winforms. Referencing that > assembly first makes knows difference. > > Michael Foord > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 fuzzyman at voidspace.org.uk Fri Jun 27 15:45:56 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 27 Jun 2008 14:45:56 +0100 Subject: [IronPython] Viewlets: Any F# experts here? In-Reply-To: References: <4864111F.6010309@voidspace.org.uk> Message-ID: <4864EF14.9000306@voidspace.org.uk> Curt Hagenlocher wrote: > A bit of quality time with Reflector shows that there's a > _viewletsProxy object which hasn't been initialized. You probably > need to call VSLabFSICore.Viewlets.Init() first. It's static, and in > the vslabfsicore module. Thanks Curt - your reflector-fu is greater than mine. I should spend some quality time with it. Your advice gets me to the next step, I can make a GraphControl flash momentarily into view (on creation), but attempting to show it causes another explosion: C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe -X:ExceptionDetail viewlet. py Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_E_UNAVAILABLE)) at System.Runtime.InteropServices.Marshal.GetActiveObject(Guid& rclsid, IntPt r reserved, Object& ppunk) at System.Runtime.InteropServices.Marshal.GetActiveObject(String progID) at VSLabFSICore.Viewlet.Show() at GraphViewlet.GraphControl.Show() at _stub_$28##26(Closure , CallSite , CodeContext , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite site, T0 arg0, T1 arg1) at S$2.Initialize(CodeContext ) at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) EnvironmentError: Operation unavailable (Exception from HRESULT: 0x800401E3 (MK_ E_UNAVAILABLE)) The code that produces this is: import clr clr.AddReference('vslabfsicore') clr.AddReference('vslabviewlets') from VSLabFSICore import Viewlets from GraphViewlet import GraphControl Viewlets.Init() g = GraphControl() g.Show() If instead of 'g.Show()' I attempt 'dir(g)' I get a very odd error! C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe -X:ExceptionDetail viewlet. py 'this' type cannot be an interface itself. at System.RuntimeTypeHandle.GetFirstSlotForInterface(IntPtr interfaceHandle) at System.RuntimeType.GetInterfaceMap(Type ifaceType) at Microsoft.Scripting.Generation.CompilerHelpers.TryGetCallableMethod(Method Info method) at Microsoft.Scripting.Generation.CompilerHelpers.FilterNonVisibleMembers(Typ e type, MemberInfo[] foundMembers) at IronPython.Runtime.Types.TypeInfo.MemberBinder.GetMember(Type type, String name, BindingFlags flags) at IronPython.Runtime.Types.TypeInfo.StandardResolver.ResolveMember(MemberBin der binder, DynamicAction action, Type type, String name) at IronPython.Runtime.Types.TypeInfo.MemberResolver.ResolveMembers(MemberBind er binder, DynamicAction action, Type type) at IronPython.Runtime.Types.TypeInfo.GetResolvedMembers(MemberBinder memberBi nder, DynamicAction action, Type type) at IronPython.Runtime.Calls.PythonBinder.ResolveMemberNames(CodeContext conte xt, PythonType type, PythonType owner, Dictionary`2 memberNames) at IronPython.Runtime.Types.PythonType.GetMemberNames(CodeContext context, Ob ject self) at IronPython.Runtime.Operations.PythonOps.GetAttrNames(CodeContext context, Object o) at IronPython.Runtime.Builtin.dir(CodeContext context, Object o) at _stub_$26##24(Closure , CallSite , CodeContext , Object , Object ) at _stub_MatchCaller(Object , CallSite , Object[] ) at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) at Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallS ite site, T0 arg0, T1 arg1, T2 arg2) at S$2.Initialize(CodeContext ) at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) ValueError: 'this' type cannot be an interface itself. Incidentally, even when installed with VS Pro I can't get VSLab to work *anyway* (this is Vista 64bit FWIW), so the code may not be ready for prime time. I may try firing up reflector myself and see where it takes me. Michael Foord > > On Thu, Jun 26, 2008 at 2:58 PM, Michael Foord > > wrote: > > The viewlets that come with VSLab look *really* cool. They're > based on F# so I decided to see if they could be used from IronPython. > > http://www.codeplex.com/vslab > > The dependencies are pretty hefty. You need F# installed *and* > Managed DirectX (June 2008 SDK ~450mb seems to fulfil the dependency). > > To get at the viewlet assemblies you need Visual Studio Pro > installed as well, but they can be extracted from the VSLabs msi > installer without VS Pro. > > Ok, so with all the dependencies installed I attempt to use them - > and *boom*. Anyone here got any ideas? > > IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import clr > >>> clr.AddReference('vslabfsicore') > >>> clr.AddReference('vslabviewlets') > >>> clr.AddReference('vslabcore') > >>> from GraphViewlet import GraphControl > >>> g = GraphControl() > Traceback (most recent call last): > File "", line 1, in > File "vslabviewlets", line unknown, in .ctor > File "vslabfsicore", line unknown, in .ctor > File "System.Windows.Forms", line unknown, in get_Controls > File "System.Windows.Forms", line unknown, in get_Properties > SystemError: Object reference not set to an instance of an object. > > > Interesting that the explosion is inside winforms. Referencing > that assembly first makes knows difference. > > Michael Foord > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From curt at hagenlocher.org Fri Jun 27 15:52:19 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 27 Jun 2008 06:52:19 -0700 Subject: [IronPython] Viewlets: Any F# experts here? In-Reply-To: <4864EF14.9000306@voidspace.org.uk> References: <4864111F.6010309@voidspace.org.uk> <4864EF14.9000306@voidspace.org.uk> Message-ID: That "dir" error is a known problem with beta 3 -- and as you might imagine, sky-high in priority on our list of things to fix for beta 4. Viewlets appear to be user controls; you probably need to host one in a Form. On Fri, Jun 27, 2008 at 6:45 AM, Michael Foord wrote: > Curt Hagenlocher wrote: > >> A bit of quality time with Reflector shows that there's a _viewletsProxy >> object which hasn't been initialized. You probably need to call >> VSLabFSICore.Viewlets.Init() first. It's static, and in the vslabfsicore >> module. >> > > Thanks Curt - your reflector-fu is greater than mine. I should spend some > quality time with it. > > Your advice gets me to the next step, I can make a GraphControl flash > momentarily into view (on creation), but attempting to show it causes > another explosion: > > C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe -X:ExceptionDetail > viewlet. > py > Operation unavailable (Exception from HRESULT: 0x800401E3 > (MK_E_UNAVAILABLE)) > at System.Runtime.InteropServices.Marshal.GetActiveObject(Guid& rclsid, > IntPt > r reserved, Object& ppunk) > at System.Runtime.InteropServices.Marshal.GetActiveObject(String progID) > at VSLabFSICore.Viewlet.Show() > at GraphViewlet.GraphControl.Show() > at _stub_$28##26(Closure , CallSite , CodeContext , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at > Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite > site, T0 arg0, T1 arg1) > at S$2.Initialize(CodeContext ) > at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) > at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) > EnvironmentError: Operation unavailable (Exception from HRESULT: 0x800401E3 > (MK_ > E_UNAVAILABLE)) > > The code that produces this is: > > import clr > clr.AddReference('vslabfsicore') > clr.AddReference('vslabviewlets') > > from VSLabFSICore import Viewlets > from GraphViewlet import GraphControl > > Viewlets.Init() > g = GraphControl() > g.Show() > > If instead of 'g.Show()' I attempt 'dir(g)' I get a very odd error! > > C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe -X:ExceptionDetail > viewlet. > py > 'this' type cannot be an interface itself. > at System.RuntimeTypeHandle.GetFirstSlotForInterface(IntPtr > interfaceHandle) > at System.RuntimeType.GetInterfaceMap(Type ifaceType) > at > Microsoft.Scripting.Generation.CompilerHelpers.TryGetCallableMethod(Method > Info method) > at > Microsoft.Scripting.Generation.CompilerHelpers.FilterNonVisibleMembers(Typ > e type, MemberInfo[] foundMembers) > at IronPython.Runtime.Types.TypeInfo.MemberBinder.GetMember(Type type, > String > name, BindingFlags flags) > at > IronPython.Runtime.Types.TypeInfo.StandardResolver.ResolveMember(MemberBin > der binder, DynamicAction action, Type type, String name) > at > IronPython.Runtime.Types.TypeInfo.MemberResolver.ResolveMembers(MemberBind > er binder, DynamicAction action, Type type) > at IronPython.Runtime.Types.TypeInfo.GetResolvedMembers(MemberBinder > memberBi > nder, DynamicAction action, Type type) > at IronPython.Runtime.Calls.PythonBinder.ResolveMemberNames(CodeContext > conte > xt, PythonType type, PythonType owner, Dictionary`2 memberNames) > at IronPython.Runtime.Types.PythonType.GetMemberNames(CodeContext context, > Ob > ject self) > at IronPython.Runtime.Operations.PythonOps.GetAttrNames(CodeContext > context, > Object o) > at IronPython.Runtime.Builtin.dir(CodeContext context, Object o) > at _stub_$26##24(Closure , CallSite , CodeContext , Object , Object ) > at _stub_MatchCaller(Object , CallSite , Object[] ) > at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) > at > Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallS > ite site, T0 arg0, T1 arg1, T2 arg2) > at S$2.Initialize(CodeContext ) > at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) > at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) > ValueError: 'this' type cannot be an interface itself. > > > Incidentally, even when installed with VS Pro I can't get VSLab to work > *anyway* (this is Vista 64bit FWIW), so the code may not be ready for prime > time. > > I may try firing up reflector myself and see where it takes me. > > Michael Foord > > >> On Thu, Jun 26, 2008 at 2:58 PM, Michael Foord > fuzzyman at voidspace.org.uk>> wrote: >> >> The viewlets that come with VSLab look *really* cool. They're >> based on F# so I decided to see if they could be used from IronPython. >> >> http://www.codeplex.com/vslab >> >> The dependencies are pretty hefty. You need F# installed *and* >> Managed DirectX (June 2008 SDK ~450mb seems to fulfil the dependency). >> >> To get at the viewlet assemblies you need Visual Studio Pro >> installed as well, but they can be extracted from the VSLabs msi >> installer without VS Pro. >> >> Ok, so with all the dependencies installed I attempt to use them - >> and *boom*. Anyone here got any ideas? >> >> IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434 >> Copyright (c) Microsoft Corporation. All rights reserved. >> >>> import clr >> >>> clr.AddReference('vslabfsicore') >> >>> clr.AddReference('vslabviewlets') >> >>> clr.AddReference('vslabcore') >> >>> from GraphViewlet import GraphControl >> >>> g = GraphControl() >> Traceback (most recent call last): >> File "", line 1, in >> File "vslabviewlets", line unknown, in .ctor >> File "vslabfsicore", line unknown, in .ctor >> File "System.Windows.Forms", line unknown, in get_Controls >> File "System.Windows.Forms", line unknown, in get_Properties >> SystemError: Object reference not set to an instance of an object. >> >> >> Interesting that the explosion is inside winforms. Referencing >> that assembly first makes knows difference. >> >> Michael Foord >> >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 curt at hagenlocher.org Fri Jun 27 16:00:33 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 27 Jun 2008 07:00:33 -0700 Subject: [IronPython] Viewlets: Any F# experts here? In-Reply-To: References: <4864111F.6010309@voidspace.org.uk> <4864EF14.9000306@voidspace.org.uk> Message-ID: Oh, duh, it hosts itself inside that ViewletProxy that was previously uninitialized :) Are you doing this with Visual Studio running? On Fri, Jun 27, 2008 at 6:52 AM, Curt Hagenlocher wrote: > That "dir" error is a known problem with beta 3 -- and as you might > imagine, sky-high in priority on our list of things to fix for beta 4. > > Viewlets appear to be user controls; you probably need to host one in a > Form. > > On Fri, Jun 27, 2008 at 6:45 AM, Michael Foord < > fuzzyman at voidspace.org.uk> wrote: > >> Curt Hagenlocher wrote: >> >>> A bit of quality time with Reflector shows that there's a _viewletsProxy >>> object which hasn't been initialized. You probably need to call >>> VSLabFSICore.Viewlets.Init() first. It's static, and in the vslabfsicore >>> module. >>> >> >> Thanks Curt - your reflector-fu is greater than mine. I should spend some >> quality time with it. >> >> Your advice gets me to the next step, I can make a GraphControl flash >> momentarily into view (on creation), but attempting to show it causes >> another explosion: >> >> C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe -X:ExceptionDetail >> viewlet. >> py >> Operation unavailable (Exception from HRESULT: 0x800401E3 >> (MK_E_UNAVAILABLE)) >> at System.Runtime.InteropServices.Marshal.GetActiveObject(Guid& rclsid, >> IntPt >> r reserved, Object& ppunk) >> at System.Runtime.InteropServices.Marshal.GetActiveObject(String progID) >> at VSLabFSICore.Viewlet.Show() >> at GraphViewlet.GraphControl.Show() >> at _stub_$28##26(Closure , CallSite , CodeContext , Object ) >> at _stub_MatchCaller(Object , CallSite , Object[] ) >> at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) >> at >> Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite >> site, T0 arg0, T1 arg1) >> at S$2.Initialize(CodeContext ) >> at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) >> at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) >> EnvironmentError: Operation unavailable (Exception from HRESULT: >> 0x800401E3 (MK_ >> E_UNAVAILABLE)) >> >> The code that produces this is: >> >> import clr >> clr.AddReference('vslabfsicore') >> clr.AddReference('vslabviewlets') >> >> from VSLabFSICore import Viewlets >> from GraphViewlet import GraphControl >> >> Viewlets.Init() >> g = GraphControl() >> g.Show() >> >> If instead of 'g.Show()' I attempt 'dir(g)' I get a very odd error! >> >> C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe -X:ExceptionDetail >> viewlet. >> py >> 'this' type cannot be an interface itself. >> at System.RuntimeTypeHandle.GetFirstSlotForInterface(IntPtr >> interfaceHandle) >> at System.RuntimeType.GetInterfaceMap(Type ifaceType) >> at >> Microsoft.Scripting.Generation.CompilerHelpers.TryGetCallableMethod(Method >> Info method) >> at >> Microsoft.Scripting.Generation.CompilerHelpers.FilterNonVisibleMembers(Typ >> e type, MemberInfo[] foundMembers) >> at IronPython.Runtime.Types.TypeInfo.MemberBinder.GetMember(Type type, >> String >> name, BindingFlags flags) >> at >> IronPython.Runtime.Types.TypeInfo.StandardResolver.ResolveMember(MemberBin >> der binder, DynamicAction action, Type type, String name) >> at >> IronPython.Runtime.Types.TypeInfo.MemberResolver.ResolveMembers(MemberBind >> er binder, DynamicAction action, Type type) >> at IronPython.Runtime.Types.TypeInfo.GetResolvedMembers(MemberBinder >> memberBi >> nder, DynamicAction action, Type type) >> at IronPython.Runtime.Calls.PythonBinder.ResolveMemberNames(CodeContext >> conte >> xt, PythonType type, PythonType owner, Dictionary`2 memberNames) >> at IronPython.Runtime.Types.PythonType.GetMemberNames(CodeContext >> context, Ob >> ject self) >> at IronPython.Runtime.Operations.PythonOps.GetAttrNames(CodeContext >> context, >> Object o) >> at IronPython.Runtime.Builtin.dir(CodeContext context, Object o) >> at _stub_$26##24(Closure , CallSite , CodeContext , Object , Object ) >> at _stub_MatchCaller(Object , CallSite , Object[] ) >> at Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] args) >> at >> Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallS >> ite site, T0 arg0, T1 arg1, T2 arg2) >> at S$2.Initialize(CodeContext ) >> at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName) >> at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) >> ValueError: 'this' type cannot be an interface itself. >> >> >> Incidentally, even when installed with VS Pro I can't get VSLab to work >> *anyway* (this is Vista 64bit FWIW), so the code may not be ready for prime >> time. >> >> I may try firing up reflector myself and see where it takes me. >> >> Michael Foord >> >> >>> On Thu, Jun 26, 2008 at 2:58 PM, Michael Foord < >>> fuzzyman at voidspace.org.uk > wrote: >>> >>> The viewlets that come with VSLab look *really* cool. They're >>> based on F# so I decided to see if they could be used from IronPython. >>> >>> http://www.codeplex.com/vslab >>> >>> The dependencies are pretty hefty. You need F# installed *and* >>> Managed DirectX (June 2008 SDK ~450mb seems to fulfil the dependency). >>> >>> To get at the viewlet assemblies you need Visual Studio Pro >>> installed as well, but they can be extracted from the VSLabs msi >>> installer without VS Pro. >>> >>> Ok, so with all the dependencies installed I attempt to use them - >>> and *boom*. Anyone here got any ideas? >>> >>> IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434 >>> Copyright (c) Microsoft Corporation. All rights reserved. >>> >>> import clr >>> >>> clr.AddReference('vslabfsicore') >>> >>> clr.AddReference('vslabviewlets') >>> >>> clr.AddReference('vslabcore') >>> >>> from GraphViewlet import GraphControl >>> >>> g = GraphControl() >>> Traceback (most recent call last): >>> File "", line 1, in >>> File "vslabviewlets", line unknown, in .ctor >>> File "vslabfsicore", line unknown, in .ctor >>> File "System.Windows.Forms", line unknown, in get_Controls >>> File "System.Windows.Forms", line unknown, in get_Properties >>> SystemError: Object reference not set to an instance of an object. >>> >>> >>> Interesting that the explosion is inside winforms. Referencing >>> that assembly first makes knows difference. >>> >>> Michael Foord >>> >>> >>> -- http://www.ironpythoninaction.com/ >>> http://www.voidspace.org.uk/ >>> http://www.trypython.org/ >>> http://www.ironpython.info/ >>> http://www.theotherdelia.co.uk/ >>> http://www.resolverhacks.net/ >>> >>> _______________________________________________ >>> 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 >>> >>> >> >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 fuzzyman at voidspace.org.uk Fri Jun 27 16:35:11 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 27 Jun 2008 15:35:11 +0100 Subject: [IronPython] Viewlets: Any F# experts here? In-Reply-To: References: <4864111F.6010309@voidspace.org.uk> <4864EF14.9000306@voidspace.org.uk> Message-ID: <4864FA9F.3030807@voidspace.org.uk> Curt Hagenlocher wrote: > Oh, duh, it hosts itself inside that ViewletProxy that was previously > uninitialized :) > > Are you doing this with Visual Studio running? I tried hosting it in a separate form and it didn't show. I'm running standalone under IronPython - no VS. Michael > > On Fri, Jun 27, 2008 at 6:52 AM, Curt Hagenlocher > > wrote: > > That "dir" error is a known problem with beta 3 -- and as you > might imagine, sky-high in priority on our list of things to fix > for beta 4. > > Viewlets appear to be user controls; you probably need to host one > in a Form. > > On Fri, Jun 27, 2008 at 6:45 AM, Michael Foord > > wrote: > > Curt Hagenlocher wrote: > > A bit of quality time with Reflector shows that there's a > _viewletsProxy object which hasn't been initialized. You > probably need to call VSLabFSICore.Viewlets.Init() first. > It's static, and in the vslabfsicore module. > > > Thanks Curt - your reflector-fu is greater than mine. I should > spend some quality time with it. > > Your advice gets me to the next step, I can make a > GraphControl flash momentarily into view (on creation), but > attempting to show it causes another explosion: > > > C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe > -X:ExceptionDetail viewlet. > py > Operation unavailable (Exception from HRESULT: 0x800401E3 > (MK_E_UNAVAILABLE)) > at > System.Runtime.InteropServices.Marshal.GetActiveObject(Guid& > rclsid, IntPt > r reserved, Object& ppunk) > at > System.Runtime.InteropServices.Marshal.GetActiveObject(String > progID) > at VSLabFSICore.Viewlet.Show() > at GraphViewlet.GraphControl.Show() > at _stub_$28##26(Closure , CallSite , CodeContext , Object ) > > at _stub_MatchCaller(Object , CallSite , Object[] ) > at > Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] > args) > at > Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite > site, T0 arg0, T1 arg1) > at S$2.Initialize(CodeContext ) > at IronPython.Hosting.PythonCommandLine.RunFileWorker(String > fileName) > at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) > EnvironmentError: Operation unavailable (Exception from > HRESULT: 0x800401E3 (MK_ > E_UNAVAILABLE)) > > The code that produces this is: > > > import clr > clr.AddReference('vslabfsicore') > clr.AddReference('vslabviewlets') > > from VSLabFSICore import Viewlets > from GraphViewlet import GraphControl > > Viewlets.Init() > g = GraphControl() > g.Show() > > If instead of 'g.Show()' I attempt 'dir(g)' I get a very odd > error! > > > C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe > -X:ExceptionDetail viewlet. > py > 'this' type cannot be an interface itself. > at System.RuntimeTypeHandle.GetFirstSlotForInterface(IntPtr > interfaceHandle) > at System.RuntimeType.GetInterfaceMap(Type ifaceType) > at > Microsoft.Scripting.Generation.CompilerHelpers.TryGetCallableMethod(Method > Info method) > at > Microsoft.Scripting.Generation.CompilerHelpers.FilterNonVisibleMembers(Typ > e type, MemberInfo[] foundMembers) > at > IronPython.Runtime.Types.TypeInfo.MemberBinder.GetMember(Type > type, String > name, BindingFlags flags) > at > IronPython.Runtime.Types.TypeInfo.StandardResolver.ResolveMember(MemberBin > der binder, DynamicAction action, Type type, String name) > at > IronPython.Runtime.Types.TypeInfo.MemberResolver.ResolveMembers(MemberBind > er binder, DynamicAction action, Type type) > at > IronPython.Runtime.Types.TypeInfo.GetResolvedMembers(MemberBinder > memberBi > nder, DynamicAction action, Type type) > at > IronPython.Runtime.Calls.PythonBinder.ResolveMemberNames(CodeContext > conte > xt, PythonType type, PythonType owner, Dictionary`2 memberNames) > at > IronPython.Runtime.Types.PythonType.GetMemberNames(CodeContext > context, Ob > ject self) > at > IronPython.Runtime.Operations.PythonOps.GetAttrNames(CodeContext > context, > Object o) > at IronPython.Runtime.Builtin.dir(CodeContext context, Object o) > at _stub_$26##24(Closure , CallSite , CodeContext , Object , > Object ) > > at _stub_MatchCaller(Object , CallSite , Object[] ) > at > Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] > args) > at > Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallS > ite site, T0 arg0, T1 arg1, T2 arg2) > > at S$2.Initialize(CodeContext ) > at IronPython.Hosting.PythonCommandLine.RunFileWorker(String > fileName) > at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) > ValueError: 'this' type cannot be an interface itself. > > > Incidentally, even when installed with VS Pro I can't get > VSLab to work *anyway* (this is Vista 64bit FWIW), so the code > may not be ready for prime time. > > I may try firing up reflector myself and see where it takes me. > > Michael Foord > > > On Thu, Jun 26, 2008 at 2:58 PM, Michael Foord > > >> wrote: > > The viewlets that come with VSLab look *really* cool. > They're > based on F# so I decided to see if they could be used > from IronPython. > > http://www.codeplex.com/vslab > > The dependencies are pretty hefty. You need F# > installed *and* > Managed DirectX (June 2008 SDK ~450mb seems to fulfil > the dependency). > > To get at the viewlet assemblies you need Visual Studio Pro > installed as well, but they can be extracted from the > VSLabs msi > installer without VS Pro. > > Ok, so with all the dependencies installed I attempt to > use them - > and *boom*. Anyone here got any ideas? > > IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import clr > >>> clr.AddReference('vslabfsicore') > >>> clr.AddReference('vslabviewlets') > >>> clr.AddReference('vslabcore') > >>> from GraphViewlet import GraphControl > >>> g = GraphControl() > Traceback (most recent call last): > File "", line 1, in > File "vslabviewlets", line unknown, in .ctor > File "vslabfsicore", line unknown, in .ctor > File "System.Windows.Forms", line unknown, in get_Controls > File "System.Windows.Forms", line unknown, in > get_Properties > SystemError: Object reference not set to an instance of > an object. > > > Interesting that the explosion is inside winforms. > Referencing > that assembly first makes knows difference. > > Michael Foord > > > -- http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From brosembob at yahoo.com Fri Jun 27 16:51:39 2008 From: brosembob at yahoo.com (Bob Rosembob) Date: Fri, 27 Jun 2008 07:51:39 -0700 (PDT) Subject: [IronPython] Call Python function from C#... Message-ID: <422532.82270.qm@web35705.mail.mud.yahoo.com> Hi there, I apologize if this is a duplicate message. I sent this message last night but don't see it posted. Perhaps I did something wrong and message got lost. ? I need to call Python function from C# to get?a value. When?I call the script it executes and calculates some value, then I need to call some function to get the result. How do I do that? I have the following snippet of code that seems to execute the script, but I don't know and can't find on line, how to call a function and get value back. ? I added references to my project to the following dlls: - IronPython.dlll - IronMath.dll ? In the code I'm using the following: usingIronPython.Runtime;usingIronPython.Runtime.Types;usingIronPython.Runtime.Operations;usingIronPython.Hosting;using ? Here is the code: ?PythonEngineengine = newPythonEngine();EngineModulemodule = engine.CreateModule("Test", true);try{ ??? engine.ExecuteFile( } {@"Test\Test.py", module);catch(Exceptionex)??? Console.WriteLine("Failed to execute Test.py file");} ? //call the function???? ? So how do I do the call to?the function? ? Thanks for your help. Bob ???? return;IronPython.Modules; -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Fri Jun 27 17:15:45 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 27 Jun 2008 08:15:45 -0700 Subject: [IronPython] Viewlets: Any F# experts here? In-Reply-To: <4864FA9F.3030807@voidspace.org.uk> References: <4864111F.6010309@voidspace.org.uk> <4864EF14.9000306@voidspace.org.uk> <4864FA9F.3030807@voidspace.org.uk> Message-ID: The Viewlet architecture in VSLab looks very closely tied to Visual Studio. The MK_E_UNAVAILABLE error is almost certainly because Viewlet.Show is trying (and failing) to do a Marshal.GetActiveObject("VisualStudio.DTE"). On Fri, Jun 27, 2008 at 7:35 AM, Michael Foord wrote: > Curt Hagenlocher wrote: > >> Oh, duh, it hosts itself inside that ViewletProxy that was previously >> uninitialized :) >> Are you doing this with Visual Studio running? >> > > I tried hosting it in a separate form and it didn't show. I'm running > standalone under IronPython - no VS. > > Michael > > >> On Fri, Jun 27, 2008 at 6:52 AM, Curt Hagenlocher > curt at hagenlocher.org>> wrote: >> >> That "dir" error is a known problem with beta 3 -- and as you >> might imagine, sky-high in priority on our list of things to fix >> for beta 4. >> Viewlets appear to be user controls; you probably need to host one >> in a Form. >> >> On Fri, Jun 27, 2008 at 6:45 AM, Michael Foord >> > wrote: >> >> Curt Hagenlocher wrote: >> >> A bit of quality time with Reflector shows that there's a >> _viewletsProxy object which hasn't been initialized. You >> probably need to call VSLabFSICore.Viewlets.Init() first. >> It's static, and in the vslabfsicore module. >> >> >> Thanks Curt - your reflector-fu is greater than mine. I should >> spend some quality time with it. >> >> Your advice gets me to the next step, I can make a >> GraphControl flash momentarily into view (on creation), but >> attempting to show it causes another explosion: >> >> >> C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe >> -X:ExceptionDetail viewlet. >> py >> Operation unavailable (Exception from HRESULT: 0x800401E3 >> (MK_E_UNAVAILABLE)) >> at >> System.Runtime.InteropServices.Marshal.GetActiveObject(Guid& >> rclsid, IntPt >> r reserved, Object& ppunk) >> at >> System.Runtime.InteropServices.Marshal.GetActiveObject(String >> progID) >> at VSLabFSICore.Viewlet.Show() >> at GraphViewlet.GraphControl.Show() >> at _stub_$28##26(Closure , CallSite , CodeContext , Object ) >> >> at _stub_MatchCaller(Object , CallSite , Object[] ) >> at >> Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] >> args) >> at >> >> Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite >> site, T0 arg0, T1 arg1) >> at S$2.Initialize(CodeContext ) >> at IronPython.Hosting.PythonCommandLine.RunFileWorker(String >> fileName) >> at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) >> EnvironmentError: Operation unavailable (Exception from >> HRESULT: 0x800401E3 (MK_ >> E_UNAVAILABLE)) >> >> The code that produces this is: >> >> >> import clr >> clr.AddReference('vslabfsicore') >> clr.AddReference('vslabviewlets') >> >> from VSLabFSICore import Viewlets >> from GraphViewlet import GraphControl >> >> Viewlets.Init() >> g = GraphControl() >> g.Show() >> >> If instead of 'g.Show()' I attempt 'dir(g)' I get a very odd >> error! >> >> >> C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe >> -X:ExceptionDetail viewlet. >> py >> 'this' type cannot be an interface itself. >> at System.RuntimeTypeHandle.GetFirstSlotForInterface(IntPtr >> interfaceHandle) >> at System.RuntimeType.GetInterfaceMap(Type ifaceType) >> at >> >> Microsoft.Scripting.Generation.CompilerHelpers.TryGetCallableMethod(Method >> Info method) >> at >> >> Microsoft.Scripting.Generation.CompilerHelpers.FilterNonVisibleMembers(Typ >> e type, MemberInfo[] foundMembers) >> at >> IronPython.Runtime.Types.TypeInfo.MemberBinder.GetMember(Type >> type, String >> name, BindingFlags flags) >> at >> >> IronPython.Runtime.Types.TypeInfo.StandardResolver.ResolveMember(MemberBin >> der binder, DynamicAction action, Type type, String name) >> at >> >> IronPython.Runtime.Types.TypeInfo.MemberResolver.ResolveMembers(MemberBind >> er binder, DynamicAction action, Type type) >> at >> IronPython.Runtime.Types.TypeInfo.GetResolvedMembers(MemberBinder >> memberBi >> nder, DynamicAction action, Type type) >> at >> >> IronPython.Runtime.Calls.PythonBinder.ResolveMemberNames(CodeContext >> conte >> xt, PythonType type, PythonType owner, Dictionary`2 memberNames) >> at >> IronPython.Runtime.Types.PythonType.GetMemberNames(CodeContext >> context, Ob >> ject self) >> at >> IronPython.Runtime.Operations.PythonOps.GetAttrNames(CodeContext >> context, >> Object o) >> at IronPython.Runtime.Builtin.dir(CodeContext context, Object o) >> at _stub_$26##24(Closure , CallSite , CodeContext , Object , >> Object ) >> >> at _stub_MatchCaller(Object , CallSite , Object[] ) >> at >> Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] >> args) >> at >> >> Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallS >> ite site, T0 arg0, T1 arg1, T2 arg2) >> >> at S$2.Initialize(CodeContext ) >> at IronPython.Hosting.PythonCommandLine.RunFileWorker(String >> fileName) >> at IronPython.Hosting.PythonCommandLine.RunFile(String fileName) >> ValueError: 'this' type cannot be an interface itself. >> >> >> Incidentally, even when installed with VS Pro I can't get >> VSLab to work *anyway* (this is Vista 64bit FWIW), so the code >> may not be ready for prime time. >> >> I may try firing up reflector myself and see where it takes me. >> >> Michael Foord >> >> >> On Thu, Jun 26, 2008 at 2:58 PM, Michael Foord >> > >> > >> wrote: >> >> The viewlets that come with VSLab look *really* cool. >> They're >> based on F# so I decided to see if they could be used >> from IronPython. >> >> http://www.codeplex.com/vslab >> >> The dependencies are pretty hefty. You need F# >> installed *and* >> Managed DirectX (June 2008 SDK ~450mb seems to fulfil >> the dependency). >> >> To get at the viewlet assemblies you need Visual Studio Pro >> installed as well, but they can be extracted from the >> VSLabs msi >> installer without VS Pro. >> >> Ok, so with all the dependencies installed I attempt to >> use them - >> and *boom*. Anyone here got any ideas? >> >> IronPython 2.0 Beta (2.0.0.3000) on .NET 2.0.50727.1434 >> Copyright (c) Microsoft Corporation. All rights reserved. >> >>> import clr >> >>> clr.AddReference('vslabfsicore') >> >>> clr.AddReference('vslabviewlets') >> >>> clr.AddReference('vslabcore') >> >>> from GraphViewlet import GraphControl >> >>> g = GraphControl() >> Traceback (most recent call last): >> File "", line 1, in >> File "vslabviewlets", line unknown, in .ctor >> File "vslabfsicore", line unknown, in .ctor >> File "System.Windows.Forms", line unknown, in get_Controls >> File "System.Windows.Forms", line unknown, in >> get_Properties >> SystemError: Object reference not set to an instance of >> an object. >> >> >> Interesting that the explosion is inside winforms. >> Referencing >> that assembly first makes knows difference. >> >> Michael Foord >> >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 curt at hagenlocher.org Fri Jun 27 17:21:41 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 27 Jun 2008 08:21:41 -0700 Subject: [IronPython] Call Python function from C#... In-Reply-To: <422532.82270.qm@web35705.mail.mud.yahoo.com> References: <422532.82270.qm@web35705.mail.mud.yahoo.com> Message-ID: Your reference to IronMath.dll indicates that you're using IronPython 1.x. You can find a relevant hosting example at http://www.ironpython.info/index.php/Using_Python_Classes_from_.NET The hosting interface for IronPython 2 is radically different; an equivalent example can be found at http://www.ironpython.info/index.php/Hosting_IronPython_2. On Fri, Jun 27, 2008 at 7:51 AM, Bob Rosembob wrote: > Hi there, > > I apologize if this is a duplicate message. I sent this message last night > but don't see it posted. Perhaps I did something wrong and message got lost. > > > I need to call Python function from C# to get a value. When I call the > script it executes and calculates some value, then I need to call some > function to get the result. How do I do that? I have the following snippet > of code that seems to execute the script, but I don't know and can't find on > line, how to call a function and get value back. > > I added references to my project to the following dlls: > - IronPython.dlll > - IronMath.dll > > In the code I'm using the following: > > using > IronPython.Runtime; > > using > IronPython.Runtime.Types; > > using > IronPython.Runtime.Operations; > > using > IronPython.Hosting; > > using > IronPython.Modules; > > > > Here is the code: > > > > PythonEngine engine = new PythonEngine(); > > EngineModule module = engine.CreateModule("Test", true); > > try > > { > > engine.ExecuteFile( > @"Test\Test.py", module); > > } > > catch (Exception ex) > > { > > Console.WriteLine("Failed to execute Test.py file"); > > return; > > } > > > > //call the function???? > > > > So how do I do the call to the function? > > > > Thanks for your help. > > Bob > > > > > > _______________________________________________ > 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 fuzzyman at voidspace.org.uk Fri Jun 27 17:26:56 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 27 Jun 2008 16:26:56 +0100 Subject: [IronPython] Viewlets: Any F# experts here? In-Reply-To: References: <4864111F.6010309@voidspace.org.uk> <4864EF14.9000306@voidspace.org.uk> <4864FA9F.3030807@voidspace.org.uk> Message-ID: <486506C0.7050608@voidspace.org.uk> Curt Hagenlocher wrote: > The Viewlet architecture in VSLab looks very closely tied to Visual > Studio. The MK_E_UNAVAILABLE error is almost certainly because > Viewlet.Show is trying (and failing) to do a > Marshal.GetActiveObject("VisualStudio.DTE"). Ok - thanks for your help Curt. I guess using it standalone is out of the question then. At some point I would like to learn F#, so I may revisit it then - but I'll drop it for now. Michael > > On Fri, Jun 27, 2008 at 7:35 AM, Michael Foord > > wrote: > > Curt Hagenlocher wrote: > > Oh, duh, it hosts itself inside that ViewletProxy that was > previously uninitialized :) > Are you doing this with Visual Studio running? > > > I tried hosting it in a separate form and it didn't show. I'm > running standalone under IronPython - no VS. > > Michael > > > On Fri, Jun 27, 2008 at 6:52 AM, Curt Hagenlocher > > >> > wrote: > > That "dir" error is a known problem with beta 3 -- and as you > might imagine, sky-high in priority on our list of things > to fix > for beta 4. > Viewlets appear to be user controls; you probably need > to host one > in a Form. > > On Fri, Jun 27, 2008 at 6:45 AM, Michael Foord > > >> wrote: > > Curt Hagenlocher wrote: > > A bit of quality time with Reflector shows that > there's a > _viewletsProxy object which hasn't been > initialized. You > probably need to call VSLabFSICore.Viewlets.Init() > first. > It's static, and in the vslabfsicore module. > > > Thanks Curt - your reflector-fu is greater than mine. I > should > spend some quality time with it. > > Your advice gets me to the next step, I can make a > GraphControl flash momentarily into view (on creation), but > attempting to show it causes another explosion: > > > C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe > -X:ExceptionDetail viewlet. > py > Operation unavailable (Exception from HRESULT: 0x800401E3 > (MK_E_UNAVAILABLE)) > at > > System.Runtime.InteropServices.Marshal.GetActiveObject(Guid& > rclsid, IntPt > r reserved, Object& ppunk) > at > > System.Runtime.InteropServices.Marshal.GetActiveObject(String > progID) > at VSLabFSICore.Viewlet.Show() > at GraphViewlet.GraphControl.Show() > at _stub_$28##26(Closure , CallSite , CodeContext , > Object ) > > at _stub_MatchCaller(Object , CallSite , Object[] ) > at > > Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] > args) > at > > Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite > site, T0 arg0, T1 arg1) > at S$2.Initialize(CodeContext ) > at > IronPython.Hosting.PythonCommandLine.RunFileWorker(String > fileName) > at IronPython.Hosting.PythonCommandLine.RunFile(String > fileName) > EnvironmentError: Operation unavailable (Exception from > HRESULT: 0x800401E3 (MK_ > E_UNAVAILABLE)) > > The code that produces this is: > > > import clr > clr.AddReference('vslabfsicore') > clr.AddReference('vslabviewlets') > > from VSLabFSICore import Viewlets > from GraphViewlet import GraphControl > > Viewlets.Init() > g = GraphControl() > g.Show() > > If instead of 'g.Show()' I attempt 'dir(g)' I get a > very odd > error! > > > C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe > -X:ExceptionDetail viewlet. > py > 'this' type cannot be an interface itself. > at > System.RuntimeTypeHandle.GetFirstSlotForInterface(IntPtr > interfaceHandle) > at System.RuntimeType.GetInterfaceMap(Type ifaceType) > at > > Microsoft.Scripting.Generation.CompilerHelpers.TryGetCallableMethod(Method > Info method) > at > > Microsoft.Scripting.Generation.CompilerHelpers.FilterNonVisibleMembers(Typ > e type, MemberInfo[] foundMembers) > at > > IronPython.Runtime.Types.TypeInfo.MemberBinder.GetMember(Type > type, String > name, BindingFlags flags) > at > > IronPython.Runtime.Types.TypeInfo.StandardResolver.ResolveMember(MemberBin > der binder, DynamicAction action, Type type, String name) > at > > IronPython.Runtime.Types.TypeInfo.MemberResolver.ResolveMembers(MemberBind > er binder, DynamicAction action, Type type) > at > > IronPython.Runtime.Types.TypeInfo.GetResolvedMembers(MemberBinder > memberBi > nder, DynamicAction action, Type type) > at > > IronPython.Runtime.Calls.PythonBinder.ResolveMemberNames(CodeContext > conte > xt, PythonType type, PythonType owner, Dictionary`2 > memberNames) > at > > IronPython.Runtime.Types.PythonType.GetMemberNames(CodeContext > context, Ob > ject self) > at > > IronPython.Runtime.Operations.PythonOps.GetAttrNames(CodeContext > context, > Object o) > at IronPython.Runtime.Builtin.dir(CodeContext context, > Object o) > at _stub_$26##24(Closure , CallSite , CodeContext , > Object , > Object ) > > at _stub_MatchCaller(Object , CallSite , Object[] ) > at > > Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] > args) > at > > Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallS > ite site, T0 arg0, T1 arg1, T2 arg2) > > at S$2.Initialize(CodeContext ) > at > IronPython.Hosting.PythonCommandLine.RunFileWorker(String > fileName) > at IronPython.Hosting.PythonCommandLine.RunFile(String > fileName) > ValueError: 'this' type cannot be an interface itself. > > > Incidentally, even when installed with VS Pro I can't get > VSLab to work *anyway* (this is Vista 64bit FWIW), so > the code > may not be ready for prime time. > > I may try firing up reflector myself and see where it > takes me. > > Michael Foord > > > On Thu, Jun 26, 2008 at 2:58 PM, Michael Foord > > > > > >>> wrote: > > The viewlets that come with VSLab look *really* > cool. > They're > based on F# so I decided to see if they could be > used > from IronPython. > > http://www.codeplex.com/vslab > > The dependencies are pretty hefty. You need F# > installed *and* > Managed DirectX (June 2008 SDK ~450mb seems to > fulfil > the dependency). > > To get at the viewlet assemblies you need Visual > Studio Pro > installed as well, but they can be extracted > from the > VSLabs msi > installer without VS Pro. > > Ok, so with all the dependencies installed I > attempt to > use them - > and *boom*. Anyone here got any ideas? > > IronPython 2.0 Beta (2.0.0.3000) on .NET > 2.0.50727.1434 > Copyright (c) Microsoft Corporation. All rights > reserved. > >>> import clr > >>> clr.AddReference('vslabfsicore') > >>> clr.AddReference('vslabviewlets') > >>> clr.AddReference('vslabcore') > >>> from GraphViewlet import GraphControl > >>> g = GraphControl() > Traceback (most recent call last): > File "", line 1, in > File "vslabviewlets", line unknown, in .ctor > File "vslabfsicore", line unknown, in .ctor > File "System.Windows.Forms", line unknown, in > get_Controls > File "System.Windows.Forms", line unknown, in > get_Properties > SystemError: Object reference not set to an > instance of > an object. > > > Interesting that the explosion is inside winforms. > Referencing > that assembly first makes knows difference. > > Michael Foord > > > -- http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > > > > -- http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From maplab at gery.pl Fri Jun 27 17:08:11 2008 From: maplab at gery.pl (Artur Krosny) Date: Fri, 27 Jun 2008 17:08:11 +0200 Subject: [IronPython] A few DLR questions Message-ID: <4865025B.7070606@gery.pl> Hi, First of all, I am sorry if this is a wrong group, but I couldn't find a better place to ask questions about DLR. I am trying to learn how to write a simple compiler which targets DLR by analising ToyScript sources (and sometimes looking at IronRuby sources too). My idea is to use GoldParser to create a parser skeleton for my learning curve. This allows me to concentrate on a problem of generating DLR Ast, instead of spending time on creating a parser by hand. The GoldParser part was rather easy and a skeleton parser was ready quite quickly. Now I am trying to "fill it" with a generation of DLR Ast. I am trying to follow a "ToyScript way" of generating DLR Ast, adopting its Ast classes and applying required changes. However I encountered a problem with "Global varaiables". My language has a statement "PUBLIC [:=]" which declares a global var. And I fill a little bit "lost" :). I see how "Local variables" are handled in ToyScript but I have no idea how to handle globals. Anyone could point me to the right direction ? -- Artur From dinov at exchange.microsoft.com Fri Jun 27 18:37:28 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 27 Jun 2008 09:37:28 -0700 Subject: [IronPython] A few DLR questions In-Reply-To: <4865025B.7070606@gery.pl> References: <4865025B.7070606@gery.pl> Message-ID: <7AD436E4270DD54A94238001769C2227012C92C4C637@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Check out Microsoft.Scripting.Ast.Utils.Assign, Read, Delete. These all take in a SymbolId which is the name of the global and let you get/set it. These ultimately just generate calls into a helper which calls back onto your LanguageContext's LookupName, SetName, and RemoveName methods. You can either use the default implementation (which just gets/sets/deletes from the global scope) or you can override them and get your own custom globals behavior. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Artur Krosny Sent: Friday, June 27, 2008 8:08 AM To: users at lists.ironpython.com Subject: [IronPython] A few DLR questions Hi, First of all, I am sorry if this is a wrong group, but I couldn't find a better place to ask questions about DLR. I am trying to learn how to write a simple compiler which targets DLR by analising ToyScript sources (and sometimes looking at IronRuby sources too). My idea is to use GoldParser to create a parser skeleton for my learning curve. This allows me to concentrate on a problem of generating DLR Ast, instead of spending time on creating a parser by hand. The GoldParser part was rather easy and a skeleton parser was ready quite quickly. Now I am trying to "fill it" with a generation of DLR Ast. I am trying to follow a "ToyScript way" of generating DLR Ast, adopting its Ast classes and applying required changes. However I encountered a problem with "Global varaiables". My language has a statement "PUBLIC [:=]" which declares a global var. And I fill a little bit "lost" :). I see how "Local variables" are handled in ToyScript but I have no idea how to handle globals. Anyone could point me to the right direction ? -- Artur _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From falcon at uwyo.edu Fri Jun 27 18:43:39 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Fri, 27 Jun 2008 10:43:39 -0600 Subject: [IronPython] Evaluating python from within the context of a class Message-ID: I want to be able to execute arbitrary expressions but have their context be within my class. The end result is that RT test should be printed and not global test def test(): print "global test" class RT: def test(_self_): print 'RT test' def Evaluate(_self_,code): eval(code) test() a.test() a=RT() a.Evaluate('test()') Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Fri Jun 27 18:46:01 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 27 Jun 2008 17:46:01 +0100 Subject: [IronPython] Evaluating python from within the context of a class In-Reply-To: References: Message-ID: <48651949.9040907@voidspace.org.uk> Michael Stephens wrote: > I want to be able to execute arbitrary expressions but have their > context be within my class. The end result is that RT test should be > printed and not global test > > def test(): > print "global test" > > class RT: > def test(_self_): > print 'RT test' > def Evaluate(_self_,code): > eval(code) > exec code in self.__dict__ Might work. Michael > > test() > a.test() > a=RT() > a.Evaluate('test()') > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From falcon at uwyo.edu Fri Jun 27 18:55:55 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Fri, 27 Jun 2008 10:55:55 -0600 Subject: [IronPython] Evaluating python from within the context of a class In-Reply-To: <48651949.9040907@voidspace.org.uk> References: <48651949.9040907@voidspace.org.uk> Message-ID: Closer.. but self.__dict__ is empty and cannot find test. We are trying to wire up property expressions in our system. So control.Enable="GetEnabled()" rather than what we have now which is control.Enable="currentform.GetEnabled()" I thought I could eval the RHS inside the class to get what i wanted but alas no dice. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Fri, Jun 27, 2008 at 10:46 AM, Michael Foord wrote: > Michael Stephens wrote: > >> I want to be able to execute arbitrary expressions but have their context >> be within my class. The end result is that RT test should be printed and >> not global test >> >> def test(): >> print "global test" >> >> class RT: >> def test(_self_): >> print 'RT test' >> def Evaluate(_self_,code): >> eval(code) >> >> > exec code in self.__dict__ > > Might work. > > Michael > > >> test() >> a.test() >> a=RT() >> a.Evaluate('test()') >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu or 89iroc at gmail.com > 89iroc at gmail.com> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 fuzzyman at voidspace.org.uk Fri Jun 27 18:58:19 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 27 Jun 2008 17:58:19 +0100 Subject: [IronPython] Evaluating python from within the context of a class In-Reply-To: References: <48651949.9040907@voidspace.org.uk> Message-ID: <48651C2B.40002@voidspace.org.uk> Michael Stephens wrote: > Closer.. but self.__dict__ is empty and cannot find test. We are > trying to wire up property expressions in our system. So > control.Enable="GetEnabled()" rather than what we have now which is > control.Enable="currentform.GetEnabled()" > > I thought I could eval the RHS inside the class to get what i wanted > but alas no dice. > Well, you could do it in RT.__dict__ - but you would have to make test a staticmethod. Why not maintain an explicit dictionary as a context? Michael > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > > On Fri, Jun 27, 2008 at 10:46 AM, Michael Foord > > wrote: > > Michael Stephens wrote: > > I want to be able to execute arbitrary expressions but have > their context be within my class. The end result is that RT > test should be printed and not global test > > def test(): > print "global test" > > class RT: > def test(_self_): > print 'RT test' > def Evaluate(_self_,code): > eval(code) > > > exec code in self.__dict__ > > Might work. > > Michael > > > test() > a.test() > a=RT() > a.Evaluate('test()') > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu > > or > 89iroc at gmail.com > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From falcon at uwyo.edu Fri Jun 27 19:00:38 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Fri, 27 Jun 2008 11:00:38 -0600 Subject: [IronPython] Evaluating python from within the context of a class In-Reply-To: <48651C2B.40002@voidspace.org.uk> References: <48651949.9040907@voidspace.org.uk> <48651C2B.40002@voidspace.org.uk> Message-ID: I guess I can rebind locals and functions into my own dictionary.. I was just hoping to avoid that with some snazzy python. Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Fri, Jun 27, 2008 at 10:58 AM, Michael Foord wrote: > Michael Stephens wrote: > >> Closer.. but self.__dict__ is empty and cannot find test. We are trying >> to wire up property expressions in our system. So >> control.Enable="GetEnabled()" rather than what we have now which is >> control.Enable="currentform.GetEnabled()" >> >> I thought I could eval the RHS inside the class to get what i wanted but >> alas no dice. >> >> > Well, you could do it in RT.__dict__ - but you would have to make test a > staticmethod. > > Why not maintain an explicit dictionary as a context? > > Michael > > Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu or 89iroc at gmail.com > 89iroc at gmail.com> >> >> On Fri, Jun 27, 2008 at 10:46 AM, Michael Foord < >> fuzzyman at voidspace.org.uk > wrote: >> >> Michael Stephens wrote: >> >> I want to be able to execute arbitrary expressions but have >> their context be within my class. The end result is that RT >> test should be printed and not global test >> >> def test(): >> print "global test" >> >> class RT: >> def test(_self_): >> print 'RT test' >> def Evaluate(_self_,code): >> eval(code) >> >> >> exec code in self.__dict__ >> >> Might work. >> >> Michael >> >> >> test() >> a.test() >> a=RT() >> a.Evaluate('test()') >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu >> > or >> 89iroc at gmail.com >> > >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 fuzzyman at voidspace.org.uk Fri Jun 27 19:02:33 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 27 Jun 2008 18:02:33 +0100 Subject: [IronPython] Evaluating python from within the context of a class In-Reply-To: References: <48651949.9040907@voidspace.org.uk> <48651C2B.40002@voidspace.org.uk> Message-ID: <48651D29.6020902@voidspace.org.uk> Michael Stephens wrote: > I guess I can rebind locals and functions into my own dictionary.. I > was just hoping to avoid that with some snazzy python. > I think exec'ing in a custom context is *more* snazzy Python. :-p Michael > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > > On Fri, Jun 27, 2008 at 10:58 AM, Michael Foord > > wrote: > > Michael Stephens wrote: > > Closer.. but self.__dict__ is empty and cannot find test. We > are trying to wire up property expressions in our system. So > control.Enable="GetEnabled()" rather than what we have now > which is control.Enable="currentform.GetEnabled()" > > I thought I could eval the RHS inside the class to get what i > wanted but alas no dice. > > > Well, you could do it in RT.__dict__ - but you would have to make > test a staticmethod. > > Why not maintain an explicit dictionary as a context? > > Michael > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu > > or > 89iroc at gmail.com > > > > On Fri, Jun 27, 2008 at 10:46 AM, Michael Foord > > >> wrote: > > Michael Stephens wrote: > > I want to be able to execute arbitrary expressions but have > their context be within my class. The end result is > that RT > test should be printed and not global test > > def test(): > print "global test" > > class RT: > def test(_self_): > print 'RT test' > def Evaluate(_self_,code): > eval(code) > > > exec code in self.__dict__ > > Might work. > > Michael > > > test() > a.test() > a=RT() > a.Evaluate('test()') > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu > > > > >> or > > 89iroc at gmail.com > > > > >> > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > -- http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From falcon at uwyo.edu Fri Jun 27 19:05:01 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Fri, 27 Jun 2008 11:05:01 -0600 Subject: [IronPython] Evaluating python from within the context of a class In-Reply-To: <48651D29.6020902@voidspace.org.uk> References: <48651949.9040907@voidspace.org.uk> <48651C2B.40002@voidspace.org.uk> <48651D29.6020902@voidspace.org.uk> Message-ID: Is there anyway cool way you know of to generate the context at runtime def Evaluate(_self_,code) exec code in GenerateContext(a) Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Fri, Jun 27, 2008 at 11:02 AM, Michael Foord wrote: > Michael Stephens wrote: > >> I guess I can rebind locals and functions into my own dictionary.. I was >> just hoping to avoid that with some snazzy python. >> >> I think exec'ing in a custom context is *more* snazzy Python. :-p > > Michael > > Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu or 89iroc at gmail.com > 89iroc at gmail.com> >> >> On Fri, Jun 27, 2008 at 10:58 AM, Michael Foord < >> fuzzyman at voidspace.org.uk > wrote: >> >> Michael Stephens wrote: >> >> Closer.. but self.__dict__ is empty and cannot find test. We >> are trying to wire up property expressions in our system. So >> control.Enable="GetEnabled()" rather than what we have now >> which is control.Enable="currentform.GetEnabled()" >> >> I thought I could eval the RHS inside the class to get what i >> wanted but alas no dice. >> >> >> Well, you could do it in RT.__dict__ - but you would have to make >> test a staticmethod. >> >> Why not maintain an explicit dictionary as a context? >> >> Michael >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu >> > or >> 89iroc at gmail.com >> > >> >> On Fri, Jun 27, 2008 at 10:46 AM, Michael Foord >> >> > >> wrote: >> >> Michael Stephens wrote: >> >> I want to be able to execute arbitrary expressions but have >> their context be within my class. The end result is >> that RT >> test should be printed and not global test >> >> def test(): >> print "global test" >> >> class RT: >> def test(_self_): >> print 'RT test' >> def Evaluate(_self_,code): >> eval(code) >> >> >> exec code in self.__dict__ >> >> Might work. >> >> Michael >> >> >> test() >> a.test() >> a=RT() >> a.Evaluate('test()') >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu >> > >> >> >> or >> >> 89iroc at gmail.com >> > >> >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> >> > > >> >> >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 jonathan at slenders.be Fri Jun 27 19:06:12 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Fri, 27 Jun 2008 19:06:12 +0200 Subject: [IronPython] Evaluating python from within the context of a class In-Reply-To: <48651D29.6020902@voidspace.org.uk> References: <48651949.9040907@voidspace.org.uk> <48651C2B.40002@voidspace.org.uk> <48651D29.6020902@voidspace.org.uk> Message-ID: >>> class RT(object): ... def Evaluate(self, code): ... eval(code, {'test': self.test}) ... def test(self): ... print 'RT test' ... >>> RT().Evaluate('test()') RT test >>> 2008/6/27 Michael Foord : > Michael Stephens wrote: > >> I guess I can rebind locals and functions into my own dictionary.. I was >> just hoping to avoid that with some snazzy python. >> >> I think exec'ing in a custom context is *more* snazzy Python. :-p > > Michael > > Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu or 89iroc at gmail.com > 89iroc at gmail.com> >> >> On Fri, Jun 27, 2008 at 10:58 AM, Michael Foord < >> fuzzyman at voidspace.org.uk > wrote: >> >> Michael Stephens wrote: >> >> Closer.. but self.__dict__ is empty and cannot find test. We >> are trying to wire up property expressions in our system. So >> control.Enable="GetEnabled()" rather than what we have now >> which is control.Enable="currentform.GetEnabled()" >> >> I thought I could eval the RHS inside the class to get what i >> wanted but alas no dice. >> >> >> Well, you could do it in RT.__dict__ - but you would have to make >> test a staticmethod. >> >> Why not maintain an explicit dictionary as a context? >> >> Michael >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu >> > or >> 89iroc at gmail.com >> > >> >> On Fri, Jun 27, 2008 at 10:46 AM, Michael Foord >> >> > >> wrote: >> >> Michael Stephens wrote: >> >> I want to be able to execute arbitrary expressions but have >> their context be within my class. The end result is >> that RT >> test should be printed and not global test >> >> def test(): >> print "global test" >> >> class RT: >> def test(_self_): >> print 'RT test' >> def Evaluate(_self_,code): >> eval(code) >> >> >> exec code in self.__dict__ >> >> Might work. >> >> Michael >> >> >> test() >> a.test() >> a=RT() >> a.Evaluate('test()') >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu >> > >> >> >> or >> >> 89iroc at gmail.com >> > >> >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> >> > > >> >> >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 jonathan at slenders.be Fri Jun 27 19:21:23 2008 From: jonathan at slenders.be (Jonathan Slenders) Date: Fri, 27 Jun 2008 19:21:23 +0200 Subject: [IronPython] Evaluating python from within the context of a class In-Reply-To: References: <48651949.9040907@voidspace.org.uk> <48651C2B.40002@voidspace.org.uk> <48651D29.6020902@voidspace.org.uk> Message-ID: The following works. But I've no idea how to pass params to the member function. (Anyone: How can you call a function with parameters unpacked from a tuple??) But why do you actually want to do this? If the class instance is not important, just make a static method of this one. class RT(object): def Evaluate(self, code): def generateContext(): def dropself(f): def g(*p): f(self) return g context = {} for f in RT.__dict__: context[f] = dropself(RT.__dict__[f]) return context eval(code, generateContext()) def test(self): print 'RT test' RT().Evaluate('test()') 2008/6/27 Michael Stephens : > Is there anyway cool way you know of to generate the context at runtime > def Evaluate(_self_,code) > exec code in GenerateContext(a) > > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > On Fri, Jun 27, 2008 at 11:02 AM, Michael Foord > wrote: > >> Michael Stephens wrote: >> >>> I guess I can rebind locals and functions into my own dictionary.. I was >>> just hoping to avoid that with some snazzy python. >>> >>> I think exec'ing in a custom context is *more* snazzy Python. :-p >> >> Michael >> >> Michael Stephens >>> >>> Electrical Engineering Graduate Student >>> University of Wyoming >>> falcon at uwyo.edu or 89iroc at gmail.com >> 89iroc at gmail.com> >>> >>> On Fri, Jun 27, 2008 at 10:58 AM, Michael Foord < >>> fuzzyman at voidspace.org.uk > wrote: >>> >>> Michael Stephens wrote: >>> >>> Closer.. but self.__dict__ is empty and cannot find test. We >>> are trying to wire up property expressions in our system. So >>> control.Enable="GetEnabled()" rather than what we have now >>> which is control.Enable="currentform.GetEnabled()" >>> >>> I thought I could eval the RHS inside the class to get what i >>> wanted but alas no dice. >>> >>> >>> Well, you could do it in RT.__dict__ - but you would have to make >>> test a staticmethod. >>> >>> Why not maintain an explicit dictionary as a context? >>> >>> Michael >>> >>> Michael Stephens >>> >>> Electrical Engineering Graduate Student >>> University of Wyoming >>> falcon at uwyo.edu >>> > or >>> 89iroc at gmail.com >>> > >>> >>> On Fri, Jun 27, 2008 at 10:46 AM, Michael Foord >>> >>> >> >> wrote: >>> >>> Michael Stephens wrote: >>> >>> I want to be able to execute arbitrary expressions but have >>> their context be within my class. The end result is >>> that RT >>> test should be printed and not global test >>> >>> def test(): >>> print "global test" >>> >>> class RT: >>> def test(_self_): >>> print 'RT test' >>> def Evaluate(_self_,code): >>> eval(code) >>> >>> >>> exec code in self.__dict__ >>> >>> Might work. >>> >>> Michael >>> >>> >>> test() >>> a.test() >>> a=RT() >>> a.Evaluate('test()') >>> >>> Michael Stephens >>> >>> Electrical Engineering Graduate Student >>> University of Wyoming >>> falcon at uwyo.edu >>> > >>> >>> >> or >>> >>> 89iroc at gmail.com >>> > >>> >>> >> >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> >>> >> > >>> >>> >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>> >>> >>> -- http://www.ironpythoninaction.com/ >>> http://www.voidspace.org.uk/ >>> http://www.trypython.org/ >>> http://www.ironpython.info/ >>> http://www.theotherdelia.co.uk/ >>> http://www.resolverhacks.net/ >>> >>> _______________________________________________ >>> 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 >>> >>> >>> >>> -- http://www.ironpythoninaction.com/ >>> http://www.voidspace.org.uk/ >>> http://www.trypython.org/ >>> http://www.ironpython.info/ >>> http://www.theotherdelia.co.uk/ >>> http://www.resolverhacks.net/ >>> >>> _______________________________________________ >>> 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 >>> >>> >> >> >> -- >> http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 fuzzyman at voidspace.org.uk Fri Jun 27 19:26:28 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 27 Jun 2008 18:26:28 +0100 Subject: [IronPython] Evaluating python from within the context of a class In-Reply-To: References: <48651949.9040907@voidspace.org.uk> <48651C2B.40002@voidspace.org.uk> <48651D29.6020902@voidspace.org.uk> Message-ID: <486522C4.3010304@voidspace.org.uk> Jonathan Slenders wrote: > The following works. But I've no idea how to pass params to the member > function. (Anyone: How can you call a function with parameters > unpacked from a tuple??) def g(*p, *args, **kwargs): f(self, *args, **kwargs) Michael > > But why do you actually want to do this? If the class instance is not > important, just make a static method of this one. > > class RT(object): > def Evaluate(self, code): > def generateContext(): > def dropself(f): > def g(*p): > f(self) > return g > context = {} > for f in RT.__dict__: > context[f] = dropself(RT.__dict__[f]) > return context > > eval(code, generateContext()) > > def test(self): > print 'RT test' > > RT().Evaluate('test()') > > > > > > > 2008/6/27 Michael Stephens >: > > Is there anyway cool way you know of to generate the context at > runtime > def Evaluate(_self_,code) > exec code in GenerateContext(a) > > > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu or 89iroc at gmail.com > > > On Fri, Jun 27, 2008 at 11:02 AM, Michael Foord > > wrote: > > Michael Stephens wrote: > > I guess I can rebind locals and functions into my own > dictionary.. I was just hoping to avoid that with some > snazzy python. > > I think exec'ing in a custom context is *more* snazzy Python. :-p > > Michael > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu > > or > 89iroc at gmail.com > > > > On Fri, Jun 27, 2008 at 10:58 AM, Michael Foord > > >> wrote: > > Michael Stephens wrote: > > Closer.. but self.__dict__ is empty and cannot find > test. We > are trying to wire up property expressions in our > system. So > control.Enable="GetEnabled()" rather than what we > have now > which is control.Enable="currentform.GetEnabled()" > > I thought I could eval the RHS inside the class to > get what i > wanted but alas no dice. > > > Well, you could do it in RT.__dict__ - but you would > have to make > test a staticmethod. > > Why not maintain an explicit dictionary as a context? > > Michael > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu > > > > >> or > 89iroc at gmail.com > > > > >> > > On Fri, Jun 27, 2008 at 10:46 AM, Michael Foord > > > > > >>> wrote: > > Michael Stephens wrote: > > I want to be able to execute arbitrary > expressions but have > their context be within my class. The end > result is > that RT > test should be printed and not global test > > def test(): > print "global test" > > class RT: > def test(_self_): > print 'RT test' > def Evaluate(_self_,code): > eval(code) > > > exec code in self.__dict__ > > Might work. > > Michael > > > test() > a.test() > a=RT() > a.Evaluate('test()') > > Michael Stephens > > Electrical Engineering Graduate Student > University of Wyoming > falcon at uwyo.edu > > > > >> > > > > >>> or > > 89iroc at gmail.com > > > > >> > > > > >>> > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > > > > > >> > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > -- http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > > > > -- http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From falcon at uwyo.edu Fri Jun 27 19:26:33 2008 From: falcon at uwyo.edu (Michael Stephens) Date: Fri, 27 Jun 2008 11:26:33 -0600 Subject: [IronPython] Evaluating python from within the context of a class In-Reply-To: References: <48651949.9040907@voidspace.org.uk> <48651C2B.40002@voidspace.org.uk> <48651D29.6020902@voidspace.org.uk> Message-ID: Actually.. this is working now... The instance is nessessary because we need state with the object def get(obj): lst=dir(obj) mydict={'_hack':-1} for x in lst : mydict[x]=eval('obj.'+x) return mydict def test(): print "global test" class RT: def test(_self_): print 'RT test' def Evaluate(self,code): eval(code,{'test': self.test}) #works eval(code,get(self))#works too test() a.test() a=RT() a.Evaluate('test()') Michael Stephens Electrical Engineering Graduate Student University of Wyoming falcon at uwyo.edu or 89iroc at gmail.com On Fri, Jun 27, 2008 at 11:21 AM, Jonathan Slenders wrote: > The following works. But I've no idea how to pass params to the member > function. (Anyone: How can you call a function with parameters unpacked from > a tuple??) > > But why do you actually want to do this? If the class instance is not > important, just make a static method of this one. > > class RT(object): > def Evaluate(self, code): > def generateContext(): > def dropself(f): > def g(*p): > f(self) > return g > context = {} > for f in RT.__dict__: > context[f] = dropself(RT.__dict__[f]) > return context > > eval(code, generateContext()) > > def test(self): > print 'RT test' > > RT().Evaluate('test()') > > > > > > > 2008/6/27 Michael Stephens : > > Is there anyway cool way you know of to generate the context at runtime >> def Evaluate(_self_,code) >> exec code in GenerateContext(a) >> >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu or 89iroc at gmail.com >> >> On Fri, Jun 27, 2008 at 11:02 AM, Michael Foord < >> fuzzyman at voidspace.org.uk> wrote: >> >>> Michael Stephens wrote: >>> >>>> I guess I can rebind locals and functions into my own dictionary.. I was >>>> just hoping to avoid that with some snazzy python. >>>> >>>> I think exec'ing in a custom context is *more* snazzy Python. :-p >>> >>> Michael >>> >>> Michael Stephens >>>> >>>> Electrical Engineering Graduate Student >>>> University of Wyoming >>>> falcon at uwyo.edu or 89iroc at gmail.com >>> 89iroc at gmail.com> >>>> >>>> On Fri, Jun 27, 2008 at 10:58 AM, Michael Foord < >>>> fuzzyman at voidspace.org.uk > wrote: >>>> >>>> Michael Stephens wrote: >>>> >>>> Closer.. but self.__dict__ is empty and cannot find test. We >>>> are trying to wire up property expressions in our system. So >>>> control.Enable="GetEnabled()" rather than what we have now >>>> which is control.Enable="currentform.GetEnabled()" >>>> >>>> I thought I could eval the RHS inside the class to get what i >>>> wanted but alas no dice. >>>> >>>> >>>> Well, you could do it in RT.__dict__ - but you would have to make >>>> test a staticmethod. >>>> >>>> Why not maintain an explicit dictionary as a context? >>>> >>>> Michael >>>> >>>> Michael Stephens >>>> >>>> Electrical Engineering Graduate Student >>>> University of Wyoming >>>> falcon at uwyo.edu >>>> > or >>>> 89iroc at gmail.com >>>> > >>>> >>>> On Fri, Jun 27, 2008 at 10:46 AM, Michael Foord >>>> >>>> >>> >> wrote: >>>> >>>> Michael Stephens wrote: >>>> >>>> I want to be able to execute arbitrary expressions but >>>> have >>>> their context be within my class. The end result is >>>> that RT >>>> test should be printed and not global test >>>> >>>> def test(): >>>> print "global test" >>>> >>>> class RT: >>>> def test(_self_): >>>> print 'RT test' >>>> def Evaluate(_self_,code): >>>> eval(code) >>>> >>>> >>>> exec code in self.__dict__ >>>> >>>> Might work. >>>> >>>> Michael >>>> >>>> >>>> test() >>>> a.test() >>>> a=RT() >>>> a.Evaluate('test()') >>>> >>>> Michael Stephens >>>> >>>> Electrical Engineering Graduate Student >>>> University of Wyoming >>>> falcon at uwyo.edu >>>> > >>>> >>>> >> or >>>> >>>> 89iroc at gmail.com >>>> > >>>> >>>> >> >>>> >>>> ------------------------------------------------------------------------ >>>> >>>> _______________________________________________ >>>> Users mailing list >>>> Users at lists.ironpython.com >>>> >>>> >>> > >>>> >>>> >>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >>>> >>>> >>>> -- http://www.ironpythoninaction.com/ >>>> http://www.voidspace.org.uk/ >>>> http://www.trypython.org/ >>>> http://www.ironpython.info/ >>>> http://www.theotherdelia.co.uk/ >>>> http://www.resolverhacks.net/ >>>> >>>> _______________________________________________ >>>> 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 >>>> >>>> >>>> >>>> -- http://www.ironpythoninaction.com/ >>>> http://www.voidspace.org.uk/ >>>> http://www.trypython.org/ >>>> http://www.ironpython.info/ >>>> http://www.theotherdelia.co.uk/ >>>> http://www.resolverhacks.net/ >>>> >>>> _______________________________________________ >>>> 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 >>>> >>>> >>> >>> >>> -- >>> http://www.ironpythoninaction.com/ >>> http://www.voidspace.org.uk/ >>> http://www.trypython.org/ >>> http://www.ironpython.info/ >>> http://www.theotherdelia.co.uk/ >>> http://www.resolverhacks.net/ >>> >>> _______________________________________________ >>> 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 fuzzyman at voidspace.org.uk Fri Jun 27 19:29:05 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 27 Jun 2008 18:29:05 +0100 Subject: [IronPython] Evaluating python from within the context of a class In-Reply-To: <486522C4.3010304@voidspace.org.uk> References: <48651949.9040907@voidspace.org.uk> <48651C2B.40002@voidspace.org.uk> <48651D29.6020902@voidspace.org.uk> <486522C4.3010304@voidspace.org.uk> Message-ID: <48652361.2050204@voidspace.org.uk> Michael Foord wrote: > Jonathan Slenders wrote: >> The following works. But I've no idea how to pass params to the >> member function. (Anyone: How can you call a function with parameters >> unpacked from a tuple??) > > def g(*p, *args, **kwargs): > f(self, *args, **kwargs) Oops. def g(*args, **kwargs): f(self, *args, **kwargs) Sorry. Michael > > Michael >> >> But why do you actually want to do this? If the class instance is not >> important, just make a static method of this one. >> >> class RT(object): >> def Evaluate(self, code): >> def generateContext(): >> def dropself(f): >> def g(*p): >> f(self) >> return g >> context = {} >> for f in RT.__dict__: >> context[f] = dropself(RT.__dict__[f]) >> return context >> >> eval(code, generateContext()) >> >> def test(self): >> print 'RT test' >> >> RT().Evaluate('test()') >> >> >> >> >> >> >> 2008/6/27 Michael Stephens >: >> >> Is there anyway cool way you know of to generate the context at >> runtime >> def Evaluate(_self_,code) >> exec code in GenerateContext(a) >> >> >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu or 89iroc at gmail.com >> >> >> On Fri, Jun 27, 2008 at 11:02 AM, Michael Foord >> > >> wrote: >> >> Michael Stephens wrote: >> >> I guess I can rebind locals and functions into my own >> dictionary.. I was just hoping to avoid that with some >> snazzy python. >> >> I think exec'ing in a custom context is *more* snazzy Python. >> :-p >> >> Michael >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu >> > or >> 89iroc at gmail.com >> > >> >> On Fri, Jun 27, 2008 at 10:58 AM, Michael Foord >> > >> > >> wrote: >> >> Michael Stephens wrote: >> >> Closer.. but self.__dict__ is empty and cannot find >> test. We >> are trying to wire up property expressions in our >> system. So >> control.Enable="GetEnabled()" rather than what we >> have now >> which is control.Enable="currentform.GetEnabled()" >> >> I thought I could eval the RHS inside the class to >> get what i >> wanted but alas no dice. >> >> >> Well, you could do it in RT.__dict__ - but you would >> have to make >> test a staticmethod. >> >> Why not maintain an explicit dictionary as a context? >> >> Michael >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu >> > >> >> >> or >> 89iroc at gmail.com >> > >> >> >> >> >> On Fri, Jun 27, 2008 at 10:46 AM, Michael Foord >> > >> > > >> > >> > >>> wrote: >> >> Michael Stephens wrote: >> >> I want to be able to execute arbitrary >> expressions but have >> their context be within my class. The end >> result is >> that RT >> test should be printed and not global test >> >> def test(): >> print "global test" >> >> class RT: >> def test(_self_): >> print 'RT test' >> def Evaluate(_self_,code): >> eval(code) >> >> >> exec code in self.__dict__ >> >> Might work. >> >> Michael >> >> >> test() >> a.test() >> a=RT() >> a.Evaluate('test()') >> >> Michael Stephens >> >> Electrical Engineering Graduate Student >> University of Wyoming >> falcon at uwyo.edu >> > >> >> >> >> > > > >> >> >>> or >> >> 89iroc at gmail.com >> > >> >> >> >> > > > >> >> >>> >> >> ------------------------------------------------------------------------ >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> >> > > >> > >> > >> >> >> >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> >> >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.theotherdelia.co.uk/ >> http://www.resolverhacks.net/ >> >> _______________________________________________ >> 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 >> > > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From asgeir at dcc.is Sat Jun 28 11:29:11 2008 From: asgeir at dcc.is (=?UTF-8?B?w4FzZ2VpciBIYWxsZMOzcnNzb24=?=) Date: Sat, 28 Jun 2008 11:29:11 +0200 Subject: [IronPython] Thread safety with Stdout Message-ID: <48660467.5020506@dcc.is> Hi, I was wondering about one thing I am using this code in many threads. And it does not look like the Stdout is thread safe. Is there something I can do about it? ScriptEngine eng = IronPython.Hosting.PythonEngine.CurrentEngine; ScriptSource source = eng.CreateScriptSourceFromString(codeStr, Microsoft.Scripting.SourceCodeKind.Statements); code = source.Compile(); ScriptScope scope = eng.CreateScope(); MemoryStream ms = new MemoryStream(); scope.Engine.Runtime.IO.SetOutput(ms, Encoding.UTF8); code.Execute(scope); -- Regards, ?sgeir Halld?rsson From curt at hagenlocher.org Sat Jun 28 14:46:13 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Sat, 28 Jun 2008 05:46:13 -0700 Subject: [IronPython] Thread safety with Stdout In-Reply-To: <48660467.5020506@dcc.is> References: <48660467.5020506@dcc.is> Message-ID: This is a known problem and already filed in CodePlex as http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=16623. You might be able to guard the stream yourself using locks created through the thread or threading modules. Relevant documentation can be found at http://docs.python.org/lib/module-thread.html and http://docs.python.org/lib/module-threading.html. Only two votes so far, but I think we'd probably want to fix this for 2.0 final. On Sat, Jun 28, 2008 at 2:29 AM, ?sgeir Halld?rsson wrote: > Hi, > > I was wondering about one thing I am using this code in many > threads. And it does not look like the Stdout is thread safe. Is there > something I can do about it? > > ScriptEngine eng = IronPython.Hosting.PythonEngine.CurrentEngine; > ScriptSource source = eng.CreateScriptSourceFromString(codeStr, > Microsoft.Scripting.SourceCodeKind.Statements); > code = source.Compile(); > > ScriptScope scope = eng.CreateScope(); > > MemoryStream ms = new MemoryStream(); > scope.Engine.Runtime.IO.SetOutput(ms, Encoding.UTF8); > code.Execute(scope); > > -- > > Regards, > ?sgeir Halld?rsson > > > > _______________________________________________ > 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 empirebuilder at gmail.com Sat Jun 28 16:05:01 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Sat, 28 Jun 2008 17:05:01 +0300 Subject: [IronPython] Call Python function from C#... In-Reply-To: <422532.82270.qm@web35705.mail.mud.yahoo.com> References: <422532.82270.qm@web35705.mail.mud.yahoo.com> Message-ID: <8cd017b80806280705g2c29389byeb8d0e1791904ed9@mail.gmail.com> Hi Bob, This blog post shall answer all your questions http://spellcoder.com/blogs/dodyg/archive/2008/04/15/12273.aspx Dody G. On Fri, Jun 27, 2008 at 5:51 PM, Bob Rosembob wrote: > Hi there, > > I apologize if this is a duplicate message. I sent this message last night > but don't see it posted. Perhaps I did something wrong and message got lost. > > > I need to call Python function from C# to get a value. When I call the > script it executes and calculates some value, then I need to call some > function to get the result. How do I do that? I have the following snippet > of code that seems to execute the script, but I don't know and can't find on > line, how to call a function and get value back. > > I added references to my project to the following dlls: > - IronPython.dlll > - IronMath.dll > > In the code I'm using the following: > > using > IronPython.Runtime; > > using > IronPython.Runtime.Types; > > using > IronPython.Runtime.Operations; > > using > IronPython.Hosting; > > using > IronPython.Modules; > > > > Here is the code: > > > > PythonEngine engine = new PythonEngine(); > > EngineModule module = engine.CreateModule("Test", true); > > try > > { > > engine.ExecuteFile( > @"Test\Test.py", module); > > } > > catch (Exception ex) > > { > > Console.WriteLine("Failed to execute Test.py file"); > > return; > > } > > > > //call the function???? > > > > So how do I do the call to the function? > > > > Thanks for your help. > > Bob > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From seshapv at microsoft.com Sat Jun 28 19:21:49 2008 From: seshapv at microsoft.com (Seshadri Pillailokam Vijayaraghavan) Date: Sat, 28 Jun 2008 10:21:49 -0700 Subject: [IronPython] Call Python function from C#... In-Reply-To: <8cd017b80806280705g2c29389byeb8d0e1791904ed9@mail.gmail.com> References: <422532.82270.qm@web35705.mail.mud.yahoo.com> <8cd017b80806280705g2c29389byeb8d0e1791904ed9@mail.gmail.com> Message-ID: <4F06AAB8EC03C349A5D6D0A797C4881C40B56EC59F@NA-EXMSG-C112.redmond.corp.microsoft.com> Here's another simple code snippet that'd let you do the same... using System; using Microsoft.Scripting.Hosting; using System.Scripting; namespace ConsoleApplication1 { class Program { public static void Main(string[] args) { ScriptEngine pyEng = ScriptRuntime.Create().GetEngine("py"); string testSrc = @" class FooClass: 'A simple test class' def f(self):return 'Hello World' fooTest = FooClass() def bar(): return fooTest.f();"; // load script with bar() function def ScriptSource source = pyEng.CreateScriptSourceFromString(testSrc, SourceCodeKind.Statements); // Create scope ScriptScope scope = pyEng.CreateScope(); source.Execute(scope); object fooTest = scope.GetVariable("fooTest"); Func sayHello = pyEng.Operations.GetMember>(fooTest, "f"); // Now call fooTest's object member function 'f' string result = sayHello(); } } } From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dody Gunawinata Sent: Saturday, June 28, 2008 7:05 AM To: Discussion of IronPython Subject: Re: [IronPython] Call Python function from C#... Hi Bob, This blog post shall answer all your questions http://spellcoder.com/blogs/dodyg/archive/2008/04/15/12273.aspx Dody G. On Fri, Jun 27, 2008 at 5:51 PM, Bob Rosembob > wrote: Hi there, I apologize if this is a duplicate message. I sent this message last night but don't see it posted. Perhaps I did something wrong and message got lost. I need to call Python function from C# to get a value. When I call the script it executes and calculates some value, then I need to call some function to get the result. How do I do that? I have the following snippet of code that seems to execute the script, but I don't know and can't find on line, how to call a function and get value back. I added references to my project to the following dlls: - IronPython.dlll - IronMath.dll In the code I'm using the following: using IronPython.Runtime; using IronPython.Runtime.Types; using IronPython.Runtime.Operations; using IronPython.Hosting; using IronPython.Modules; Here is the code: PythonEngine engine = new PythonEngine(); EngineModule module = engine.CreateModule("Test", true); try { engine.ExecuteFile( @"Test\Test.py", module); } catch (Exception ex) { Console.WriteLine("Failed to execute Test.py file"); return; } //call the function???? So how do I do the call to the function? Thanks for your help. Bob _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From dan.eloff at gmail.com Sun Jun 29 04:51:12 2008 From: dan.eloff at gmail.com (Dan Eloff) Date: Sat, 28 Jun 2008 21:51:12 -0500 Subject: [IronPython] Is there a way to see CLR tracebacks? Message-ID: <4817b6fc0806281951x6054cd5ewa72dc7505bee06cf@mail.gmail.com> I notice that tracebacks show only the IronPython stack trace. Is there any way to see the CLR stack trace (as well?) if the error occurred in a call to a CLR assembly? -Dan From curt at hagenlocher.org Sun Jun 29 05:04:38 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Sat, 28 Jun 2008 20:04:38 -0700 Subject: [IronPython] Is there a way to see CLR tracebacks? In-Reply-To: <4817b6fc0806281951x6054cd5ewa72dc7505bee06cf@mail.gmail.com> References: <4817b6fc0806281951x6054cd5ewa72dc7505bee06cf@mail.gmail.com> Message-ID: Launch ipy.exe with the flag -X:ShowClrExceptions. On Sat, Jun 28, 2008 at 7:51 PM, Dan Eloff wrote: > I notice that tracebacks show only the IronPython stack trace. Is > there any way to see the CLR stack trace (as well?) if the error > occurred in a call to a CLR assembly? > > -Dan > _______________________________________________ > 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 fuzzyman at voidspace.org.uk Sun Jun 29 17:11:09 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 29 Jun 2008 16:11:09 +0100 Subject: [IronPython] Viewlets: Any F# experts here? In-Reply-To: <127fcd49-c6f5-4df2-b4ce-661b739bad35@25g2000hsx.googlegroups.com> References: <4864111F.6010309@voidspace.org.uk> <4864EF14.9000306@voidspace.org.uk> <4864FA9F.3030807@voidspace.org.uk> <486506C0.7050608@voidspace.org.uk> <127fcd49-c6f5-4df2-b4ce-661b739bad35@25g2000hsx.googlegroups.com> Message-ID: <4867A60D.2090100@voidspace.org.uk> Ok Chip - thanks for getting in touch. (I've cc'ed the list as it is a 'subscribers only' mailing list). I'll check out the source for VSLab and have another play. Thanks Michael Chip wrote: > Michael, > > I posted twice to this thread but posts are not shown in the thread. I > mail my post to you: > > Note: since I've posted but I don't see my reply I post again, sorry > if it is (almost) a duplicate > > Hi I am Antonio Cisternino, author of VSLab, > > Viewlets have been designed to be as close as possible to WinForms > UserControls, the Viewlet class inherit from control and simply > implements the communication with Visual Studio. In the roadmap we > think to let Viewlets to be used standalone, but for the moment I > would simply open the VSLabViewlets project and change the base class > from Viewlet to UserControl. Few more changes will be required. On the > Web site you'll find a few whitepapers describing Viewlets and VSLab > architecture, is less tied to VS than you would think. > > -- Ciao, > -- Antonio > > > On Jun 27, 5:26 pm, Michael Foord wrote: > >> Curt Hagenlocher wrote: >> >>> The Viewlet architecture in VSLab looks very closely tied to Visual >>> Studio. The MK_E_UNAVAILABLE error is almost certainly because >>> Viewlet.Show is trying (and failing) to do a >>> Marshal.GetActiveObject("VisualStudio.DTE"). >>> >> Ok - thanks for your help Curt. I guess using it standalone is out of >> the question then. >> >> At some point I would like to learn F#, so I may revisit it then - but >> I'll drop it for now. >> >> Michael >> >> >> >> >> >> >>> On Fri, Jun 27, 2008 at 7:35 AM, Michael Foord >>> > wrote: >>> >>> Curt Hagenlocher wrote: >>> >>> Oh, duh, it hosts itself inside that ViewletProxy that was >>> previously uninitialized :) >>> Are you doing this with Visual Studio running? >>> >>> I tried hosting it in a separate form and it didn't show. I'm >>> running standalone under IronPython - no VS. >>> >>> Michael >>> >>> On Fri, Jun 27, 2008 at 6:52 AM, Curt Hagenlocher >>> >>> >> >>> wrote: >>> >>> That "dir" error is a known problem with beta 3 -- and as you >>> might imagine, sky-high in priority on our list of things >>> to fix >>> for beta 4. >>> Viewlets appear to be user controls; you probably need >>> to host one >>> in a Form. >>> >>> On Fri, Jun 27, 2008 at 6:45 AM, Michael Foord >>> >> >>> >> >> wrote: >>> >>> Curt Hagenlocher wrote: >>> >>> A bit of quality time with Reflector shows that >>> there's a >>> _viewletsProxy object which hasn't been >>> initialized. You >>> probably need to call VSLabFSICore.Viewlets.Init() >>> first. >>> It's static, and in the vslabfsicore module. >>> >>> Thanks Curt - your reflector-fu is greater than mine. I >>> should >>> spend some quality time with it. >>> >>> Your advice gets me to the next step, I can make a >>> GraphControl flash momentarily into view (on creation), but >>> attempting to show it causes another explosion: >>> >>> C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe >>> -X:ExceptionDetail viewlet. >>> py >>> Operation unavailable (Exception from HRESULT: 0x800401E3 >>> (MK_E_UNAVAILABLE)) >>> at >>> >>> System.Runtime.InteropServices.Marshal.GetActiveObject(Guid& >>> rclsid, IntPt >>> r reserved, Object& ppunk) >>> at >>> >>> System.Runtime.InteropServices.Marshal.GetActiveObject(String >>> progID) >>> at VSLabFSICore.Viewlet.Show() >>> at GraphViewlet.GraphControl.Show() >>> at _stub_$28##26(Closure , CallSite , CodeContext , >>> Object ) >>> >>> at _stub_MatchCaller(Object , CallSite , Object[] ) >>> at >>> >>> Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] >>> args) >>> at >>> >>> Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallSite >>> site, T0 arg0, T1 arg1) >>> at S$2.Initialize(CodeContext ) >>> at >>> IronPython.Hosting.PythonCommandLine.RunFileWorker(String >>> fileName) >>> at IronPython.Hosting.PythonCommandLine.RunFile(String >>> fileName) >>> EnvironmentError: Operation unavailable (Exception from >>> HRESULT: 0x800401E3 (MK_ >>> E_UNAVAILABLE)) >>> >>> The code that produces this is: >>> >>> import clr >>> clr.AddReference('vslabfsicore') >>> clr.AddReference('vslabviewlets') >>> >>> from VSLabFSICore import Viewlets >>> from GraphViewlet import GraphControl >>> >>> Viewlets.Init() >>> g = GraphControl() >>> g.Show() >>> >>> If instead of 'g.Show()' I attempt 'dir(g)' I get a >>> very odd >>> error! >>> >>> C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe >>> -X:ExceptionDetail viewlet. >>> py >>> 'this' type cannot be an interface itself. >>> at >>> System.RuntimeTypeHandle.GetFirstSlotForInterface(IntPtr >>> interfaceHandle) >>> at System.RuntimeType.GetInterfaceMap(Type ifaceType) >>> at >>> >>> Microsoft.Scripting.Generation.CompilerHelpers.TryGetCallableMethod(Method >>> Info method) >>> at >>> >>> Microsoft.Scripting.Generation.CompilerHelpers.FilterNonVisibleMembers(Typ >>> e type, MemberInfo[] foundMembers) >>> at >>> >>> IronPython.Runtime.Types.TypeInfo.MemberBinder.GetMember(Type >>> type, String >>> name, BindingFlags flags) >>> at >>> >>> IronPython.Runtime.Types.TypeInfo.StandardResolver.ResolveMember(MemberBin >>> der binder, DynamicAction action, Type type, String name) >>> at >>> >>> IronPython.Runtime.Types.TypeInfo.MemberResolver.ResolveMembers(MemberBind >>> er binder, DynamicAction action, Type type) >>> at >>> >>> IronPython.Runtime.Types.TypeInfo.GetResolvedMembers(MemberBinder >>> memberBi >>> nder, DynamicAction action, Type type) >>> at >>> >>> IronPython.Runtime.Calls.PythonBinder.ResolveMemberNames(CodeContext >>> conte >>> xt, PythonType type, PythonType owner, Dictionary`2 >>> memberNames) >>> at >>> >>> IronPython.Runtime.Types.PythonType.GetMemberNames(CodeContext >>> context, Ob >>> ject self) >>> at >>> >>> IronPython.Runtime.Operations.PythonOps.GetAttrNames(CodeContext >>> context, >>> Object o) >>> at IronPython.Runtime.Builtin.dir(CodeContext context, >>> Object o) >>> at _stub_$26##24(Closure , CallSite , CodeContext , >>> Object , >>> Object ) >>> >>> at _stub_MatchCaller(Object , CallSite , Object[] ) >>> at >>> >>> Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] >>> args) >>> at >>> >>> Microsoft.Scripting.Actions.UpdateDelegates.Update3[T,T0,T1,T2,TRet](CallS >>> ite site, T0 arg0, T1 arg1, T2 arg2) >>> >>> at S$2.Initialize(CodeContext ) >>> at >>> IronPython.Hosting.PythonCommandLine.RunFileWorker(String >>> fileName) >>> at IronPython.Hosting.PythonCommandLine.RunFile(String >>> fileName) >>> ValueError: 'this' type cannot be an interface itself. >>> >>> Incidentally, even when installed with VS Pro I can't get >>> VSLab to work *anyway* (this is Vista 64bit FWIW), so >>> the code >>> may not be ready for prime time. >>> >>> I may try firing up reflector myself and see where it >>> takes me. >>> >>> Michael Foord >>> >>> On Thu, Jun 26, 2008 at 2:58 PM, Michael Foord >>> >> >>> >> > >>> >> >>> >> >>> wrote: >>> >>> The viewlets that come with VSLab look *really* >>> cool. >>> They're >>> based on F# so I decided to see if they could be >>> used >>> from IronPython. >>> >>> http://www.codeplex.com/vslab >>> >>> The dependencies are pretty hefty. You need F# >>> installed *and* >>> Managed DirectX (June 2008 SDK ~450mb seems to >>> fulfil >>> the dependency). >>> >>> To get at the viewlet assemblies you need Visual >>> Studio Pro >>> installed as well, but they can be extracted >>> from the >>> VSLabs msi >>> installer without VS Pro. >>> >>> Ok, so with all the dependencies installed I >>> attempt to >>> use them - >>> and *boom*. Anyone here got any ideas? >>> >>> IronPython 2.0 Beta (2.0.0.3000) on .NET >>> 2.0.50727.1434 >>> Copyright (c) Microsoft Corporation. All rights >>> reserved. >>> >>> import clr >>> >>> clr.AddReference('vslabfsicore') >>> >>> clr.AddReference('vslabviewlets') >>> >>> clr.AddReference('vslabcore') >>> >>> from GraphViewlet import GraphControl >>> >>> g = GraphControl() >>> Traceback (most recent call last): >>> File "", line 1, in >>> File "vslabviewlets", line unknown, in .ctor >>> File "vslabfsicore",- Hide quoted text - >>> >> - Show quoted text -... >> >> read more ? >> -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From ben2004uk at googlemail.com Sun Jun 29 23:06:34 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Sun, 29 Jun 2008 22:06:34 +0100 Subject: [IronPython] ToyScript - Parses code twice? Message-ID: Hello, I was just looking at ToyScript and how it generates the DLR Trees, and i've found that ParseSourceCode is called twice for a single line of code (in this case print "a" + "b"). I was just wondering is the DLR parsing the source code twice? It seems quite inaffective but i'm sure you have a reason. I would have thought you would only need to generate the DLR Tree once. If you could let me know why this is the case, that would be great. Thanks Ben From r.worbis at cubido.at Mon Jun 30 13:44:00 2008 From: r.worbis at cubido.at (Rainer Worbis) Date: Mon, 30 Jun 2008 13:44:00 +0200 Subject: [IronPython] restrict scripting access Message-ID: <676F9CCC1D1D3242BE4B133746E3807E49B178@XARA.cubido.linz> Hallo, is there a way to restrict access to objects or namespaces within a script? We use IronPython for providing scripting functionality within our .NET Application but would like to restrict access to certain functions. Has anybody information or a sample how to do that? Thanks, Rainer Worbis -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists.ironpython.com at ka.weltenschmiede.com Mon Jun 30 13:47:05 2008 From: lists.ironpython.com at ka.weltenschmiede.com (Korbinian Abenthum) Date: Mon, 30 Jun 2008 13:47:05 +0200 Subject: [IronPython] restrict scripting access References: <676F9CCC1D1D3242BE4B133746E3807E49B178@XARA.cubido.linz> Message-ID: <0e3301c8daa7_04beb5e0_14b2a8c0@lannisport> Rainer Worbis wrote: > is there a way to restrict access to objects or namespaces > within a script? We use IronPython for providing scripting > functionality within our .NET Application but would like to > restrict access to certain functions. Has anybody information > or a sample how to do that? Can you declare the restricted objects as "internal"? Cheers, Korbinian From r.worbis at cubido.at Mon Jun 30 13:57:05 2008 From: r.worbis at cubido.at (Rainer Worbis) Date: Mon, 30 Jun 2008 13:57:05 +0200 Subject: [IronPython] restrict scripting access In-Reply-To: <0e3301c8daa7_04beb5e0_14b2a8c0@lannisport> References: <676F9CCC1D1D3242BE4B133746E3807E49B178@XARA.cubido.linz> <0e3301c8daa7_04beb5e0_14b2a8c0@lannisport> Message-ID: <676F9CCC1D1D3242BE4B133746E3807E49B17A@XARA.cubido.linz> No - for example i would like to prevent that the user loads assemblies and does own data access via System.Data.SqlClient. Or uses specific parts of the applications. (which should be visible to other scripts). So access control per script would be optimal. Rainer -----Urspr?ngliche Nachricht----- Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Korbinian Abenthum Gesendet: Montag, 30. Juni 2008 13:47 An: Discussion of IronPython Betreff: Re: [IronPython] restrict scripting access Rainer Worbis wrote: > is there a way to restrict access to objects or namespaces > within a script? We use IronPython for providing scripting > functionality within our .NET Application but would like to > restrict access to certain functions. Has anybody information > or a sample how to do that? Can you declare the restricted objects as "internal"? Cheers, Korbinian _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ben2004uk at googlemail.com Mon Jun 30 14:09:24 2008 From: ben2004uk at googlemail.com (Ben Hall) Date: Mon, 30 Jun 2008 13:09:24 +0100 Subject: [IronPython] restrict scripting access In-Reply-To: <676F9CCC1D1D3242BE4B133746E3807E49B17A@XARA.cubido.linz> References: <676F9CCC1D1D3242BE4B133746E3807E49B178@XARA.cubido.linz> <0e3301c8daa7_04beb5e0_14b2a8c0@lannisport> <676F9CCC1D1D3242BE4B133746E3807E49B17A@XARA.cubido.linz> Message-ID: I thought this last night, it would be really useful if we could 'sandbox' the IP engine and limit it's access to certain areas of the framework. On Mon, Jun 30, 2008 at 12:57 PM, Rainer Worbis wrote: > No - for example i would like to prevent that the user loads assemblies and does own data access via System.Data.SqlClient. > Or uses specific parts of the applications. (which should be visible to other scripts). So access control per script would be optimal. > > Rainer > > -----Urspr?ngliche Nachricht----- > Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Korbinian Abenthum > Gesendet: Montag, 30. Juni 2008 13:47 > An: Discussion of IronPython > Betreff: Re: [IronPython] restrict scripting access > > Rainer Worbis wrote: >> is there a way to restrict access to objects or namespaces >> within a script? We use IronPython for providing scripting >> functionality within our .NET Application but would like to >> restrict access to certain functions. Has anybody information >> or a sample how to do that? > > Can you declare the restricted objects as "internal"? > > Cheers, > Korbinian > _______________________________________________ > 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 empirebuilder at gmail.com Mon Jun 30 14:24:43 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Mon, 30 Jun 2008 15:24:43 +0300 Subject: [IronPython] restrict scripting access In-Reply-To: References: <676F9CCC1D1D3242BE4B133746E3807E49B178@XARA.cubido.linz> <0e3301c8daa7_04beb5e0_14b2a8c0@lannisport> <676F9CCC1D1D3242BE4B133746E3807E49B17A@XARA.cubido.linz> Message-ID: <8cd017b80806300524w53ae3689mfd59c2788de16b79@mail.gmail.com> In the IronPython hosting API, unless you specifically load the assembly, it will not be accessible through the script. So right now restricting access means configuring the assemblies you want to expose to the script. On Mon, Jun 30, 2008 at 3:09 PM, Ben Hall wrote: > I thought this last night, it would be really useful if we could > 'sandbox' the IP engine and limit it's access to certain areas of the > framework. > > > > On Mon, Jun 30, 2008 at 12:57 PM, Rainer Worbis > wrote: > > No - for example i would like to prevent that the user loads assemblies > and does own data access via System.Data.SqlClient. > > Or uses specific parts of the applications. (which should be visible to > other scripts). So access control per script would be optimal. > > > > Rainer > > > > -----Urspr?ngliche Nachricht----- > > Von: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] Im Auftrag von Korbinian Abenthum > > Gesendet: Montag, 30. Juni 2008 13:47 > > An: Discussion of IronPython > > Betreff: Re: [IronPython] restrict scripting access > > > > Rainer Worbis wrote: > >> is there a way to restrict access to objects or namespaces > >> within a script? We use IronPython for providing scripting > >> functionality within our .NET Application but would like to > >> restrict access to certain functions. Has anybody information > >> or a sample how to do that? > > > > Can you declare the restricted objects as "internal"? > > > > Cheers, > > Korbinian > > _______________________________________________ > > 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 > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Jun 30 14:26:35 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 30 Jun 2008 13:26:35 +0100 Subject: [IronPython] restrict scripting access In-Reply-To: <8cd017b80806300524w53ae3689mfd59c2788de16b79@mail.gmail.com> References: <676F9CCC1D1D3242BE4B133746E3807E49B178@XARA.cubido.linz> <0e3301c8daa7_04beb5e0_14b2a8c0@lannisport> <676F9CCC1D1D3242BE4B133746E3807E49B17A@XARA.cubido.linz> <8cd017b80806300524w53ae3689mfd59c2788de16b79@mail.gmail.com> Message-ID: <4868D0FB.8060600@voidspace.org.uk> Dody Gunawinata wrote: > In the IronPython hosting API, unless you specifically load the > assembly, it will not be accessible through the script. So right now > restricting access means configuring the assemblies you want to expose > to the script. > But what is to stop the user code doing: import clr clr.AddReference('SomeAssembly') Loading the ScriptRuntime into an AppDomain and restricting the privileges on that is one way - but I don't think that IronPython will work at all unless the AppDomain has pretty much full trust. Michael Foord > On Mon, Jun 30, 2008 at 3:09 PM, Ben Hall > wrote: > > I thought this last night, it would be really useful if we could > 'sandbox' the IP engine and limit it's access to certain areas of the > framework. > > > > On Mon, Jun 30, 2008 at 12:57 PM, Rainer Worbis > > wrote: > > No - for example i would like to prevent that the user loads > assemblies and does own data access via System.Data.SqlClient. > > Or uses specific parts of the applications. (which should be > visible to other scripts). So access control per script would be > optimal. > > > > Rainer > > > > -----Urspr?ngliche Nachricht----- > > Von: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] Im Auftrag von > Korbinian Abenthum > > Gesendet: Montag, 30. Juni 2008 13:47 > > An: Discussion of IronPython > > Betreff: Re: [IronPython] restrict scripting access > > > > Rainer Worbis wrote: > >> is there a way to restrict access to objects or namespaces > >> within a script? We use IronPython for providing scripting > >> functionality within our .NET Application but would like to > >> restrict access to certain functions. Has anybody information > >> or a sample how to do that? > > > > Can you declare the restricted objects as "internal"? > > > > Cheers, > > Korbinian > > _______________________________________________ > > 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 > > > > > -- > nomadlife.org > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ From r.worbis at cubido.at Mon Jun 30 14:28:10 2008 From: r.worbis at cubido.at (Rainer Worbis) Date: Mon, 30 Jun 2008 14:28:10 +0200 Subject: [IronPython] restrict scripting access In-Reply-To: <8cd017b80806300524w53ae3689mfd59c2788de16b79@mail.gmail.com> References: <676F9CCC1D1D3242BE4B133746E3807E49B178@XARA.cubido.linz><0e3301c8daa7_04beb5e0_14b2a8c0@lannisport><676F9CCC1D1D3242BE4B133746E3807E49B17A@XARA.cubido.linz> <8cd017b80806300524w53ae3689mfd59c2788de16b79@mail.gmail.com> Message-ID: <676F9CCC1D1D3242BE4B133746E3807E49B17E@XARA.cubido.linz> But i can't restrict the user from adding any assemblies he want (since the assemblies are in the project or gac) Rainer Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Dody Gunawinata Gesendet: Montag, 30. Juni 2008 14:25 An: Discussion of IronPython Betreff: Re: [IronPython] restrict scripting access In the IronPython hosting API, unless you specifically load the assembly, it will not be accessible through the script. So right now restricting access means configuring the assemblies you want to expose to the script. On Mon, Jun 30, 2008 at 3:09 PM, Ben Hall wrote: I thought this last night, it would be really useful if we could 'sandbox' the IP engine and limit it's access to certain areas of the framework. On Mon, Jun 30, 2008 at 12:57 PM, Rainer Worbis wrote: > No - for example i would like to prevent that the user loads assemblies and does own data access via System.Data.SqlClient. > Or uses specific parts of the applications. (which should be visible to other scripts). So access control per script would be optimal. > > Rainer > > -----Urspr?ngliche Nachricht----- > Von: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Im Auftrag von Korbinian Abenthum > Gesendet: Montag, 30. Juni 2008 13:47 > An: Discussion of IronPython > Betreff: Re: [IronPython] restrict scripting access > > Rainer Worbis wrote: >> is there a way to restrict access to objects or namespaces >> within a script? We use IronPython for providing scripting >> functionality within our .NET Application but would like to >> restrict access to certain functions. Has anybody information >> or a sample how to do that? > > Can you declare the restricted objects as "internal"? > > Cheers, > Korbinian > _______________________________________________ > 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 -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From empirebuilder at gmail.com Mon Jun 30 14:33:28 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Mon, 30 Jun 2008 15:33:28 +0300 Subject: [IronPython] restrict scripting access In-Reply-To: <4868D0FB.8060600@voidspace.org.uk> References: <676F9CCC1D1D3242BE4B133746E3807E49B178@XARA.cubido.linz> <0e3301c8daa7_04beb5e0_14b2a8c0@lannisport> <676F9CCC1D1D3242BE4B133746E3807E49B17A@XARA.cubido.linz> <8cd017b80806300524w53ae3689mfd59c2788de16b79@mail.gmail.com> <4868D0FB.8060600@voidspace.org.uk> Message-ID: <8cd017b80806300533n64ebe320sfe05af463bae03bc@mail.gmail.com> That you can filter our from the python source code or replace such call with exception ("bzz, can't load AddReference") - Yeah, it's a pretty nasty workaround, but it works. Dody G. On Mon, Jun 30, 2008 at 3:26 PM, Michael Foord wrote: > Dody Gunawinata wrote: > >> In the IronPython hosting API, unless you specifically load the assembly, >> it will not be accessible through the script. So right now restricting >> access means configuring the assemblies you want to expose to the script. >> >> > But what is to stop the user code doing: > > import clr > clr.AddReference('SomeAssembly') > > Loading the ScriptRuntime into an AppDomain and restricting the privileges > on that is one way - but I don't think that IronPython will work at all > unless the AppDomain has pretty much full trust. > > Michael Foord > > On Mon, Jun 30, 2008 at 3:09 PM, Ben Hall > ben2004uk at googlemail.com>> wrote: >> >> I thought this last night, it would be really useful if we could >> 'sandbox' the IP engine and limit it's access to certain areas of the >> framework. >> >> >> >> On Mon, Jun 30, 2008 at 12:57 PM, Rainer Worbis >> > wrote: >> > No - for example i would like to prevent that the user loads >> assemblies and does own data access via System.Data.SqlClient. >> > Or uses specific parts of the applications. (which should be >> visible to other scripts). So access control per script would be >> optimal. >> > >> > Rainer >> > >> > -----Urspr?ngliche Nachricht----- >> > Von: users-bounces at lists.ironpython.com >> >> [mailto:users-bounces at lists.ironpython.com >> ] Im Auftrag von >> Korbinian Abenthum >> > Gesendet: Montag, 30. Juni 2008 13:47 >> > An: Discussion of IronPython >> > Betreff: Re: [IronPython] restrict scripting access >> > >> > Rainer Worbis wrote: >> >> is there a way to restrict access to objects or namespaces >> >> within a script? We use IronPython for providing scripting >> >> functionality within our .NET Application but would like to >> >> restrict access to certain functions. Has anybody information >> >> or a sample how to do that? >> > >> > Can you declare the restricted objects as "internal"? >> > >> > Cheers, >> > Korbinian >> > _______________________________________________ >> > 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 >> >> >> >> >> -- >> nomadlife.org >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > http://www.theotherdelia.co.uk/ > > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Jun 30 14:35:43 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 30 Jun 2008 13:35:43 +0100 Subject: [IronPython] restrict scripting access In-Reply-To: <8cd017b80806300533n64ebe320sfe05af463bae03bc@mail.gmail.com> References: <676F9CCC1D1D3242BE4B133746E3807E49B178@XARA.cubido.linz> <0e3301c8daa7_04beb5e0_14b2a8c0@lannisport> <676F9CCC1D1D3242BE4B133746E3807E49B17A@XARA.cubido.linz> <8cd017b80806300524w53ae3689mfd59c2788de16b79@mail.gmail.com> <4868D0FB.8060600@voidspace.org.uk> <8cd017b80806300533n64ebe320sfe05af463bae03bc@mail.gmail.com> Message-ID: <4868D31F.6050804@voidspace.org.uk> Dody Gunawinata wrote: > That you can filter our from the python source code or replace such > call with exception ("bzz, can't load AddReference") - Yeah, it's a > pretty nasty workaround, but it works. Unfortunately not - one of the disadvantages of a highly dynamic language. There are lots of alternative ways of getting at the functionality. Using the __import__ function instead of import. Using getattr with strings instead of including the literals in the source code. etc etc It is for these reasons that the rexec module was deprecated in CPython, it is basically impossible to prevent access to certain builtin features. You have to apply the restrictions from the 'outside'. Michael > > Dody G. > > On Mon, Jun 30, 2008 at 3:26 PM, Michael Foord > > wrote: > > Dody Gunawinata wrote: > > In the IronPython hosting API, unless you specifically load > the assembly, it will not be accessible through the script. So > right now restricting access means configuring the assemblies > you want to expose to the script. > > > But what is to stop the user code doing: > > import clr > clr.AddReference('SomeAssembly') > > Loading the ScriptRuntime into an AppDomain and restricting the > privileges on that is one way - but I don't think that IronPython > will work at all unless the AppDomain has pretty much full trust. > > Michael Foord > > On Mon, Jun 30, 2008 at 3:09 PM, Ben Hall > > >> wrote: > > I thought this last night, it would be really useful if we > could > 'sandbox' the IP engine and limit it's access to certain > areas of the > framework. > > > > On Mon, Jun 30, 2008 at 12:57 PM, Rainer Worbis > > >> wrote: > > No - for example i would like to prevent that the user loads > assemblies and does own data access via System.Data.SqlClient. > > Or uses specific parts of the applications. (which should be > visible to other scripts). So access control per script > would be > optimal. > > > > Rainer > > > > -----Urspr?ngliche Nachricht----- > > Von: users-bounces at lists.ironpython.com > > > > [mailto:users-bounces at lists.ironpython.com > > >] Im Auftrag von > Korbinian Abenthum > > Gesendet: Montag, 30. Juni 2008 13:47 > > An: Discussion of IronPython > > Betreff: Re: [IronPython] restrict scripting access > > > > Rainer Worbis wrote: > >> is there a way to restrict access to objects or namespaces > >> within a script? We use IronPython for providing scripting > >> functionality within our .NET Application but would like to > >> restrict access to certain functions. Has anybody > information > >> or a sample how to do that? > > > > Can you declare the restricted objects as "internal"? > > > > Cheers, > > Korbinian > > _______________________________________________ > > 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 > > > > > -- > nomadlife.org > ------------------------------------------------------------------------ > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > http://www.theotherdelia.co.uk/ > > > > > -- > nomadlife.org > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ From empirebuilder at gmail.com Mon Jun 30 15:30:41 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Mon, 30 Jun 2008 16:30:41 +0300 Subject: [IronPython] restrict scripting access In-Reply-To: <4868D31F.6050804@voidspace.org.uk> References: <676F9CCC1D1D3242BE4B133746E3807E49B178@XARA.cubido.linz> <0e3301c8daa7_04beb5e0_14b2a8c0@lannisport> <676F9CCC1D1D3242BE4B133746E3807E49B17A@XARA.cubido.linz> <8cd017b80806300524w53ae3689mfd59c2788de16b79@mail.gmail.com> <4868D0FB.8060600@voidspace.org.uk> <8cd017b80806300533n64ebe320sfe05af463bae03bc@mail.gmail.com> <4868D31F.6050804@voidspace.org.uk> Message-ID: <8cd017b80806300630v1d825d5dh81939cab1a8fad1@mail.gmail.com> Ah, true. If there's an effort to create a sandbox mode, please also consider time out scenarios so we don't have infite loops causing much damage. On Mon, Jun 30, 2008 at 3:35 PM, Michael Foord wrote: > Dody Gunawinata wrote: > >> That you can filter our from the python source code or replace such call >> with exception ("bzz, can't load AddReference") - Yeah, it's a pretty nasty >> workaround, but it works. >> > > Unfortunately not - one of the disadvantages of a highly dynamic language. > There are lots of alternative ways of getting at the functionality. > > Using the __import__ function instead of import. Using getattr with strings > instead of including the literals in the source code. etc etc > > It is for these reasons that the rexec module was deprecated in CPython, it > is basically impossible to prevent access to certain builtin features. You > have to apply the restrictions from the 'outside'. > > Michael > > >> Dody G. >> >> On Mon, Jun 30, 2008 at 3:26 PM, Michael Foord > fuzzyman at voidspace.org.uk>> wrote: >> >> Dody Gunawinata wrote: >> >> In the IronPython hosting API, unless you specifically load >> the assembly, it will not be accessible through the script. So >> right now restricting access means configuring the assemblies >> you want to expose to the script. >> >> >> But what is to stop the user code doing: >> >> import clr >> clr.AddReference('SomeAssembly') >> >> Loading the ScriptRuntime into an AppDomain and restricting the >> privileges on that is one way - but I don't think that IronPython >> will work at all unless the AppDomain has pretty much full trust. >> >> Michael Foord >> >> On Mon, Jun 30, 2008 at 3:09 PM, Ben Hall >> >> > >> wrote: >> >> I thought this last night, it would be really useful if we >> could >> 'sandbox' the IP engine and limit it's access to certain >> areas of the >> framework. >> >> >> >> On Mon, Jun 30, 2008 at 12:57 PM, Rainer Worbis >> >> >> wrote: >> > No - for example i would like to prevent that the user loads >> assemblies and does own data access via System.Data.SqlClient. >> > Or uses specific parts of the applications. (which should be >> visible to other scripts). So access control per script >> would be >> optimal. >> > >> > Rainer >> > >> > -----Urspr?ngliche Nachricht----- >> > Von: users-bounces at lists.ironpython.com >> >> > > >> [mailto:users-bounces at lists.ironpython.com >> >> >> > >] Im Auftrag von >> Korbinian Abenthum >> > Gesendet: Montag, 30. Juni 2008 13:47 >> > An: Discussion of IronPython >> > Betreff: Re: [IronPython] restrict scripting access >> > >> > Rainer Worbis wrote: >> >> is there a way to restrict access to objects or namespaces >> >> within a script? We use IronPython for providing scripting >> >> functionality within our .NET Application but would like to >> >> restrict access to certain functions. Has anybody >> information >> >> or a sample how to do that? >> > >> > Can you declare the restricted objects as "internal"? >> > >> > Cheers, >> > Korbinian >> > _______________________________________________ >> > 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 >> >> >> >> >> -- nomadlife.org < >> http://nomadlife.org> >> >> ------------------------------------------------------------------------ >> >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> >> -- http://www.ironpythoninaction.com/ >> http://www.voidspace.org.uk/ >> http://www.trypython.org/ >> http://www.ironpython.info/ >> http://www.resolverhacks.net/ >> http://www.theotherdelia.co.uk/ >> >> >> >> >> -- >> nomadlife.org >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.resolverhacks.net/ > http://www.theotherdelia.co.uk/ > > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Mon Jun 30 16:04:13 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 30 Jun 2008 23:04:13 +0900 Subject: [IronPython] restrict scripting access In-Reply-To: <676F9CCC1D1D3242BE4B133746E3807E49B178@XARA.cubido.linz> References: <676F9CCC1D1D3242BE4B133746E3807E49B178@XARA.cubido.linz> Message-ID: <5b0248170806300704y216adf71ua7f9629cf60d2eb@mail.gmail.com> 2008/6/30 Rainer Worbis : > is there a way to restrict access to objects or namespaces within a script? > We use IronPython for providing scripting functionality within our .NET > Application but would like to restrict access to certain functions. Has > anybody information or a sample how to do that? Proper sandboxing is a difficult problem. Take a look at the following post for a good overview. http://radix.twistedmatrix.com/2008/05/requirements-for-restricted-execution.html -- Seo Sanghyeon From dinov at exchange.microsoft.com Mon Jun 30 17:25:42 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 30 Jun 2008 08:25:42 -0700 Subject: [IronPython] restrict scripting access In-Reply-To: <5b0248170806300704y216adf71ua7f9629cf60d2eb@mail.gmail.com> References: <676F9CCC1D1D3242BE4B133746E3807E49B178@XARA.cubido.linz> <5b0248170806300704y216adf71ua7f9629cf60d2eb@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227012C92C4C88A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Yep, it sure is - that's the reason why we leave this work to the .NET framework and avoid taking the burden upon ourselves :). There's nothing, other than bugs, in IronPython that prevents it from running in partial trust - look at Silverlight where IronPython runs with no permissions. There have been a few bugs which have prevented us from running on the desktop CLR in partial trust - generally once we find them they're easy to fix. Tomas fixed some of those when looking at getting IronRuby running in partial trust and we'll take at look at the issues that block IronPython as well when we start pushing on this. Once the bugs are gone hosts can either create a partial trust app domain or simply Deny or PermitOnly permissions before calling into IronPython. The user code would then only have access to the .NET functionality that your security policy outlines. If you so wanted your own object model could be fully trusted for when the user calls back into you. What enables this is that IronPython its self runs 100% w/o any trust - it's marked SecurityTransparent. So any actions that IronPython attempts to perform require full demands upon the code calling into IronPython. You might need to implement your own fully trusted host which handles access to the file system but that should be trivial to do. This offers 100% security which is a nice guarantee to have. But many apps might just need a "3 foot high wall" which their users are unlikely to jump over and for those maybe getting rid of import clr and any available DLLs will be sufficient. I'm not sure where we're currently prioritizing these bugs so any feedback on how interesting these scenarios are would be helpful :). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Monday, June 30, 2008 7:04 AM To: Discussion of IronPython Subject: Re: [IronPython] restrict scripting access 2008/6/30 Rainer Worbis : > is there a way to restrict access to objects or namespaces within a script? > We use IronPython for providing scripting functionality within our .NET > Application but would like to restrict access to certain functions. Has > anybody information or a sample how to do that? Proper sandboxing is a difficult problem. Take a look at the following post for a good overview. http://radix.twistedmatrix.com/2008/05/requirements-for-restricted-execution.html -- Seo Sanghyeon _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Mon Jun 30 18:16:32 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 30 Jun 2008 17:16:32 +0100 Subject: [IronPython] restrict scripting access In-Reply-To: <7AD436E4270DD54A94238001769C2227012C92C4C88A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <676F9CCC1D1D3242BE4B133746E3807E49B178@XARA.cubido.linz> <5b0248170806300704y216adf71ua7f9629cf60d2eb@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C92C4C88A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <486906E0.7070606@voidspace.org.uk> Cool. I *thought* that the reason IronPython required full trust was due to bugs in the CLR, and am delighted to hear that I'm wrong! Michael Dino Viehland wrote: > Yep, it sure is - that's the reason why we leave this work to the .NET framework and avoid taking the burden upon ourselves :). > > There's nothing, other than bugs, in IronPython that prevents it from running in partial trust - look at Silverlight where IronPython runs with no permissions. There have been a few bugs which have prevented us from running on the desktop CLR in partial trust - generally once we find them they're easy to fix. Tomas fixed some of those when looking at getting IronRuby running in partial trust and we'll take at look at the issues that block IronPython as well when we start pushing on this. > > Once the bugs are gone hosts can either create a partial trust app domain or simply Deny or PermitOnly permissions before calling into IronPython. The user code would then only have access to the .NET functionality that your security policy outlines. If you so wanted your own object model could be fully trusted for when the user calls back into you. What enables this is that IronPython its self runs 100% w/o any trust - it's marked SecurityTransparent. So any actions that IronPython attempts to perform require full demands upon the code calling into IronPython. You might need to implement your own fully trusted host which handles access to the file system but that should be trivial to do. > > This offers 100% security which is a nice guarantee to have. But many apps might just need a "3 foot high wall" which their users are unlikely to jump over and for those maybe getting rid of import clr and any available DLLs will be sufficient. I'm not sure where we're currently prioritizing these bugs so any feedback on how interesting these scenarios are would be helpful :). > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo > Sent: Monday, June 30, 2008 7:04 AM > To: Discussion of IronPython > Subject: Re: [IronPython] restrict scripting access > > 2008/6/30 Rainer Worbis : > >> is there a way to restrict access to objects or namespaces within a script? >> We use IronPython for providing scripting functionality within our .NET >> Application but would like to restrict access to certain functions. Has >> anybody information or a sample how to do that? >> > > Proper sandboxing is a difficult problem. Take a look at the following > post for a good overview. > > http://radix.twistedmatrix.com/2008/05/requirements-for-restricted-execution.html > > -- > Seo Sanghyeon > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ From dinov at exchange.microsoft.com Mon Jun 30 18:19:32 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 30 Jun 2008 09:19:32 -0700 Subject: [IronPython] restrict scripting access In-Reply-To: <486906E0.7070606@voidspace.org.uk> References: <676F9CCC1D1D3242BE4B133746E3807E49B178@XARA.cubido.linz> <5b0248170806300704y216adf71ua7f9629cf60d2eb@mail.gmail.com> <7AD436E4270DD54A94238001769C2227012C92C4C88A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <486906E0.7070606@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227012C92C4C89E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> You aren't entirely wrong - .NET 2.0 RTM was missing functionality we needed (partial trust reflection emit) but we got that in SP1. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, June 30, 2008 9:17 AM To: Discussion of IronPython Subject: Re: [IronPython] restrict scripting access Cool. I *thought* that the reason IronPython required full trust was due to bugs in the CLR, and am delighted to hear that I'm wrong! Michael Dino Viehland wrote: > Yep, it sure is - that's the reason why we leave this work to the .NET framework and avoid taking the burden upon ourselves :). > > There's nothing, other than bugs, in IronPython that prevents it from running in partial trust - look at Silverlight where IronPython runs with no permissions. There have been a few bugs which have prevented us from running on the desktop CLR in partial trust - generally once we find them they're easy to fix. Tomas fixed some of those when looking at getting IronRuby running in partial trust and we'll take at look at the issues that block IronPython as well when we start pushing on this. > > Once the bugs are gone hosts can either create a partial trust app domain or simply Deny or PermitOnly permissions before calling into IronPython. The user code would then only have access to the .NET functionality that your security policy outlines. If you so wanted your own object model could be fully trusted for when the user calls back into you. What enables this is that IronPython its self runs 100% w/o any trust - it's marked SecurityTransparent. So any actions that IronPython attempts to perform require full demands upon the code calling into IronPython. You might need to implement your own fully trusted host which handles access to the file system but that should be trivial to do. > > This offers 100% security which is a nice guarantee to have. But many apps might just need a "3 foot high wall" which their users are unlikely to jump over and for those maybe getting rid of import clr and any available DLLs will be sufficient. I'm not sure where we're currently prioritizing these bugs so any feedback on how interesting these scenarios are would be helpful :). > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo > Sent: Monday, June 30, 2008 7:04 AM > To: Discussion of IronPython > Subject: Re: [IronPython] restrict scripting access > > 2008/6/30 Rainer Worbis : > >> is there a way to restrict access to objects or namespaces within a script? >> We use IronPython for providing scripting functionality within our .NET >> Application but would like to restrict access to certain functions. Has >> anybody information or a sample how to do that? >> > > Proper sandboxing is a difficult problem. Take a look at the following > post for a good overview. > > http://radix.twistedmatrix.com/2008/05/requirements-for-restricted-execution.html > > -- > Seo Sanghyeon > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.resolverhacks.net/ http://www.theotherdelia.co.uk/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Mon Jun 30 20:50:37 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 30 Jun 2008 19:50:37 +0100 Subject: [IronPython] IronPython 1.1.2 eta? Message-ID: <48692AFD.4040605@voidspace.org.uk> Hello guys, A while back you suggested that IronPython 1.1.2 would arrive 'some time in June'. Whilst that is still possible it seems unlikely, any news on an eta? Whilst we're at it, any idea on when IP 2 Beta 4 might be released? We'd like to test Resolver One with an updated IronPython 2 where performance isn't borked quite so much... :-) Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From dinov at exchange.microsoft.com Mon Jun 30 22:00:15 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 30 Jun 2008 13:00:15 -0700 Subject: [IronPython] IronPython 1.1.2 eta? In-Reply-To: <48692AFD.4040605@voidspace.org.uk> References: <48692AFD.4040605@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227012C93298788@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Yeah, it's not going to happen today :) The changes are done (any bugs assigned to me and the 1.1.2 release on CodePlex will be fixed), they just need to run through a full test pass. I got started on the changes late and the test infrastructure needed to be brought back to life so it's taking a little bit longer than expected but the RC should be out soon. Beta 4 is currently planned for early August. If you're willing to try out a source release from http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx I'd be happy to let you know when the last remaining regression is fixed (and gets uploaded there - looks like that hasn't been happening :(). We've fixed the polymorphic call site perf bug already but there's still a bug that results in massive overhead of calling simple Python functions. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, June 30, 2008 11:51 AM To: Discussion of IronPython Subject: [IronPython] IronPython 1.1.2 eta? Hello guys, A while back you suggested that IronPython 1.1.2 would arrive 'some time in June'. Whilst that is still possible it seems unlikely, any news on an eta? Whilst we're at it, any idea on when IP 2 Beta 4 might be released? We'd like to test Resolver One with an updated IronPython 2 where performance isn't borked quite so much... :-) Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Mon Jun 30 22:12:47 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 30 Jun 2008 21:12:47 +0100 Subject: [IronPython] IronPython 1.1.2 eta? In-Reply-To: <7AD436E4270DD54A94238001769C2227012C93298788@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <48692AFD.4040605@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227012C93298788@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <48693E3F.8080507@voidspace.org.uk> Dino Viehland wrote: > Yeah, it's not going to happen today :) The changes are done (any bugs assigned to me and the 1.1.2 release on CodePlex will be fixed), they just need to run through a full test pass. I got started on the changes late and the test infrastructure needed to be brought back to life so it's taking a little bit longer than expected but the RC should be out soon. > That's great news. > Beta 4 is currently planned for early August. If you're willing to try out a source release from http://www.codeplex.com/IronPython/SourceControl/ListDownloadableCommits.aspx I'd be happy to let you know when the last remaining regression is fixed (and gets uploaded there - looks like that hasn't been happening :(). We've fixed the polymorphic call site perf bug already but there's still a bug that results in massive overhead of calling simple Python functions. > > If you get to the stage where performance regressions are fixed in the available source, but no release has been cut, then I think we would be happy to try with that. Not being able to build with VS 2005 will be a pain as installing VS 2008 breaks our build environment (last time we tried anyway). I can probably build it at home though. :-) Thanks Michael Foord > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Monday, June 30, 2008 11:51 AM > To: Discussion of IronPython > Subject: [IronPython] IronPython 1.1.2 eta? > > Hello guys, > > A while back you suggested that IronPython 1.1.2 would arrive 'some time > in June'. Whilst that is still possible it seems unlikely, any news on > an eta? > > Whilst we're at it, any idea on when IP 2 Beta 4 might be released? We'd > like to test Resolver One with an updated IronPython 2 where performance > isn't borked quite so much... :-) > > Michael > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/ > http://www.trypython.org/ > http://www.ironpython.info/ > http://www.theotherdelia.co.uk/ > http://www.resolverhacks.net/ > > _______________________________________________ > 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 > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From brosembob at yahoo.com Mon Jun 30 22:15:03 2008 From: brosembob at yahoo.com (Bob Rosembob) Date: Mon, 30 Jun 2008 13:15:03 -0700 (PDT) Subject: [IronPython] Another deployment question... Message-ID: <25906.34062.qm@web35701.mail.mud.yahoo.com> Hi there, I have a couple of questions. ? 1. If I'm using IronPython to call Python function from my C# app. What do I need to deploy my project? ? I added references to my project to the following dlls: IronPython.dlll IronMath.dll ? In the code I'm using the following: using IronPython.Runtime; using?IronPython.Runtime.Types; using?IronPython.Runtime.Operations; usingIronPython.Hosting; using?IronPython.Modules; ? The script imports: string sys os math and other ? 2. In order to run the script I had to copy imported libraries into directory where my exe is.? For some reason if I copy the?compiled version of the files (e.g. string.pyc, sys.pyc, etc.) my script won't find them. It can see only none-compiled files. Why is it? What should I do to be able run all script files (py) as compiled (pyc)? ? Please advise. ? Thanks, Bob -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Jun 30 22:19:25 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 30 Jun 2008 21:19:25 +0100 Subject: [IronPython] Another deployment question... In-Reply-To: <25906.34062.qm@web35701.mail.mud.yahoo.com> References: <25906.34062.qm@web35701.mail.mud.yahoo.com> Message-ID: <48693FCD.7000104@voidspace.org.uk> Bob Rosembob wrote: > Hi there, > I have a couple of questions. > > 1. If I'm using IronPython to call Python function from my C# app. > What do I need to deploy my project? > > I added references to my project to the following dlls: > /IronPython.dlll > IronMath.dll/ > / > / > In the code I'm using the following: > /using IronPython.Runtime; > using IronPython.Runtime.Types; > using IronPython.Runtime.Operations; > usingIronPython.Hosting; > using IronPython.Modules;/ > / > / > The script imports: > /string/ > /sys/ > /os/ > /math/ > and other > > 2. In order to run the script I had to copy imported libraries into > directory where my exe is. For some reason if I copy the compiled > version of the files (e.g. string.pyc, sys.pyc, etc.) my script won't > find them. It can see only none-compiled files. Why is it? What should > I do to be able run all script files (py) as compiled (pyc)? Those compiled files are compiled into bytecode for the CPython VM. They will never run on the .NET framework. What is wrong with using the '.py' source files? Michael > > Please advise. > > Thanks, > Bob > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ From g.mulot at free.fr Mon Jun 30 23:56:36 2008 From: g.mulot at free.fr (Gerard Mulot) Date: Mon, 30 Jun 2008 23:56:36 +0200 Subject: [IronPython] LeeBeLLuL speak now with IronRuby Message-ID: <000101c8dafc$2b28ff60$817afe20$@mulot@free.fr> A simple demo is available to download at http://www.leebellul.com showing How to use infopath forms in the hosting browser How to use xsl and xml to generate dynamic menus How to interact between Javascript and IronRuby How to interact between IronRuby and Javascript How to interact with the CLR To send email To launch command batch file to publish file via the command dos FTP To use dialog forms To use the system.data.oleDb to intercat with access mdb How to interact with the DLR and multiple ScriptScope The same demo is also available in IronPython. The translation between IronPyton and IronRuby was easy. No attempt has been done to optimize the coding Regards LeeBeLLuL -------------- next part -------------- An HTML attachment was scrubbed... URL: