From merllab at microsoft.com Mon Jun 1 17:53:59 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Mon, 1 Jun 2009 08:53:59 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/53528. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/IronPythonWindow/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/IronPythonConsole/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/IronPython/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Logical.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Properties/ExtensionAssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Properties/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Binary.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/Calls/OverloadResolver.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Properties/AssemblyInfo.cs From vkhaskel at hotmail.com Tue Jun 2 02:59:23 2009 From: vkhaskel at hotmail.com (Vadim Khaskel) Date: Tue, 2 Jun 2009 00:59:23 +0000 Subject: [IronPython] Users Digest, Vol 59, Issue 1 /how to work with delegates in IronPython/ In-Reply-To: References: Message-ID: Michael, here is my scenario: I have a list - messageBuffer that captures messages. Once this list gets a new message, event generated and combobox ads a new item. based on your example my combobox will do: self._comboBoxA.Event += function Is this just "Event" or any specific event, I understand that you wrote it in general form. thank you for response, Vadim Message: 1 > Date: Sun, 31 May 2009 22:51:54 +0100 > From: Michael Foord > Subject: Re: [IronPython] how to work with delegates in IronPython > To: Discussion of IronPython > Message-ID: <4A22FBFA.3010407 at voidspace.org.uk> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Vadim Khaskel wrote: > > Hello everybody, > > > > Could somebody help to setup simple delegate in IronPython. > > > > I just need to generate event when list structure gets filled with data, > > The standard technique is: > > # check delegate signature > def function(sender, event): > # do something > > instance.Event += function > > What is the list event you want to hook up to? > > Thanks > > Michael Foord > > > > and update GUI element. > > > > thanks a lot, > > > > V. _________________________________________________________________ Insert movie times and more without leaving Hotmail?. http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Tue Jun 2 11:32:03 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 02 Jun 2009 10:32:03 +0100 Subject: [IronPython] Users Digest, Vol 59, Issue 1 /how to work with delegates in IronPython/ In-Reply-To: References: Message-ID: <4A24F193.9010300@voidspace.org.uk> Vadim Khaskel wrote: > Michael, > > here is my scenario: > > I have a list - messageBuffer that captures messages. Once this list > gets a new message, event generated and combobox ads > > a new item. > > based on your example > > my combobox will do: self._comboBoxA.Event += function > > Is this just "Event" or any specific event, I understand that you > wrote it in general form. > You have to add in place (+=) to the specific event you want to handle. If you want to watch a 'list' (of some sort) and perform an action on the combobox you will need to listen for an event on the list. What specific class is the list you intend to use? If you find the MSDN documentation for that class it will show you all the events available. Michael Foord > thank you for response, > > Vadim > > > Message: 1 > > Date: Sun, 31 May 2009 22:51:54 +0100 > > From: Michael Foord > > Subject: Re: [IronPython] how to work with delegates in IronPython > > To: Discussion of IronPython > > Message-ID: <4A22FBFA.3010407 at voidspace.org.uk> > > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > > > Vadim Khaskel wrote: > > > Hello everybody, > > > > > > Could somebody help to setup simple delegate in IronPython. > > > > > > I just need to generate event when list structure gets filled with > data, > > > > The standard technique is: > > > > # check delegate signature > > def function(sender, event): > > # do something > > > > instance.Event += function > > > > What is the list event you want to hook up to? > > > > Thanks > > > > Michael Foord > > > > > > and update GUI element. > > > > > > thanks a lot, > > > > > > V. > ------------------------------------------------------------------------ > Insert movie times and more without leaving Hotmail?. See how. > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.ironpythoninaction.com/ From merllab at microsoft.com Tue Jun 2 17:52:54 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Tue, 2 Jun 2009 08:52:54 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/53680. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/Microsoft.Scripting.Silverlight.csproj $/IronPython/IronPython_Main/Src/IronPython.Modules/IronPython.Modules.csproj $/IronPython/IronPython_Main/Src/IronPython/IronPython.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.Core.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/TreeComparer.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.ExtensionAttribute.csproj $/IronPython/IronPython_Main/Src/IronPythonTest/IronPythonTest.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Microsoft.Scripting.csproj $/IronPython/IronPython_Main/Src/Tests/ClrAssembly/ClrAssembly.csproj From dfugate at microsoft.com Tue Jun 2 18:48:08 2009 From: dfugate at microsoft.com (Dave Fugate) Date: Tue, 2 Jun 2009 09:48:08 -0700 Subject: [IronPython] IronPython 2.6 and .NET 4.0 (and the GAC) In-Reply-To: References: Message-ID: I think it's a safe bet that when the final version of .NET 4.0 is released we'll either: * re-release the latest final version of IronPython against it. If .NET 4.0 had already shipped today, this would end up being "IronPython 2.0.1 for .NET 4.0" * release the next version of IronPython (e.g., IP 2.7/3.x Alpha/Beta/etc) against it In any event, we definitely plan on shipping something built against .NET 4.0 that doesn't contain "Community Technology Preview" in the title. Until the final version of .NET 4.0 ships, expect more preview releases of IronPython for .NET 4.0. As for your question about adding IronPython assemblies to the GAC, I'm not aware of any extra requirements offhand. Maybe Dino knows... -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeff Hardy Sent: Friday, May 29, 2009 10:43 PM To: Discussion of IronPython Subject: [IronPython] IronPython 2.6 and .NET 4.0 (and the GAC) Hi all, Are there plans to release versions of 2.6 for both .NET 2.0 & .NET 4.0, or are the 4.0 previews just for demonstration? Also, (as nobody noticed my earlier mail :)), are there plans to support adding 2.6 to the GAC? When I asked for 2.0, it was mentioned that there are more stringent requirements for the GAC; I'm just wondering if those are being targetted. - Jeff _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From giles.thomas at resolversystems.com Wed Jun 3 17:38:50 2009 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Wed, 03 Jun 2009 16:38:50 +0100 Subject: [IronPython] ANN: Resolver One 1.5 released Message-ID: <4A26990A.3020402@resolversystems.com> We are proud to announce the release of Resolver One, version 1.5. Resolver One is a Windows-based spreadsheet that integrates IronPython deeply into its recalculation loop, making the models you build more reliable and more maintainable. For version 1.5, we've added a console; this new command-line window gives you a way to interact with your spreadsheet using Python statements. Here's a screencast showing why this is worth doing: We have a 31-day free trial version, so if you would like to take a look, you can download it from our website: If you want to use Resolver One in an Open Source project, we offer free licenses for that: Many thanks for the ongoing work of the IronPython team to build the platform that makes this all possible! Best regards, Giles -- Giles Thomas giles.thomas at resolversystems.com +44 (0) 20 7253 6372 Win up to $17,000 for a spreadsheet: 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 merllab at microsoft.com Wed Jun 3 17:52:29 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Wed, 3 Jun 2009 08:52:29 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <6368fd2f-06ec-465c-bec2-2f120b789ca7@tk5-exsmh-c101.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/53794. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/TypeGroup.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Utils/CollectionUtils.cs From patrick.deschenes at gmail.com Wed Jun 3 19:59:08 2009 From: patrick.deschenes at gmail.com (=?ISO-8859-1?Q?Patrick_Desch=EAnes?=) Date: Wed, 3 Jun 2009 13:59:08 -0400 Subject: [IronPython] Debugging IronPython scripts + simulate a filename when loading a string Message-ID: <574428130906031059x664eabes21596f49ce75862b@mail.gmail.com> Hi, I'm currently using IronPython to develop extensions to my program. My python scripts are compressed in a zip file along with other resources. Everything works fine but I would be very happy if I could find a simple way to debug my scripts. I don't want anything complex for now. If I could only do something like this : try: bugged code except: print debug.stack.filename + " : " debug.stack.lineno It would be perfect. I looked for the *traceback* module but it doesn't seems to work with IronPython. Also, since I load my script from a zip file, is there a way to simulate a filename when loading a string. So, if I could : a) load a string as if it was a file b) intercept the filename/linenum in the catch block That would be a huge improvement. - Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From itssivaguru at gmail.com Wed Jun 3 22:35:42 2009 From: itssivaguru at gmail.com (Sivaguru Perambalam) Date: Wed, 3 Jun 2009 16:35:42 -0400 Subject: [IronPython] Urgent : Unable to open MS Word file from Python Message-ID: <12604cb0906031335m5c6004a0xabe27c2f690ec6ff@mail.gmail.com> Hello, I have written this small script, which is (part of an application that is) supposed to open a MS Word Document and manipulate it (do a search and replace) . I am getting a weird exception when I try to run the script. It says TypeError: expected clr.Reference, got str for the line where I try to open the file. But the same script runs fine on a colleague's computer . I couldn't figure out what his computer has that mine doesn't.So I thought of asking what are the necessary things (libs, dlls) that are needed to Open/Work on MS Word File from Iron Python. MS Excel interaction works fine in my computer though. I have Office 07, MS Visual Studio 05, .NET Framework 2.0 installed in my computer. I have also verified that Microsoft.Office.Interop.Word version 12.0.0.0 is found registered in the Assembly Cache. This issue has become a Show-stopper for the Application I am working on. So, any helpful suggestions or directions would mean a lot ! Thanks !! Script : import clr import System clr.AddReference("Microsoft.Office.Interop.Word") import Microsoft.Office.Interop.Word as Word source_filename = 'C:\Sample_Report.doc' destination_filename = 'c:\Validation Report.doc' missing = System.Type.Missing replaceAll = Word.WdReplace.wdReplaceAll # Open the Report Template MSWord File word_application = Word.ApplicationClass() word_application.Visible = False document = word_application.Documents.Open(source_filename) print 'opened microsoft word' document.SaveAs(destination_filename) document.Close() document = None word_application.Quit() word_application = None Error Message : > "C:\Program Files\DotQuestLite\Bin\ipy.exe" word.py Traceback (most recent call last): File C:\Documents and Settings\sp19206\Desktop\word.py, line 17, in Initialize TypeError: expected clr.Reference, got str > Process Exit Code: 1 > Time Taken: 00:07 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Thu Jun 4 00:17:06 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 03 Jun 2009 23:17:06 +0100 Subject: [IronPython] IronPython 2.0.1 repr of floats on non UK Windows Message-ID: <4A26F662.7090205@voidspace.org.uk> Hello guys, Is this a known issue? WinXP SP3 Spanish >>> repr(0.1) '0,10000000000000001' Notice the comma instead of the decimal point. This is honoring the locale but screwing anything that tries to use the string programattically. Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From dfugate at microsoft.com Thu Jun 4 01:18:55 2009 From: dfugate at microsoft.com (Dave Fugate) Date: Wed, 3 Jun 2009 16:18:55 -0700 Subject: [IronPython] IronPython 2.0.1 repr of floats on non UK Windows In-Reply-To: <4A26F662.7090205@voidspace.org.uk> References: <4A26F662.7090205@voidspace.org.uk> Message-ID: Thanks for reporting this Michael. It's a known issue (see http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=14022), but actually should be working under IP 2.0... -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Wednesday, June 03, 2009 3:17 PM To: Discussion of IronPython Subject: [IronPython] IronPython 2.0.1 repr of floats on non UK Windows Hello guys, Is this a known issue? WinXP SP3 Spanish >>> repr(0.1) '0,10000000000000001' Notice the comma instead of the decimal point. This is honoring the locale but screwing anything that tries to use the string programattically. Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Shri.Borde at microsoft.com Thu Jun 4 01:29:44 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Wed, 3 Jun 2009 16:29:44 -0700 Subject: [IronPython] Urgent : Unable to open MS Word file from Python In-Reply-To: <12604cb0906031335m5c6004a0xabe27c2f690ec6ff@mail.gmail.com> References: <12604cb0906031335m5c6004a0xabe27c2f690ec6ff@mail.gmail.com> Message-ID: <710DF26F214D2B4BB94287123FFE980A2E206F610D@NA-EXMSG-C104.redmond.corp.microsoft.com> Try using this workaround. import clr r = clr.Reference[str]() r.Value = source_filename word_application.Documents.Open(r) You should not have to do this with IPy 2.6, and probably even with 2.0. Using a str directly works for me. What version of IronPython are you using? I think the workaround might have been needed with IPy 1.X. See http://blogs.msdn.com/shrib/archive/2008/07/30/idispatch-support-on-in-ironpython-beta-4.aspx for some details about using COM from IPy. Thanks, Shri From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sivaguru Perambalam Sent: Wednesday, June 03, 2009 1:36 PM To: users at lists.ironpython.com Subject: [IronPython] Urgent : Unable to open MS Word file from Python Hello, I have written this small script, which is (part of an application that is) supposed to open a MS Word Document and manipulate it (do a search and replace) . I am getting a weird exception when I try to run the script. It says TypeError: expected clr.Reference, got str for the line where I try to open the file. But the same script runs fine on a colleague's computer . I couldn't figure out what his computer has that mine doesn't.So I thought of asking what are the necessary things (libs, dlls) that are needed to Open/Work on MS Word File from Iron Python. MS Excel interaction works fine in my computer though. I have Office 07, MS Visual Studio 05, .NET Framework 2.0 installed in my computer. I have also verified that Microsoft.Office.Interop.Word version 12.0.0.0 is found registered in the Assembly Cache. This issue has become a Show-stopper for the Application I am working on. So, any helpful suggestions or directions would mean a lot ! Thanks !! Script : import clr import System clr.AddReference("Microsoft.Office.Interop.Word") import Microsoft.Office.Interop.Word as Word source_filename = 'C:\Sample_Report.doc' destination_filename = 'c:\Validation Report.doc' missing = System.Type.Missing replaceAll = Word.WdReplace.wdReplaceAll # Open the Report Template MSWord File word_application = Word.ApplicationClass() word_application.Visible = False document = word_application.Documents.Open(source_filename) print 'opened microsoft word' document.SaveAs(destination_filename) document.Close() document = None word_application.Quit() word_application = None Error Message : > "C:\Program Files\DotQuestLite\Bin\ipy.exe" word.py Traceback (most recent call last): File C:\Documents and Settings\sp19206\Desktop\word.py, line 17, in Initialize TypeError: expected clr.Reference, got str > Process Exit Code: 1 > Time Taken: 00:07 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfugate at microsoft.com Thu Jun 4 01:34:25 2009 From: dfugate at microsoft.com (Dave Fugate) Date: Wed, 3 Jun 2009 16:34:25 -0700 Subject: [IronPython] IronPython 2.0.1 repr of floats on non UK Windows In-Reply-To: References: <4A26F662.7090205@voidspace.org.uk> Message-ID: Under German 32-bit Vista SP1 I get the following: C:\Users\merllab.REDMOND\Desktop\IronPython-2.0.1>ipy.exe IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3074 Type "help", "copyright", "credits" or "license" for more information. >>> repr(0.1) '0.10000000000000001' >>> #Make sure we're really localized >>> try: ... 1/0 ... except Exception, e: ... print e.message ... Es wurde versucht, durch 0 (null) zu teilen. >>> ^Z C:\Users\merllab.REDMOND\Desktop\IronPython-2.0.1>type blah.cs using System; public class Blah { public static void Main() { System.Console.WriteLine(0.1); } } C:\Users\merllab.REDMOND\Desktop\IronPython-2.0.1>blah.exe 0,1 Are you sure this isn't IronPython 1.x? Thanks, Dave -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dave Fugate Sent: Wednesday, June 03, 2009 4:19 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.0.1 repr of floats on non UK Windows Thanks for reporting this Michael. It's a known issue (see http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=14022), but actually should be working under IP 2.0... -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Wednesday, June 03, 2009 3:17 PM To: Discussion of IronPython Subject: [IronPython] IronPython 2.0.1 repr of floats on non UK Windows Hello guys, Is this a known issue? WinXP SP3 Spanish >>> repr(0.1) '0,10000000000000001' Notice the comma instead of the decimal point. This is honoring the locale but screwing anything that tries to use the string programattically. Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.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 4 12:04:23 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 04 Jun 2009 11:04:23 +0100 Subject: [IronPython] IronPython 2.0.1 repr of floats on non UK Windows In-Reply-To: References: <4A26F662.7090205@voidspace.org.uk> Message-ID: <4A279C27.7090309@voidspace.org.uk> Dave Fugate wrote: > Under German 32-bit Vista SP1 I get the following: > C:\Users\merllab.REDMOND\Desktop\IronPython-2.0.1>ipy.exe > IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3074 > Type "help", "copyright", "credits" or "license" for more information. > >>> repr(0.1) > '0.10000000000000001' > >>> #Make sure we're really localized > >>> try: > ... 1/0 > ... except Exception, e: > ... print e.message > ... > Es wurde versucht, durch 0 (null) zu teilen. > >>> ^Z > > C:\Users\merllab.REDMOND\Desktop\IronPython-2.0.1>type blah.cs > using System; > > public class Blah { > public static void Main() { > System.Console.WriteLine(0.1); > } > } > C:\Users\merllab.REDMOND\Desktop\IronPython-2.0.1>blah.exe > 0,1 > > Are you sure this isn't IronPython 1.x? > It's actually in Resolver - which we're sure is not using IronPython 1! The user who reported the problem has a Spanish version of the operating system (and not merely the Spanish locale set - switching locale to English didn't show the problem). Michael > Thanks, > > Dave > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dave Fugate > Sent: Wednesday, June 03, 2009 4:19 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython 2.0.1 repr of floats on non UK Windows > > Thanks for reporting this Michael. It's a known issue (see http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=14022), but actually should be working under IP 2.0... > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Wednesday, June 03, 2009 3:17 PM > To: Discussion of IronPython > Subject: [IronPython] IronPython 2.0.1 repr of floats on non UK Windows > > Hello guys, > > Is this a known issue? > > WinXP SP3 Spanish > >>>> repr(0.1) >>>> > '0,10000000000000001' > > Notice the comma instead of the decimal point. This is honoring the > locale but screwing anything that tries to use the string programattically. > > Michael > > -- http://www.ironpythoninaction.com/ From merllab at microsoft.com Thu Jun 4 17:52:47 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Thu, 4 Jun 2009 08:52:47 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <40043f3a-1f16-4c3a-9955-04cd0da44aab@tk5-exsmh-c101.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/53897. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/GotoExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/BinaryExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/ConditionalExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/Expression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/DebugInfoExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/DefaultExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/ConstantExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/BlockExpression.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/GeneratorRewriter.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/ClosureExpression.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/ReducableDynamicExpression.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/ArrayGlobalAllocator.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/PythonGlobalVariableExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/MethodCallExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/MemberExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/ListInitExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/RuntimeVariablesExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/MemberInitExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/NewExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/NewArrayExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/LoopExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/InvocationExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/IndexExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/TryExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/ParameterExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/TypeBinaryExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/SwitchExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/LabelExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Ast/CodeContextExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Utils/ExceptionFactory.Generated.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Ast/SymbolConstantExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/ComboActionRewriter.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Ast/FinallyFlowControlExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/UnaryExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Ast/SkipInterpretExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Ast/GeneratorExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Utils/ArrayUtils.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Interpreter/LastFaultingLineExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Ast/YieldExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Generation/FieldBuilderExpression.cs $/IronPython/IronPython_Main/Src/Tests/test_socket.py $/IronPython/IronPython_Main/Src/Tests/test_stdmodules.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 929550 Date: 6/3/2009 2:28:54 PM (dfugate) Hardens a couple of Internet-based tests (to a degree). (Shelveset: HARDEN_NETWORK_TESTS;REDMOND\dfugate | SNAP CheckinId: 8592) From itssivaguru at gmail.com Thu Jun 4 17:52:53 2009 From: itssivaguru at gmail.com (Sivaguru Perambalam) Date: Thu, 4 Jun 2009 11:52:53 -0400 Subject: [IronPython] Urgent : Unable to open MS Word file from Python In-Reply-To: <710DF26F214D2B4BB94287123FFE980A2E206F610D@NA-EXMSG-C104.redmond.corp.microsoft.com> References: <12604cb0906031335m5c6004a0xabe27c2f690ec6ff@mail.gmail.com> <710DF26F214D2B4BB94287123FFE980A2E206F610D@NA-EXMSG-C104.redmond.corp.microsoft.com> Message-ID: <12604cb0906040852v4df1331fo7246452236b260d7@mail.gmail.com> Thanks a lot Shri ! That helped. I was having the 1.x version of Iron Python . On Wed, Jun 3, 2009 at 7:29 PM, Shri Borde wrote: > Try using this workaround. > > > > import clr > > r = clr.Reference[str]() > > r.Value = source_filename > > word_application.Documents.Open(r) > > > > You should not have to do this with IPy 2.6, and probably even with 2.0. > Using a str directly works for me. What version of IronPython are you using? > I think the workaround might have been needed with IPy 1.X. > > > > See > http://blogs.msdn.com/shrib/archive/2008/07/30/idispatch-support-on-in-ironpython-beta-4.aspxfor some details about using COM from IPy. > > > > Thanks, > > Shri > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Sivaguru Perambalam > *Sent:* Wednesday, June 03, 2009 1:36 PM > *To:* users at lists.ironpython.com > *Subject:* [IronPython] Urgent : Unable to open MS Word file from Python > > > > Hello, > > I have written this small script, which is (part of an application that is) > supposed to open a MS Word Document and manipulate it (do a search and > replace) . > I am getting a weird exception when I try to run the script. > It says TypeError: expected clr.Reference, got str for the line where I > try to open the file. > But the same script runs fine on a colleague's computer . > I couldn't figure out what his computer has that mine doesn't.So I thought > of asking what are the necessary things (libs, dlls) that are needed to > Open/Work on MS Word File from Iron Python. > > MS Excel interaction works fine in my computer though. I have Office 07, MS > Visual Studio 05, .NET Framework 2.0 installed in my computer. I have also > verified that Microsoft.Office.Interop.Word version 12.0.0.0 is found > registered in the Assembly Cache. > > This issue has become a Show-stopper for the Application I am working on. > So, any helpful suggestions or directions would mean a lot ! > > Thanks !! > > > Script : > > import clr > import System > > clr.AddReference("Microsoft.Office.Interop.Word") > > import Microsoft.Office.Interop.Word as Word > > source_filename = 'C:\Sample_Report.doc' > destination_filename = 'c:\Validation Report.doc' > > missing = System.Type.Missing > replaceAll = Word.WdReplace.wdReplaceAll > > # Open the Report Template MSWord File > word_application = Word.ApplicationClass() > word_application.Visible = False > document = word_application.Documents.Open(source_filename) > print 'opened microsoft word' > document.SaveAs(destination_filename) > document.Close() > document = None > word_application.Quit() > word_application = None > > > Error Message : > > > "C:\Program Files\DotQuestLite\Bin\ipy.exe" word.py > Traceback (most recent call last): > > File C:\Documents and Settings\sp19206\Desktop\word.py, line 17, in > Initialize > > TypeError: expected clr.Reference, got str > > > > Process Exit Code: 1 > > Time Taken: 00:07 > > _______________________________________________ > 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 kent37 at tds.net Thu Jun 4 19:42:41 2009 From: kent37 at tds.net (Kent Johnson) Date: Thu, 4 Jun 2009 13:42:41 -0400 Subject: [IronPython] CallTarget0 problem Message-ID: <1c2a2c590906041042g576d9c23pe1e549e66f82f03c@mail.gmail.com> Hi, I am an IPy newbie, trying to run example 7.17 from IronPython in Action. It includes the code delegate = CallTarget0(something.form.Close) something.form.Invoke(delegate) were something.form is a Windows.Forms.Form object. The first line above gives this error: Traceback (most recent call last): File "C:\Project\MangoTest\src\SmokeTest.py", line 43, in C:\Project\MangoTest\src\SmokeTest.py File "mscorlib", line unknown, in CreateDelegate ValueError: Error binding to target method. If I change the first line to delegate = CallTarget0(lambda: something.form.Close()) it works fine. Does the argument to CallTarget0() have to be a Python function? Or, what is going on here? I'm running IronPython 2.0.1 on Win XP with .NET 3.5. Thanks, Kent From fuzzyman at voidspace.org.uk Thu Jun 4 21:30:23 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 04 Jun 2009 20:30:23 +0100 Subject: [IronPython] CallTarget0 problem In-Reply-To: <1c2a2c590906041042g576d9c23pe1e549e66f82f03c@mail.gmail.com> References: <1c2a2c590906041042g576d9c23pe1e549e66f82f03c@mail.gmail.com> Message-ID: <4A2820CF.8000404@voidspace.org.uk> Kent Johnson wrote: > Hi, > > I am an IPy newbie, trying to run example 7.17 from IronPython in > Action. It includes the code > > delegate = CallTarget0(something.form.Close) > something.form.Invoke(delegate) > > were something.form is a Windows.Forms.Form object. The first line > above gives this error: > Traceback (most recent call last): > > File "C:\Project\MangoTest\src\SmokeTest.py", line 43, in > C:\Project\MangoTest\src\SmokeTest.py > > File "mscorlib", line unknown, in CreateDelegate > > ValueError: Error binding to target method. > > A while ago there were changes to CallTarget0 that made it incompatible with .NET methods that have a void return signature. Dino told me he would change it back so it would work again, but I guess that didn't happen... > If I change the first line to > delegate = CallTarget0(lambda: something.form.Close()) > it works fine. > This is the correct change to fix it. > Does the argument to CallTarget0() have to be a Python function? Or, > what is going on here? > > No - but it is methods with a void return signature that are the issue. Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From Shri.Borde at microsoft.com Thu Jun 4 22:07:53 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 4 Jun 2009 13:07:53 -0700 Subject: [IronPython] Response may be slow from the IronPython team... In-Reply-To: <4A2820CF.8000404@voidspace.org.uk> References: <1c2a2c590906041042g576d9c23pe1e549e66f82f03c@mail.gmail.com> <4A2820CF.8000404@voidspace.org.uk> Message-ID: <710DF26F214D2B4BB94287123FFE980A2E206F6466@NA-EXMSG-C104.redmond.corp.microsoft.com> Dino is OOF through Monday, and a few others are attending some talks. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Thursday, June 04, 2009 12:30 PM To: Discussion of IronPython Subject: Re: [IronPython] CallTarget0 problem Kent Johnson wrote: > Hi, > > I am an IPy newbie, trying to run example 7.17 from IronPython in > Action. It includes the code > > delegate = CallTarget0(something.form.Close) > something.form.Invoke(delegate) > > were something.form is a Windows.Forms.Form object. The first line > above gives this error: > Traceback (most recent call last): > > File "C:\Project\MangoTest\src\SmokeTest.py", line 43, in > C:\Project\MangoTest\src\SmokeTest.py > > File "mscorlib", line unknown, in CreateDelegate > > ValueError: Error binding to target method. > > A while ago there were changes to CallTarget0 that made it incompatible with .NET methods that have a void return signature. Dino told me he would change it back so it would work again, but I guess that didn't happen... > If I change the first line to > delegate = CallTarget0(lambda: something.form.Close()) > it works fine. > This is the correct change to fix it. > Does the argument to CallTarget0() have to be a Python function? Or, > what is going on here? > > No - but it is methods with a void return signature that are the issue. Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog _______________________________________________ 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 4 23:14:46 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Thu, 4 Jun 2009 21:14:46 +0000 Subject: [IronPython] Access to current Python engine in C# (Silverlight) In-Reply-To: <4A102CD2.40108@voidspace.org.uk> References: <4A0581F2.6010603@voidspace.org.uk> <4A102CD2.40108@voidspace.org.uk> Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC1362C47E@tk5ex14mbxc105.redmond.corp.microsoft.com> > Jimmy - did you get a chance to look at this? Yes, sorry for the wait. Given something.py: class Foo(object): attribute = "weeee" The following will import it using the hosting API (written in Python because I don't have the SL tools installed at the moment): code = """ import something """ runtime = DynamicApplication.Current.Runtime; engine = runtime.GetEngine("Python") scope = engine.CreateScope() script = engine.CreateScriptSourceFromString(code, SourceCodeKind.Statements) script.Execute(scope) scope.something.Foo.attribute # => weeee Here's a repro of the behavior (run with script/server) http://jimmy.schementi.com/silverlight/sl-py-import.zip > If the code shown below *genuinely* gets a reference to the current engine then shouldn't the search path be setup already? No, unfortunately the search path is set by DynamicApplication.InitializeDLR, which is only called when DynamicApplication is doing the code execution. I can make the search path be set in DynamicApplication.CreateRuntimeSetup, and then this should work fine. So even if you get DynamicApplication.Current.Runtime, if DynamicApplication hasn't run DLR code yet (which would be the case in a C#/VB hosted environment) you'll need to do: runtime.Setup.Options["SearchPaths"] = new string[] { String.Empty }; The above example doesn't need this since it's written in Python, so DynamicApplication has run code and the search path has already been set. I can verify this works from C# as well, but let me know if you still have problems. Was there any other SL questions you had? I have a bunch of emails starred but I'm not sure if they were all about this. ~Jimmy -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Sunday, May 17, 2009 8:27 AM To: Discussion of IronPython Subject: Re: [IronPython] Access to current Python engine in C# (Silverlight) Jimmy - did you get a chance to look at this? If the code shown below *genuinely* gets a reference to the current engine then shouldn't the search path be setup already? Can you see what is wrong with the code below? Thanks Michael Michael Foord wrote: > Hello guys, > > I have a second use case for embedding IronPython in Silverlight. This > is actually a dynamic application with a C# component that needs to > programattically build a Python module. > > Again I have the same problem - imports in Python code fail. I would > have expected that accessing the current runtime and fetching a Python > engine would fetch the current Python engine, with the browser host > correctly setup. Unfortunately that seems not to be the case. Can > anyone spot problems with the following code: > > > using Microsoft.Scripting.Silverlight; using IronPython; using > IronPython.Hosting; using Microsoft.Scripting; using > Microsoft.Scripting.Hosting; > > namespace EmbeddedSLModule > { > public class EmbeddedSLModule > { > private static string source = @" > import something > "; > public static ScriptScope GetModule(){ > ScriptRuntime runtime = DynamicApplication.Current.Runtime; > ScriptEngine engine = runtime.GetEngine("Python"); > ScriptScope scope = engine.CreateScope(); > ScriptSource script = > engine.CreateScriptSourceFromString(source, SourceCodeKind.Statements); > script.Execute(scope); > > return scope; > > } > } > } > > > It works fine for code that doesn't import anything - but imports from > within the xap file fail. > > Thanks > > Michael Foord > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From curt at hagenlocher.org Thu Jun 4 23:21:33 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 4 Jun 2009 14:21:33 -0700 Subject: [IronPython] CallTarget0 problem In-Reply-To: <4A2820CF.8000404@voidspace.org.uk> References: <1c2a2c590906041042g576d9c23pe1e549e66f82f03c@mail.gmail.com> <4A2820CF.8000404@voidspace.org.uk> Message-ID: On Thu, Jun 4, 2009 at 12:30 PM, Michael Foord wrote: > > A while ago there were changes to CallTarget0 that made it > incompatible with .NET methods that have a void return signature. > Dino told me he would change it back so it would work again, > but I guess that didn't happen... I believe it's in 2.6 (and possibly 2.0.2). -- Curt Hagenlocher curt at hagenlocher.org From fuzzyman at voidspace.org.uk Thu Jun 4 23:22:39 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 04 Jun 2009 22:22:39 +0100 Subject: [IronPython] CallTarget0 problem In-Reply-To: References: <1c2a2c590906041042g576d9c23pe1e549e66f82f03c@mail.gmail.com> <4A2820CF.8000404@voidspace.org.uk> Message-ID: <4A283B1F.50702@voidspace.org.uk> Curt Hagenlocher wrote: > On Thu, Jun 4, 2009 at 12:30 PM, Michael Foord > wrote: > >> A while ago there were changes to CallTarget0 that made it >> incompatible with .NET methods that have a void return signature. >> Dino told me he would change it back so it would work again, >> but I guess that didn't happen... >> > > I believe it's in 2.6 (and possibly 2.0.2). > :-) Michael > -- > Curt Hagenlocher > curt at hagenlocher.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/blog From fuzzyman at voidspace.org.uk Thu Jun 4 23:27:39 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 04 Jun 2009 22:27:39 +0100 Subject: [IronPython] Access to current Python engine in C# (Silverlight) In-Reply-To: <0047ECBFA2E0DF4A834AA369282A5AFC1362C47E@tk5ex14mbxc105.redmond.corp.microsoft.com> References: <4A0581F2.6010603@voidspace.org.uk> <4A102CD2.40108@voidspace.org.uk> <0047ECBFA2E0DF4A834AA369282A5AFC1362C47E@tk5ex14mbxc105.redmond.corp.microsoft.com> Message-ID: <4A283C4B.1010909@voidspace.org.uk> Jimmy Schementi wrote: >> Jimmy - did you get a chance to look at this? >> > > Yes, sorry for the wait. Given something.py: > > class Foo(object): > attribute = "weeee" > > The following will import it using the hosting API (written in Python because I don't have the SL tools installed at the moment): > > code = """ > import something > """ > runtime = DynamicApplication.Current.Runtime; > > engine = runtime.GetEngine("Python") > scope = engine.CreateScope() > script = engine.CreateScriptSourceFromString(code, SourceCodeKind.Statements) > script.Execute(scope) > scope.something.Foo.attribute > # => weeee > > Here's a repro of the behavior (run with script/server) > http://jimmy.schementi.com/silverlight/sl-py-import.zip > > Code basically identical to this but in C# fails on the import. This is even when the C# code is actually being called *from* Python - so the DLR has definitely already executed some Python code. >> If the code shown below *genuinely* gets a reference to the current engine then shouldn't the search path be setup already? >> > > No, unfortunately the search path is set by DynamicApplication.InitializeDLR, which is only called when DynamicApplication is doing the code execution. I can make the search path be set in DynamicApplication.CreateRuntimeSetup, and then this should work fine. So even if you get DynamicApplication.Current.Runtime, if DynamicApplication hasn't run DLR code yet (which would be the case in a C#/VB hosted environment) you'll need to do: > > runtime.Setup.Options["SearchPaths"] = new string[] { String.Empty }; > > I'll try this. As I mentioned I assumed that an already initialised engine (that had already executed Python code) would not need it. > The above example doesn't need this since it's written in Python, so DynamicApplication has run code and the search path has already been set. I can verify this works from C# as well, but let me know if you still have problems. > > Was there any other SL questions you had? I have a bunch of emails starred but I'm not sure if they were all about this. > > The other scenario in which import doesn't work is the following code: using System; using System.Collections.Generic; using System.Text; using IronPython.Hosting; using IronPython.Runtime; using IronPython.Runtime.Types; using Microsoft.Scripting; using Microsoft.Scripting.Hosting; using Microsoft.Scripting.Runtime; namespace ExecutePython { public class ExecutePython { static string code = @" class Foo(object): attribute = 'weeeee' "; public static Scope CreateModule(CodeContext context) { PythonContext python = PythonContext.GetContext(context); PythonDictionary globals = new PythonDictionary(); globals["__name__"] = "AModule"; Scope module = new Scope(globals); SourceUnit script = python.CreateSnippet(code, SourceCodeKind.Statements); script.Execute(module); return module; } } } Michael Foord > ~Jimmy > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Sunday, May 17, 2009 8:27 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Access to current Python engine in C# (Silverlight) > > Jimmy - did you get a chance to look at this? > > If the code shown below *genuinely* gets a reference to the current engine then shouldn't the search path be setup already? > > Can you see what is wrong with the code below? > > Thanks > > Michael > > Michael Foord wrote: > >> Hello guys, >> >> I have a second use case for embedding IronPython in Silverlight. This >> is actually a dynamic application with a C# component that needs to >> programattically build a Python module. >> >> Again I have the same problem - imports in Python code fail. I would >> have expected that accessing the current runtime and fetching a Python >> engine would fetch the current Python engine, with the browser host >> correctly setup. Unfortunately that seems not to be the case. Can >> anyone spot problems with the following code: >> >> >> using Microsoft.Scripting.Silverlight; using IronPython; using >> IronPython.Hosting; using Microsoft.Scripting; using >> Microsoft.Scripting.Hosting; >> >> namespace EmbeddedSLModule >> { >> public class EmbeddedSLModule >> { >> private static string source = @" >> import something >> "; >> public static ScriptScope GetModule(){ >> ScriptRuntime runtime = DynamicApplication.Current.Runtime; >> ScriptEngine engine = runtime.GetEngine("Python"); >> ScriptScope scope = engine.CreateScope(); >> ScriptSource script = >> engine.CreateScriptSourceFromString(source, SourceCodeKind.Statements); >> script.Execute(scope); >> >> return scope; >> >> } >> } >> } >> >> >> It works fine for code that doesn't import anything - but imports from >> within the xap file fail. >> >> Thanks >> >> Michael Foord >> >> > > > -- > http://www.ironpythoninaction.com/ > http://www.voidspace.org.uk/blog > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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/blog From jdhardy at gmail.com Fri Jun 5 05:34:16 2009 From: jdhardy at gmail.com (Jeff Hardy) Date: Thu, 4 Jun 2009 21:34:16 -0600 Subject: [IronPython] IronPython 2.6 and .NET 4.0 (and the GAC) In-Reply-To: References: Message-ID: On Tue, Jun 2, 2009 at 10:48 AM, Dave Fugate wrote: > I think it's a safe bet that when the final version of .NET 4.0 is released we'll either: > * re-release the latest final version of IronPython against it. ?If .NET 4.0 had already shipped today, this would end up being "IronPython 2.0.1 for .NET 4.0" > * release the next version of IronPython (e.g., IP 2.7/3.x Alpha/Beta/etc) against it > In any event, we definitely plan on shipping something built against .NET 4.0 that doesn't contain "Community Technology Preview" in the title. > > Until the final version of .NET 4.0 ships, expect more preview releases of IronPython for .NET 4.0. OK, cool. I'm working on a version of NWSGI for .NET 4 and wanted to make sure it was worthwhile right now. > > As for your question about adding IronPython assemblies to the GAC, ?I'm not aware of any extra requirements offhand. ?Maybe Dino knows... > See http://lists.ironpython.com/pipermail/users-ironpython.com/2008-October/008698.html. Curt doesn;t mention anything specific, though. - Jeff From merllab at microsoft.com Fri Jun 5 17:52:30 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Fri, 5 Jun 2009 08:52:30 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <8a2037f9-296a-4c05-a463-b635c68800ac@tk5-exsmh-c102.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/54033. ADDED SOURCES $/IronPython/IronPython_Main/Src/Tests/DlrComLibrary/IndexedProp.cpp $/IronPython/IronPython_Main/Src/Tests/DlrComLibrary/IndexedProp.h $/IronPython/IronPython_Main/Src/Tests/DlrComLibrary/IndexedProp.rgs MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Binary.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/IDispatchMetaObject.cs $/IronPython/IronPython_Main/Src/Tests/DlrComLibrary/DlrComLibrary.idl $/IronPython/IronPython_Main/Src/Tests/DlrComLibrary/IndexedProp.cpp $/IronPython/IronPython_Main/Src/Tests/DlrComLibrary/IndexedProp.h $/IronPython/IronPython_Main/Src/Tests/DlrComLibrary/DlrComLibrary.rc $/IronPython/IronPython_Main/Src/Tests/DlrComLibrary/DlrComLibrary.vcproj $/IronPython/IronPython_Main/Src/Tests/DlrComLibrary/IndexedProp.rgs $/IronPython/IronPython_Main/Src/Tests/DlrComLibrary/Resource.h From ddicato at microsoft.com Fri Jun 5 23:53:08 2009 From: ddicato at microsoft.com (David DiCato) Date: Fri, 5 Jun 2009 14:53:08 -0700 Subject: [IronPython] Debugging IronPython scripts + simulate a filename when loading a string In-Reply-To: <574428130906031059x664eabes21596f49ce75862b@mail.gmail.com> References: <574428130906031059x664eabes21596f49ce75862b@mail.gmail.com> Message-ID: Hi Patrick, I'm in the process of looking into this for you. As you mentioned, the traceback module (e.g. traceback.print_exc()) is the way to go, and it should work in 2.6. Which version of IronPython are you using? As a temporary workaround, you can use the sys module to get most of the same functionality; traceback.py is essentially just a pretty-printer for the information provided by sys.exc_info. For example, to print the stack trace to stderr, you can mimic the interpreter: import sys try: except: sys.excepthook(*sys.except_info()) To load a string as its own module, it is necessary to mimic the behavior of the importer, except that the code is already in memory. You'll want something akin to the following helper function: import imp def import_string(modulename, filename, source): code_obj = compile(source, filename, 'exec') scope = imp.new_module(modulename) exec(code_obj, scope.__dict__) return scope This should provide the proper filename/lineno debugging information, for example: >>> my_module = import_string('my_module ', '\\my_module.py ', '\n\n\ndef err():\n raise SystemError\n\n') >>> my_module.err() Traceback (most recent call last): File "", line 1, in File "\my_module.py ", line 5, in err SystemError Best of luck! - David From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Patrick Desch?nes Sent: Wednesday, June 03, 2009 10:59 AM To: users at lists.ironpython.com Subject: [IronPython] Debugging IronPython scripts + simulate a filename when loading a string Hi, I'm currently using IronPython to develop extensions to my program. My python scripts are compressed in a zip file along with other resources. Everything works fine but I would be very happy if I could find a simple way to debug my scripts. I don't want anything complex for now. If I could only do something like this : try: bugged code except: print debug.stack.filename + " : " debug.stack.lineno It would be perfect. I looked for the traceback module but it doesn't seems to work with IronPython. Also, since I load my script from a zip file, is there a way to simulate a filename when loading a string. So, if I could : a) load a string as if it was a file b) intercept the filename/linenum in the catch block That would be a huge improvement. - Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From rsaat at usa.com Mon Jun 8 04:25:32 2009 From: rsaat at usa.com (Ricardo) Date: Sun, 07 Jun 2009 23:25:32 -0300 Subject: [IronPython] Emulating numeric type in C# or VB.net , __radd__ is not called Message-ID: <4A2C769C.2070302@usa.com> I testing IronPython 2.0 and trying to integrate with my VB.NET application. I would like to create an object to emulate a numeric type implementing the functions *__add__, **__radd__ , **__sub__ , **__rsub__ , etc *as explained in Python manual http://www.python.org/doc/2.5.2/ref/numeric-types.html I would like to create this emulated object inside my vb.net application and import this object from a python code like the example below #IronPython code #Vb.NET object from IronPytonTest import TestNumericObject # My numeric object with value 1 test=TestNumericObject(1) print float(test+1) #print 2 ( 1 + 1 ) OK , It?s called the function __add__ from my vb code print float(test+test) #print 2 ( test + test = 1+1 ) OK , It?s called the function __add__ from my vb code print float(1+test) # Error: Microsoft.Scripting.ArgumentTypeException: unsupported operand type(s) for +: 'int' and 'TestNumericObject' #__radd__ function is not called Below is my vb code , basically I implemented the functions __radd__, __add__ in my vb.net code and trying to sum my objects inside python, but __radd__ is not called. Public Class TestNumericObject Sub New(ByVal value As Double) m_value = value End Sub Private m_value As Double Public ReadOnly Property Value() As Double Get Return m_value End Get End Property Public Function __float__() As Double Return m_value End Function Public Function __add__(ByVal other As Object) As TestNumericObject Dim v As Double If TypeOf other Is TestNumericObject Then v = CType(other, TestNumericObject).m_value Else v = CDbl(other) End If Dim o As New TestNumericObject(0) o.m_value = Me.m_value + v Return o End Function Public Function __radd__(ByVal other As Object) As TestNumericObject Dim v As Double If TypeOf other Is TestNumericObject Then v = CType(other, TestNumericObject).m_value Else v = CDbl(other) End If Dim o As New TestNumericObject(0) o.m_value = Me.m_value + v Return o End Function End Class -------------- next part -------------- An HTML attachment was scrubbed... URL: From merllab at microsoft.com Mon Jun 8 17:52:46 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Mon, 8 Jun 2009 08:52:46 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <0abe1616-3a60-49b0-a0bc-9eeedb2c0e22@tk5-exsmh-c101.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/54235. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/MetaPythonType.Members.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/BuiltinFunction.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonTypeOps.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/DefaultBinder.SetMember.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/NewTypeMaker.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/TypeInfo.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/ReflectedProperty.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/SetMemberBinderHelper.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Generation/CompilerHelpers.cs From itssivaguru at gmail.com Mon Jun 8 18:32:15 2009 From: itssivaguru at gmail.com (Sivaguru Perambalam) Date: Mon, 8 Jun 2009 12:32:15 -0400 Subject: [IronPython] How to insert or embed a html file in to a Word doc ? Message-ID: <12604cb0906080932o377b8e0cy6aca336c9ac57273@mail.gmail.com> Hello, I am trying to embed a html file (a report as a result of an sql query ) in to a word document in a particular location. I am trying to get this done using the OfficeInterop & Iron Python 2.x. 1) How can I embed a html file in to a word document ? 2) How can I embed it on to a location by replacing a token in the Word doc. Eg . The word file would have a token . The HTML file has to be embedded in the place where This token is . Thanks ! -------------- next part -------------- An HTML attachment was scrubbed... URL: From empirebuilder at gmail.com Mon Jun 8 20:09:25 2009 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Mon, 8 Jun 2009 21:09:25 +0300 Subject: [IronPython] How to insert or embed a html file in to a Word doc ? In-Reply-To: <12604cb0906080932o377b8e0cy6aca336c9ac57273@mail.gmail.com> References: <12604cb0906080932o377b8e0cy6aca336c9ac57273@mail.gmail.com> Message-ID: <8cd017b80906081109y24f5c36ena21b6ded73fea668@mail.gmail.com> I recommend you to use http://invoke.co.nz/products/help/docx.aspx library. Parsing .docx xml is by hand will waste a lot of your time. Dody G. On Mon, Jun 8, 2009 at 7:32 PM, Sivaguru Perambalam wrote: > Hello, > > I am trying to embed a html file (a report as a result of an sql query ) in > to a word document in a particular location. > I am trying to get this done using the OfficeInterop & Iron Python 2.x. > > 1) How can I embed a html file in to a word document ? > 2) How can I embed it on to a location by replacing a token in the Word > doc. Eg . The word file would have a token . The HTML file has > to be embedded in the place where This token is . > > Thanks ! > _______________________________________________ > 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 larry.danberger at Nubium.com Mon Jun 8 20:27:27 2009 From: larry.danberger at Nubium.com (Larry Danberger) Date: Mon, 8 Jun 2009 12:27:27 -0600 Subject: [IronPython] How to reference List objects? Message-ID: <006f01c9e866$c6996660$53cc3320$@danberger@Nubium.com> Hi all, I'm new to Python and IronPython, sorry if this is obvious. I haven't found answer searching web or in IronPython In Action book... I have embedded IronPython into silverlight app for scripting, which is working (wow! Btw). I use scope.SetVariable for dictionaries which works as expected. However when passing in a list I am unable to access the objects within a list. For the example below when trying x = books[0].Name I get TypeError: 'List[books]' object is unsubscriptable If I do x = books I get back System.Collections.Generic.List'1[testapp.PythonEngine+book] If I do Len(books) I get back 4. How do I access them individually (by name etc.)? My code looks something like this: Class book { int ID { get; set; } String Name { get; set; } String Author { get; set; } String Description { get; set; } } ... List _books = new List(); _books.Add(new book { ID=1, Name="book1", Author="author1", Description="Description1"}); _books.Add(new book { ID=2, Name="book2", Author="author2", Description="Description2"}); _books.Add(new book { ID=3, Name="book3", Author="author3", Description="Description3"}); _books.Add(new book { ID=4, Name="book4", Author="author4", Description="Description4"}); ... _scope.SetVariable("books", _books); Any help appreciated, thanks! -Larry From ddicato at microsoft.com Mon Jun 8 20:45:49 2009 From: ddicato at microsoft.com (David DiCato) Date: Mon, 8 Jun 2009 11:45:49 -0700 Subject: [IronPython] How to insert or embed a html file in to a Word doc ? In-Reply-To: <12604cb0906080932o377b8e0cy6aca336c9ac57273@mail.gmail.com> References: <12604cb0906080932o377b8e0cy6aca336c9ac57273@mail.gmail.com> Message-ID: This is more a question about the Office/Word APIs than anything IronPython-specific, so I'd point you to http://msdn.microsoft.com/en-us/library/bb243297.aspx as a starting point. As far as I know, you can't embed arbitrary files in a Word document, so I'd recommend converting your HTML to a Word doc and embedding that. As far as using your token, I would start with the search/replace APIs mentioned here: http://msdn.microsoft.com/en-us/library/f65x8z3d.aspx. Hope this helps! - David From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sivaguru Perambalam Sent: Monday, June 08, 2009 9:32 AM To: users at lists.ironpython.com Subject: [IronPython] How to insert or embed a html file in to a Word doc ? Hello, I am trying to embed a html file (a report as a result of an sql query ) in to a word document in a particular location. I am trying to get this done using the Office Interop & Iron Python 2.x. 1) How can I embed a html file in to a word document ? 2) How can I embed it on to a location by replacing a token in the Word doc. Eg . The word file would have a token . The HTML file has to be embedded in the place where This token is . Thanks ! -------------- next part -------------- An HTML attachment was scrubbed... URL: From itssivaguru at gmail.com Mon Jun 8 21:21:21 2009 From: itssivaguru at gmail.com (Sivaguru Perambalam) Date: Mon, 8 Jun 2009 15:21:21 -0400 Subject: [IronPython] How to insert or embed a html file in to a Word doc ? In-Reply-To: <12604cb0906080932o377b8e0cy6aca336c9ac57273@mail.gmail.com> References: <12604cb0906080932o377b8e0cy6aca336c9ac57273@mail.gmail.com> Message-ID: <12604cb0906081221g57fca915u33e306e890f2e007@mail.gmail.com> Update : Figured out the solution for the 1st question (embedding the html file in to a Word Doc, part ) . *BUT, I am still in need of answer for my Question 2.* Thanks! On Mon, Jun 8, 2009 at 12:32 PM, Sivaguru Perambalam wrote: > Hello, > > I am trying to embed a html file (a report as a result of an sql query ) in > to a word document in a particular location. > I am trying to get this done using the OfficeInterop & Iron Python 2.x. > > 1) How can I embed a html file in to a word document ? > 2) How can I embed it on to a location by replacing a token in the Word > doc. Eg . The word file would have a token . The HTML file has > to be embedded in the place where This token is . > > Thanks ! -------------- next part -------------- An HTML attachment was scrubbed... URL: From jregele23 at gmail.com Mon Jun 8 22:30:11 2009 From: jregele23 at gmail.com (Justin Regele) Date: Mon, 8 Jun 2009 13:30:11 -0700 Subject: [IronPython] How to reference List objects? In-Reply-To: <-2784051105984027253@unknownmsgid> References: <-2784051105984027253@unknownmsgid> Message-ID: <8429660906081330t2310b962o5e50f5fe94cd77c7@mail.gmail.com> Type Errors where the object is unscriptable means that it does not have any indices intialized. Use the python interactive interpreter to play around with list methods, and see how they work correctly. This is one of pythons best weapons. if you don't know what objects are in a module, or what attributes/methods are in a class type in dir() and it will spell it out for you. you do need to initialize a list before access, however. so you CANT do this x = [] x[0] = 'something' you would have to do this(making a list of 10 None objects) x = [None] * 10 x[0] = 'something' OR use the append() method to make the list more like a dynamic array x = [] x.append('something') this is the python way of doing it, but i'm not sure why you need a .NET list array. On Mon, Jun 8, 2009 at 11:27 AM, Larry Danberger wrote: > Hi all, > I'm new to Python and IronPython, sorry if this is obvious. I haven't > found > answer searching web or in IronPython In Action book... > > I have embedded IronPython into silverlight app for scripting, which is > working (wow! Btw). I use scope.SetVariable for dictionaries which works > as > expected. > > However when passing in a list I am unable to access the objects within a > list. > For the example below when trying > x = books[0].Name > I get > TypeError: 'List[books]' object is unsubscriptable > > If I do > x = books > I get back > System.Collections.Generic.List'1[testapp.PythonEngine+book] > > If I do > Len(books) > I get back 4. > > How do I access them individually (by name etc.)? > > My code looks something like this: > > Class book > { > int ID { get; set; } > String Name { get; set; } > String Author { get; set; } > String Description { get; set; } > } > > ... > List _books = new List(); > > _books.Add(new book { ID=1, Name="book1", Author="author1", > Description="Description1"}); > _books.Add(new book { ID=2, Name="book2", Author="author2", > Description="Description2"}); > _books.Add(new book { ID=3, Name="book3", Author="author3", > Description="Description3"}); > _books.Add(new book { ID=4, Name="book4", Author="author4", > Description="Description4"}); > > ... > _scope.SetVariable("books", _books); > > > Any help appreciated, thanks! > -Larry > > _______________________________________________ > 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 8 22:32:50 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 08 Jun 2009 21:32:50 +0100 Subject: [IronPython] How to reference List objects? In-Reply-To: <8429660906081330t2310b962o5e50f5fe94cd77c7@mail.gmail.com> References: <-2784051105984027253@unknownmsgid> <8429660906081330t2310b962o5e50f5fe94cd77c7@mail.gmail.com> Message-ID: <4A2D7572.9090608@voidspace.org.uk> Justin Regele wrote: > Type Errors where the object is unscriptable means that it does not > have any indices intialized. > > Use the python interactive interpreter to play around with list > methods, and see how they work correctly. This is one of pythons best > weapons. if you don't know what objects are in a module, or what > attributes/methods are in a class type in dir() > and it will spell it out for you. > > you do need to initialize a list before access, however. > so you CANT do this > > x = [] > x[0] = 'something' > > you would have to do this(making a list of 10 None objects) > x = [None] * 10 > x[0] = 'something' > > OR use the append() method to make the list more like a dynamic array > > x = [] > x.append('something') > > this is the python way of doing it, but i'm not sure why you need a > .NET list array. He is creating the list from C# and making it available to Python code. As far as I can tell he is doing it right, although maybe the fact that his C# book class is private is interfering with it? Michael > > On Mon, Jun 8, 2009 at 11:27 AM, Larry Danberger > > wrote: > > Hi all, > I'm new to Python and IronPython, sorry if this is obvious. I > haven't found > answer searching web or in IronPython In Action book... > > I have embedded IronPython into silverlight app for scripting, > which is > working (wow! Btw). I use scope.SetVariable for dictionaries > which works as > expected. > > However when passing in a list I am unable to access the objects > within a > list. > For the example below when trying > x = books[0].Name > I get > TypeError: 'List[books]' object is unsubscriptable > > If I do > x = books > I get back > System.Collections.Generic.List'1[testapp.PythonEngine+book] > > If I do > Len(books) > I get back 4. > > How do I access them individually (by name etc.)? > > My code looks something like this: > > Class book > { > int ID { get; set; } > String Name { get; set; } > String Author { get; set; } > String Description { get; set; } > } > > ... > List _books = new List(); > > _books.Add(new book { ID=1, Name="book1", Author="author1", > Description="Description1"}); > _books.Add(new book { ID=2, Name="book2", Author="author2", > Description="Description2"}); > _books.Add(new book { ID=3, Name="book3", Author="author3", > Description="Description3"}); > _books.Add(new book { ID=4, Name="book4", Author="author4", > Description="Description4"}); > > ... > _scope.SetVariable("books", _books); > > > Any help appreciated, thanks! > -Larry > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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/blog From jregele23 at gmail.com Mon Jun 8 22:55:59 2009 From: jregele23 at gmail.com (Justin Regele) Date: Mon, 8 Jun 2009 13:55:59 -0700 Subject: [IronPython] How to reference List objects? In-Reply-To: <4A2D7572.9090608@voidspace.org.uk> References: <-2784051105984027253@unknownmsgid> <8429660906081330t2310b962o5e50f5fe94cd77c7@mail.gmail.com> <4A2D7572.9090608@voidspace.org.uk> Message-ID: <8429660906081355y50f3f0b9p22d37cffc567fdc7@mail.gmail.com> Ah, I see. Would a python list then need to be called the way he is doing it, though. Is this a silverlight issue? I am wondering if he can just make a python list out of his Book C# class rather than exporting them as a list. I am sure there would be some performance issues, so maybe that is the reason for this way of doing it. Wondering about this error: System.Collections.Generic.List'1[testapp.PythonEngine+book] What does the '+' indicate? On Mon, Jun 8, 2009 at 1:32 PM, Michael Foord wrote: > Justin Regele wrote: > >> Type Errors where the object is unscriptable means that it does not have >> any indices intialized. >> >> Use the python interactive interpreter to play around with list methods, >> and see how they work correctly. This is one of pythons best weapons. if you >> don't know what objects are in a module, or what attributes/methods are in a >> class type in dir() and it will spell it out for you. >> >> you do need to initialize a list before access, however. >> so you CANT do this >> >> x = [] >> x[0] = 'something' >> >> you would have to do this(making a list of 10 None objects) >> x = [None] * 10 >> x[0] = 'something' >> >> OR use the append() method to make the list more like a dynamic array >> >> x = [] >> x.append('something') >> >> this is the python way of doing it, but i'm not sure why you need a .NET >> list array. >> > > He is creating the list from C# and making it available to Python code. As > far as I can tell he is doing it right, although maybe the fact that his C# > book class is private is interfering with it? > > Michael > > > >> On Mon, Jun 8, 2009 at 11:27 AM, Larry Danberger < >> larry.danberger at nubium.com > wrote: >> >> Hi all, >> I'm new to Python and IronPython, sorry if this is obvious. I >> haven't found >> answer searching web or in IronPython In Action book... >> >> I have embedded IronPython into silverlight app for scripting, >> which is >> working (wow! Btw). I use scope.SetVariable for dictionaries >> which works as >> expected. >> >> However when passing in a list I am unable to access the objects >> within a >> list. >> For the example below when trying >> x = books[0].Name >> I get >> TypeError: 'List[books]' object is unsubscriptable >> >> If I do >> x = books >> I get back >> System.Collections.Generic.List'1[testapp.PythonEngine+book] >> >> If I do >> Len(books) >> I get back 4. >> >> How do I access them individually (by name etc.)? >> >> My code looks something like this: >> >> Class book >> { >> int ID { get; set; } >> String Name { get; set; } >> String Author { get; set; } >> String Description { get; set; } >> } >> >> ... >> List _books = new List(); >> >> _books.Add(new book { ID=1, Name="book1", Author="author1", >> Description="Description1"}); >> _books.Add(new book { ID=2, Name="book2", Author="author2", >> Description="Description2"}); >> _books.Add(new book { ID=3, Name="book3", Author="author3", >> Description="Description3"}); >> _books.Add(new book { ID=4, Name="book4", Author="author4", >> Description="Description4"}); >> >> ... >> _scope.SetVariable("books", _books); >> >> >> Any help appreciated, thanks! >> -Larry >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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/blog > > > > _______________________________________________ > 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 8 23:01:40 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 8 Jun 2009 14:01:40 -0700 Subject: [IronPython] How to reference List objects? In-Reply-To: <8429660906081355y50f3f0b9p22d37cffc567fdc7@mail.gmail.com> References: <-2784051105984027253@unknownmsgid> <8429660906081330t2310b962o5e50f5fe94cd77c7@mail.gmail.com> <4A2D7572.9090608@voidspace.org.uk> <8429660906081355y50f3f0b9p22d37cffc567fdc7@mail.gmail.com> Message-ID: It indicates a nested class: class PythonEngine { class book { } } You can definitely interact with BCL generic List classes in this fashion: >>> from System.Collections.Generic import List >>> a = List[str]() >>> a.Add('abc') >>> a.Add('def') >>> a List[str](['abc', 'def']) >>> a[0] 'abc' >>> ^Z There are a number of subtle problems with the output text in the original report; was this typed in or copy-and-pasted? On Mon, Jun 8, 2009 at 1:55 PM, Justin Regele wrote: > Ah, I see. Would a python list then need to be called the way he is doing > it, though. Is this a silverlight issue? I am wondering if he can just make > a python list out of his Book C# class rather than exporting them as a list. > I am sure there would be some performance issues, so maybe that is the > reason for this way of doing it. > > Wondering about this error: > System.Collections.Generic.List'1[testapp.PythonEngine+book] > > What does the '+' indicate? > > > On Mon, Jun 8, 2009 at 1:32 PM, Michael Foord wrote: > >> Justin Regele wrote: >> >>> Type Errors where the object is unscriptable means that it does not have >>> any indices intialized. >>> >>> Use the python interactive interpreter to play around with list methods, >>> and see how they work correctly. This is one of pythons best weapons. if you >>> don't know what objects are in a module, or what attributes/methods are in a >>> class type in dir() and it will spell it out for you. >>> >>> you do need to initialize a list before access, however. >>> so you CANT do this >>> >>> x = [] >>> x[0] = 'something' >>> >>> you would have to do this(making a list of 10 None objects) >>> x = [None] * 10 >>> x[0] = 'something' >>> >>> OR use the append() method to make the list more like a dynamic array >>> >>> x = [] >>> x.append('something') >>> >>> this is the python way of doing it, but i'm not sure why you need a .NET >>> list array. >>> >> >> He is creating the list from C# and making it available to Python code. As >> far as I can tell he is doing it right, although maybe the fact that his C# >> book class is private is interfering with it? >> >> Michael >> >> >> >>> On Mon, Jun 8, 2009 at 11:27 AM, Larry Danberger < >>> larry.danberger at nubium.com > wrote: >>> >>> Hi all, >>> I'm new to Python and IronPython, sorry if this is obvious. I >>> haven't found >>> answer searching web or in IronPython In Action book... >>> >>> I have embedded IronPython into silverlight app for scripting, >>> which is >>> working (wow! Btw). I use scope.SetVariable for dictionaries >>> which works as >>> expected. >>> >>> However when passing in a list I am unable to access the objects >>> within a >>> list. >>> For the example below when trying >>> x = books[0].Name >>> I get >>> TypeError: 'List[books]' object is unsubscriptable >>> >>> If I do >>> x = books >>> I get back >>> System.Collections.Generic.List'1[testapp.PythonEngine+book] >>> >>> If I do >>> Len(books) >>> I get back 4. >>> >>> How do I access them individually (by name etc.)? >>> >>> My code looks something like this: >>> >>> Class book >>> { >>> int ID { get; set; } >>> String Name { get; set; } >>> String Author { get; set; } >>> String Description { get; set; } >>> } >>> >>> ... >>> List _books = new List(); >>> >>> _books.Add(new book { ID=1, Name="book1", Author="author1", >>> Description="Description1"}); >>> _books.Add(new book { ID=2, Name="book2", Author="author2", >>> Description="Description2"}); >>> _books.Add(new book { ID=3, Name="book3", Author="author3", >>> Description="Description3"}); >>> _books.Add(new book { ID=4, Name="book4", Author="author4", >>> Description="Description4"}); >>> >>> ... >>> _scope.SetVariable("books", _books); >>> >>> >>> Any help appreciated, thanks! >>> -Larry >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.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/blog >> >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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 ddicato at microsoft.com Mon Jun 8 23:11:58 2009 From: ddicato at microsoft.com (David DiCato) Date: Mon, 8 Jun 2009 14:11:58 -0700 Subject: [IronPython] Emulating numeric type in C# or VB.net , __radd__ is not called In-Reply-To: <4A2C769C.2070302@usa.com> References: <4A2C769C.2070302@usa.com> Message-ID: Hmm, the fact that we aren't picking up __radd__ properly looks like a bug, which I'll go ahead and log on CodePlex. The good news is that there's a more common usage pattern that works correctly. The canonical way to do this is to define + and - as static (Shared in VB speak) operator methods. These should automatically manifest themselves as __add__, __radd__, __sub__, and __rsub__ in IronPython. Specifically, I recommend trying something like this: Public Structure NumericObject ... ' This method should become __add__ Public Shared Operator +(ByVal self As NumericObject, ByVal other As Object) _ ... End Operator ' This method should become __radd__ Public Shared Operator +(ByVal other As Object, ByVal self As NumericObject) _ Return self + other End Operator ' Ditto with subtraction ... End Structure In addition, if you're only interested in adding/subtracting objects of the same type, you need only define each operator once: Public Structure NumericObject ... ' This method should become __add__ and __radd__ Public Shared Operator +(ByVal self As NumericObject, ByVal other As NumericObject) _ ... End Operator ' Ditto with subtraction ... End Structure I've only tested this in C# against IPy 2.6, so please let me know how it turns out. Good luck! - David From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ricardo Sent: Sunday, June 07, 2009 7:26 PM To: users at lists.ironpython.com Subject: [IronPython] Emulating numeric type in C# or VB.net , __radd__ is not called I testing IronPython 2.0 and trying to integrate with my VB.NET application. I would like to create an object to emulate a numeric type implementing the functions __add__, __radd__ , __sub__ , __rsub__ , etc as explained in Python manual http://www.python.org/doc/2.5.2/ref/numeric-types.html I would like to create this emulated object inside my vb.net application and import this object from a python code like the example below #IronPython code #Vb.NET object from IronPytonTest import TestNumericObject # My numeric object with value 1 test=TestNumericObject(1) print float(test+1) #print 2 ( 1 + 1 ) OK , It?s called the function __add__ from my vb code print float(test+test) #print 2 ( test + test = 1+1 ) OK , It?s called the function __add__ from my vb code print float(1+test) # Error: Microsoft.Scripting.ArgumentTypeException: unsupported operand type(s) for +: 'int' and 'TestNumericObject' #__radd__ function is not called Below is my vb code , basically I implemented the functions __radd__, __add__ in my vb.net code and trying to sum my objects inside python, but __radd__ is not called. Public Class TestNumericObject Sub New(ByVal value As Double) m_value = value End Sub Private m_value As Double Public ReadOnly Property Value() As Double Get Return m_value End Get End Property Public Function __float__() As Double Return m_value End Function Public Function __add__(ByVal other As Object) As TestNumericObject Dim v As Double If TypeOf other Is TestNumericObject Then v = CType(other, TestNumericObject).m_value Else v = CDbl(other) End If Dim o As New TestNumericObject(0) o.m_value = Me.m_value + v Return o End Function Public Function __radd__(ByVal other As Object) As TestNumericObject Dim v As Double If TypeOf other Is TestNumericObject Then v = CType(other, TestNumericObject).m_value Else v = CDbl(other) End If Dim o As New TestNumericObject(0) o.m_value = Me.m_value + v Return o End Function End Class -------------- next part -------------- An HTML attachment was scrubbed... URL: From larry.danberger at Nubium.com Tue Jun 9 03:06:55 2009 From: larry.danberger at Nubium.com (Larry Danberger) Date: Mon, 8 Jun 2009 19:06:55 -0600 Subject: [IronPython] How to reference List objects? In-Reply-To: References: <-2784051105984027253@unknownmsgid> <8429660906081330t2310b962o5e50f5fe94cd77c7@mail.gmail.com> <4A2D7572.9090608@voidspace.org.uk> <8429660906081355y50f3f0b9p22d37cffc567fdc7@mail.gmail.com> Message-ID: <00b701c9e89e$949a3260$bdce9720$@danberger@Nubium.com> Hi All, I switched from a list to a dictionary of dictionaries, and it works as I needed it. Don't know if that's a performance hit or not, but hey it works. ..and yes I was retyping and had two typos (good eye!), should have been TypeError: 'List[book]' object is unsubscriptable not 'List[books]' object is unsubscriptable, and my code declared the book class methods as public. Thank you all for your help. I'm sure this won't be my last question! -Larry -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Monday, June 08, 2009 3:02 PM To: Discussion of IronPython Subject: Re: [IronPython] How to reference List objects? It indicates a nested class: class PythonEngine { class book { } } You can definitely interact with BCL generic List classes in this fashion: >>> from System.Collections.Generic import List a = List[str]() >>> a.Add('abc') >>> a.Add('def') >>> a List[str](['abc', 'def']) >>> a[0] 'abc' >>> ^Z There are a number of subtle problems with the output text in the original report; was this typed in or copy-and-pasted? On Mon, Jun 8, 2009 at 1:55 PM, Justin Regele wrote: Ah, I see. Would a python list then need to be called the way he is doing it, though. Is this a silverlight issue? I am wondering if he can just make a python list out of his Book C# class rather than exporting them as a list. I am sure there would be some performance issues, so maybe that is the reason for this way of doing it. Wondering about this error: System.Collections.Generic. List'1[testapp.PythonEngine+book] What does the '+' indicate? On Mon, Jun 8, 2009 at 1:32 PM, Michael Foord wrote: Justin Regele wrote: Type Errors where the object is unscriptable means that it does not have any indices intialized. Use the python interactive interpreter to play around with list methods, and see how they work correctly. This is one of pythons best weapons. if you don't know what objects are in a module, or what attributes/methods are in a class type in dir() and it will spell it out for you. you do need to initialize a list before access, however. so you CANT do this x = [] x[0] = 'something' you would have to do this(making a list of 10 None objects) x = [None] * 10 x[0] = 'something' OR use the append() method to make the list more like a dynamic array x = [] x.append('something') this is the python way of doing it, but i'm not sure why you need a .NET list array. He is creating the list from C# and making it available to Python code. As far as I can tell he is doing it right, although maybe the fact that his C# book class is private is interfering with it? Michael On Mon, Jun 8, 2009 at 11:27 AM, Larry Danberger > wrote: Hi all, I'm new to Python and IronPython, sorry if this is obvious. I haven't found answer searching web or in IronPython In Action book... I have embedded IronPython into silverlight app for scripting, which is working (wow! Btw). I use scope.SetVariable for dictionaries which works as expected. However when passing in a list I am unable to access the objects within a list. For the example below when trying x = books[0].Name I get TypeError: 'List[books]' object is unsubscriptable If I do x = books I get back System.Collections.Generic.List'1[testapp.PythonEngine+book] If I do Len(books) I get back 4. How do I access them individually (by name etc.)? My code looks something like this: Class book { int ID { get; set; } String Name { get; set; } String Author { get; set; } String Description { get; set; } } ... List _books = new List(); _books.Add(new book { ID=1, Name="book1", Author="author1", Description="Description1"}); _books.Add(new book { ID=2, Name="book2", Author="author2", Description="Description2"}); _books.Add(new book { ID=3, Name="book3", Author="author3", Description="Description3"}); _books.Add(new book { ID=4, Name="book4", Author="author4", Description="Description4"}); ... _scope.SetVariable("books", _books); Any help appreciated, thanks! -Larry _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.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/blog _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.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 jregele23 at gmail.com Tue Jun 9 03:39:32 2009 From: jregele23 at gmail.com (Justin Regele) Date: Mon, 8 Jun 2009 18:39:32 -0700 Subject: [IronPython] How to reference List objects? In-Reply-To: <-8386784961218832313@unknownmsgid> References: <-2784051105984027253@unknownmsgid> <8429660906081330t2310b962o5e50f5fe94cd77c7@mail.gmail.com> <4A2D7572.9090608@voidspace.org.uk> <8429660906081355y50f3f0b9p22d37cffc567fdc7@mail.gmail.com> <-8386784961218832313@unknownmsgid> Message-ID: <8429660906081839k367d13d0x192f6f5473b29899@mail.gmail.com> Can C# objects implement iterable protocols? Maybe that is why he was getting the 'object is unscriptable' error. But good to know that it works. On Mon, Jun 8, 2009 at 6:06 PM, Larry Danberger wrote: > Hi All, > I switched from a list to a dictionary of dictionaries, and it works as I > needed it. Don't know if that's a performance hit or not, but hey it > works. > > ..and yes I was retyping and had two typos (good eye!), should have been > TypeError: 'List[book]' object is unsubscriptable not 'List[books]' > object is unsubscriptable, and my code declared the book class methods as > public. > > Thank you all for your help. I'm sure this won't be my last question! > > -Larry > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher > Sent: Monday, June 08, 2009 3:02 PM > To: Discussion of IronPython > Subject: Re: [IronPython] How to reference List objects? > > It indicates a nested class: > > class PythonEngine { > class book { > } > } > > You can definitely interact with BCL generic List classes in this fashion: > > >>> from System.Collections.Generic import List a = List[str]() > >>> a.Add('abc') > >>> a.Add('def') > >>> a > List[str](['abc', 'def']) > >>> a[0] > 'abc' > >>> ^Z > > There are a number of subtle problems with the output text in the original > report; was this typed in or copy-and-pasted? > > > On Mon, Jun 8, 2009 at 1:55 PM, Justin Regele wrote: > > > Ah, I see. Would a python list then need to be called the way he is > doing it, though. Is this a silverlight issue? I am wondering if he can > just > make a python list out of his Book C# class rather than exporting them as a > list. I am sure there would be some performance issues, so maybe that is > the > reason for this way of doing it. > > Wondering about this error: > > System.Collections.Generic. > List'1[testapp.PythonEngine+book] > > > What does the '+' indicate? > > > > On Mon, Jun 8, 2009 at 1:32 PM, Michael Foord > wrote: > > > Justin Regele wrote: > > > Type Errors where the object is unscriptable means > that it does not have any indices intialized. > > Use the python interactive interpreter to play > around with list methods, and see how they work correctly. This is one of > pythons best weapons. if you don't know what objects are in a module, or > what attributes/methods are in a class type in dir() > and it will spell it out for you. > > you do need to initialize a list before access, > however. > so you CANT do this > > x = [] > x[0] = 'something' > > you would have to do this(making a list of 10 None > objects) > x = [None] * 10 > x[0] = 'something' > > OR use the append() method to make the list more > like a dynamic array > > x = [] > x.append('something') > > this is the python way of doing it, but i'm not sure > why you need a .NET list array. > > > > He is creating the list from C# and making it available to > Python code. As far as I can tell he is doing it right, although maybe the > fact that his C# book class is private is interfering with it? > > Michael > > > > > > On Mon, Jun 8, 2009 at 11:27 AM, Larry Danberger > > wrote: > > Hi all, > I'm new to Python and IronPython, sorry if this > is obvious. I > haven't found > answer searching web or in IronPython In Action > book... > > I have embedded IronPython into silverlight app > for scripting, > which is > working (wow! Btw). I use scope.SetVariable for > dictionaries > which works as > expected. > > However when passing in a list I am unable to > access the objects > within a > list. > For the example below when trying > x = books[0].Name > I get > TypeError: 'List[books]' object is > unsubscriptable > > If I do > x = books > I get back > > System.Collections.Generic.List'1[testapp.PythonEngine+book] > > If I do > Len(books) > I get back 4. > > How do I access them individually (by name etc.)? > > My code looks something like this: > > Class book > { > int ID { get; set; } > String Name { get; set; } > String Author { get; set; } > String Description { get; set; } > } > > ... > List _books = new List(); > > _books.Add(new book { ID=1, Name="book1", > Author="author1", > Description="Description1"}); > _books.Add(new book { ID=2, Name="book2", > Author="author2", > Description="Description2"}); > _books.Add(new book { ID=3, Name="book3", > Author="author3", > Description="Description3"}); > _books.Add(new book { ID=4, Name="book4", > Author="author4", > Description="Description4"}); > > ... > _scope.SetVariable("books", _books); > > > Any help appreciated, thanks! > -Larry > > _______________________________________________ > Users mailing list > > Users at lists.ironpython.com > > > > http://lists.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/blog > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > > http://lists.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 jregele23 at gmail.com Tue Jun 9 03:43:32 2009 From: jregele23 at gmail.com (Justin Regele) Date: Mon, 8 Jun 2009 18:43:32 -0700 Subject: [IronPython] suddenly IronPython needs 2.0 SDK Message-ID: <8429660906081843i6001634fxd6722adc87d43566@mail.gmail.com> Last week I moved a python application into IronPython and under IronPython studio I was building and debugging and everything just worked. But today I was getting errors saying that Framework 2.0 was not found in my registry. ran regedit and yes, its not there. I have 3.5 installed. I downloaded the 2.0 sdk, and its installing right now, but why would there suddenly be a problem today? -------------- next part -------------- An HTML attachment was scrubbed... URL: From rsaat at usa.com Tue Jun 9 06:03:06 2009 From: rsaat at usa.com (robsp) Date: Mon, 8 Jun 2009 21:03:06 -0700 (PDT) Subject: [IronPython] Emulating numeric type in C# or VB.net , __radd__ is not called In-Reply-To: References: <4A2C769C.2070302@usa.com> Message-ID: <23936019.post@talk.nabble.com> Thank you for your help. I tested only __add__ and __radd__ with Ironpython 2.0 The method __add__ could be implemented using the following functions using VB Syntax: Public Shared Function __add__(ByVal Self As MyNumericObject, ByVal other As Object) As MyNumericObject Public Function __add__(ByVal other As Object) As MyNumericObject ' not static Public Shared Operator +(ByVal Self As MyNumericObject, ByVal other As Object) As MyNumericObject The method __radd__ could be implemented using the following functions using VB Syntax: Public Shared Operator +(ByVal other As Object, ByVal Self As MyNumericObject) As MyNumericObject Public Shared Function __radd__(ByVal other As Object, ByVal Self As MyNumericObject) As MyNumericObject The non static method does not work for __radd__. David DiCato wrote: > > Hmm, the fact that we aren't picking up __radd__ properly looks like a > bug, which I'll go ahead and log on CodePlex. The good news is that > there's a more common usage pattern that works correctly. > > The canonical way to do this is to define + and - as static (Shared in VB > speak) operator methods. These should automatically manifest themselves as > __add__, __radd__, __sub__, and __rsub__ in IronPython. Specifically, I > recommend trying something like this: > > Public Structure NumericObject > ... > > ' This method should become __add__ > Public Shared Operator +(ByVal self As NumericObject, ByVal other As > Object) _ > ... > End Operator > > ' This method should become __radd__ > Public Shared Operator +(ByVal other As Object, ByVal self As > NumericObject) _ > Return self + other > End Operator > > ' Ditto with subtraction > ... > End Structure > > In addition, if you're only interested in adding/subtracting objects of > the same type, you need only define each operator once: > > Public Structure NumericObject > ... > > ' This method should become __add__ and __radd__ > Public Shared Operator +(ByVal self As NumericObject, ByVal other As > NumericObject) _ > ... > End Operator > > ' Ditto with subtraction > ... > End Structure > > I've only tested this in C# against IPy 2.6, so please let me know how it > turns out. Good luck! > - David > > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ricardo > Sent: Sunday, June 07, 2009 7:26 PM > To: users at lists.ironpython.com > Subject: [IronPython] Emulating numeric type in C# or VB.net , __radd__ is > not called > > I testing IronPython 2.0 and trying to integrate with my VB.NET > application. > > I would like to create an object to emulate a numeric type implementing > the functions > __add__, __radd__ , __sub__ , __rsub__ , etc as explained in Python manual > > http://www.python.org/doc/2.5.2/ref/numeric-types.html > > I would like to create this emulated object inside my vb.net application > and import this object from a python code like the example below > > #IronPython code > > #Vb.NET object > from IronPytonTest import TestNumericObject > > # My numeric object with value 1 > test=TestNumericObject(1) > > print float(test+1) #print 2 ( 1 + 1 ) OK , It?s called the function > __add__ from my vb code > > print float(test+test) #print 2 ( test + test = 1+1 ) OK , It?s called the > function __add__ from my vb code > > print float(1+test) > # Error: Microsoft.Scripting.ArgumentTypeException: unsupported operand > type(s) for +: 'int' and 'TestNumericObject' > #__radd__ function is not called > > Below is my vb code , basically I implemented the functions __radd__, > __add__ in my vb.net code and trying to sum my objects inside python, > but __radd__ is not called. > > Public Class TestNumericObject > > Sub New(ByVal value As Double) > m_value = value > End Sub > > Private m_value As Double > Public ReadOnly Property Value() As Double > Get > Return m_value > End Get > End Property > > Public Function __float__() As Double > Return m_value > End Function > > Public Function __add__(ByVal other As Object) As TestNumericObject > Dim v As Double > If TypeOf other Is TestNumericObject Then > v = CType(other, TestNumericObject).m_value > Else > v = CDbl(other) > End If > Dim o As New TestNumericObject(0) > o.m_value = Me.m_value + v > Return o > End Function > > Public Function __radd__(ByVal other As Object) As TestNumericObject > Dim v As Double > If TypeOf other Is TestNumericObject Then > v = CType(other, TestNumericObject).m_value > Else > v = CDbl(other) > End If > Dim o As New TestNumericObject(0) > o.m_value = Me.m_value + v > Return o > End Function > > End Class > > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- View this message in context: http://www.nabble.com/Emulating-numeric-type-in--C--or-VB.net-%2C-__radd__-is-not-called-tp23917438p23936019.html Sent from the IronPython mailing list archive at Nabble.com. From empirebuilder at gmail.com Tue Jun 9 07:14:47 2009 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Tue, 9 Jun 2009 08:14:47 +0300 Subject: [IronPython] How to insert or embed a html file in to a Word doc ? In-Reply-To: <12604cb0906081221g57fca915u33e306e890f2e007@mail.gmail.com> References: <12604cb0906080932o377b8e0cy6aca336c9ac57273@mail.gmail.com> <12604cb0906081221g57fca915u33e306e890f2e007@mail.gmail.com> Message-ID: <8cd017b80906082214j7a2cfc2cw1963287131852e8@mail.gmail.com> Check the API for System.XML otherwise use Element Tree http://effbot.org/zone/element-index.htm On Mon, Jun 8, 2009 at 10:21 PM, Sivaguru Perambalam wrote: > Update : > > Figured out the solution for the 1st question (embedding the html file in > to a Word Doc, part ) . > > *BUT, I am still in need of answer for my Question 2.* > > Thanks! > > > On Mon, Jun 8, 2009 at 12:32 PM, Sivaguru Perambalam < > itssivaguru at gmail.com> wrote: > >> Hello, >> >> I am trying to embed a html file (a report as a result of an sql query ) >> in to a word document in a particular location. >> I am trying to get this done using the OfficeInterop & Iron Python 2.x. >> >> 1) How can I embed a html file in to a word document ? >> 2) How can I embed it on to a location by replacing a token in the Word >> doc. Eg . The word file would have a token . The HTML file has >> to be embedded in the place where This token is . >> >> Thanks ! > > > > _______________________________________________ > 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 merllab at microsoft.com Tue Jun 9 17:53:31 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Tue, 9 Jun 2009 08:53:31 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/54341. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Tests/Modes/ConsoleFlags.ps1 CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 935634 Date: 6/8/2009 10:01:18 AM (dfugate) Added sanity test for -X:NoAdaptiveCompilation. (Shelveset: NoAdaptiveCompilation_Sanity;REDMOND\dfugate | SNAP CheckinId: 8644) From fuzzyman at voidspace.org.uk Tue Jun 9 19:58:33 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 09 Jun 2009 18:58:33 +0100 Subject: [IronPython] __objclass__ Message-ID: <4A2EA2C9.5090703@voidspace.org.uk> Hello guys, All .NET classes used from IronPython have an __objclass__ attribute on their methods / members. This is *really* useful for introspection - can I rely on it staying or is it an implementation detail that may change? Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From sanxiyn at gmail.com Wed Jun 10 03:08:25 2009 From: sanxiyn at gmail.com (Seo Sanghyeon) Date: Wed, 10 Jun 2009 10:08:25 +0900 Subject: [IronPython] Fwd: [Mono-dev] Current 'xbuild' status In-Reply-To: References: Message-ID: <5b0248170906091808l765e5e0blefa84e9aae89e302@mail.gmail.com> FYI. From: Ankit Jain Date: 2009/6/10 Subject: [Mono-dev] Current 'xbuild' status Current xbuild status: It can handle solutions (.sln) now, thanks to Jonathan Chambers, with C#, VB.net projects. Handles embedded resources, satellite assemblies, project references etc. Eg. Paint.Net 3 ( builds completely with it now, IronPython (2.0.1) builds, IronPython svn (builds with compile time errors) etc. Only .net 2.0 projects are supported currently though. I will start adding support for newer versions very soon, also ASP.NET, Silverlight etc projects. This is part of the mono 2.4.2 release (http://mono.ximian.com/monobuild/preview/download-preview/) and is a *big* improvement over xbuild in the last release. Would be really helpful to get feedback and bug reports on this :) You can file bugs at : http://www.mono-project.com/Bugs -- Seo Sanghyeon From sanxiyn at gmail.com Wed Jun 10 04:34:21 2009 From: sanxiyn at gmail.com (Seo Sanghyeon) Date: Wed, 10 Jun 2009 11:34:21 +0900 Subject: [IronPython] __objclass__ In-Reply-To: <4A2EA2C9.5090703@voidspace.org.uk> References: <4A2EA2C9.5090703@voidspace.org.uk> Message-ID: <5b0248170906091934u7cf7c19dp2914f08d49b4da30@mail.gmail.com> 2009/6/10 Michael Foord : > All .NET classes used from IronPython have an __objclass__ attribute on > their methods / members. This is *really* useful for introspection - can I > rely on it staying or is it an implementation detail that may change? Since this is also a CPython behavior (although undocumented, or poorly documented one), it's unlikely to change. __objclass__ of a descriptor points to its class. C:\>python Python 2.6.1 >>> object.__repr__.__objclass__ -- Seo Sanghyeon From Tomas.Matousek at microsoft.com Wed Jun 10 08:11:20 2009 From: Tomas.Matousek at microsoft.com (Tomas Matousek) Date: Tue, 9 Jun 2009 23:11:20 -0700 Subject: [IronPython] Fwd: [Mono-dev] Current 'xbuild' status In-Reply-To: <5b0248170906091808l765e5e0blefa84e9aae89e302@mail.gmail.com> References: <5b0248170906091808l765e5e0blefa84e9aae89e302@mail.gmail.com> Message-ID: It would be great if we could also build IronRuby. It currently crashes: C:\M1\Merlin\Main\Languages\Ruby>"C:\Program Files\Mono-2.4.2\bin\xbuild.bat" Ruby.sln XBuild Engine Version 0.1 Mono, Version 2.4.2.0 Copyright (C) Marek Sieradzki 2005. All rights reserved. Unhandled Exception: System.ArgumentNullException: Argument cannot be null. Parameter name: path at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) [0x0 0000] at System.IO.StreamReader..ctor (System.String path) [0x00000] at (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string) at Microsoft.Build.BuildEngine.Project.Load (System.String projectFileName) [0x00000] at Microsoft.Build.BuildEngine.Engine.RegisterDefaultTasks () [0x00000] at Microsoft.Build.BuildEngine.Engine..ctor (System.String binPath) [0x00000] at Mono.XBuild.CommandLine.MainClass.Execute () [0x00000] Tomas -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Seo Sanghyeon Sent: Tuesday, June 09, 2009 6:08 PM To: Discussion of IronPython Subject: [IronPython] Fwd: [Mono-dev] Current 'xbuild' status FYI. From: Ankit Jain Date: 2009/6/10 Subject: [Mono-dev] Current 'xbuild' status Current xbuild status: It can handle solutions (.sln) now, thanks to Jonathan Chambers, with C#, VB.net projects. Handles embedded resources, satellite assemblies, project references etc. Eg. Paint.Net 3 ( builds completely with it now, IronPython (2.0.1) builds, IronPython svn (builds with compile time errors) etc. Only .net 2.0 projects are supported currently though. I will start adding support for newer versions very soon, also ASP.NET, Silverlight etc projects. This is part of the mono 2.4.2 release (http://mono.ximian.com/monobuild/preview/download-preview/) and is a *big* improvement over xbuild in the last release. Would be really helpful to get feedback and bug reports on this :) You can file bugs at : http://www.mono-project.com/Bugs -- Seo Sanghyeon _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kristian.jaksch at gmail.com Wed Jun 10 12:19:25 2009 From: kristian.jaksch at gmail.com (Kristian Jaksch) Date: Wed, 10 Jun 2009 12:19:25 +0200 Subject: [IronPython] Generate xap for SL when assemblies are located in sub-directory Message-ID: <1dab55500906100319m5dd642e2jae12de81ca52d967@mail.gmail.com> This works fine when the xap is generated in memory with /b from VS 2008 but how to make it work when creating a real app.xap file? What I have is this: root/app/dependencies chiron is located in the "root". The "app.py" is located in "app" and the assemblies are located in "dependencies". The following didn't work: chiron /d:app /r:app/dependencies /x:app.xap The .xap is generated but it can't be loaded. Thanks for help! -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Wed Jun 10 12:22:25 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 10 Jun 2009 11:22:25 +0100 Subject: [IronPython] Fwd: [Mono-dev] Current 'xbuild' status In-Reply-To: <5b0248170906091808l765e5e0blefa84e9aae89e302@mail.gmail.com> References: <5b0248170906091808l765e5e0blefa84e9aae89e302@mail.gmail.com> Message-ID: <4A2F8961.50107@voidspace.org.uk> Seo Sanghyeon wrote: > FYI. > > So IronPython 2.0.1 can now be compiled with Mono? Very cool. Does that mean we can expect a new FePy release? Michael > From: Ankit Jain > Date: 2009/6/10 > Subject: [Mono-dev] Current 'xbuild' status > > Current xbuild status: > > It can handle solutions (.sln) now, thanks to Jonathan Chambers, > with C#, VB.net projects. Handles embedded resources, satellite > assemblies, project references etc. > > Eg. Paint.Net 3 ( builds completely with it now, IronPython (2.0.1) > builds, IronPython svn (builds with compile time errors) etc. > > Only .net 2.0 projects are supported currently though. I will start > adding support for newer versions very soon, also ASP.NET, Silverlight > etc projects. > > This is part of the mono 2.4.2 release > (http://mono.ximian.com/monobuild/preview/download-preview/) > and is a *big* improvement over xbuild in the last release. > Would be really helpful to get feedback and bug reports on this :) > You can file bugs at : http://www.mono-project.com/Bugs > > -- http://www.ironpythoninaction.com/ From merllab at microsoft.com Wed Jun 10 17:52:32 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Wed, 10 Jun 2009 08:52:32 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/54434. DELETED SOURCES $/IronPython/IronPython_Main/Lib MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/DynamicMetaObjectBinder.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Utils/ExceptionFactory.Generated.cs From Jimmy.Schementi at microsoft.com Wed Jun 10 17:55:39 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Wed, 10 Jun 2009 15:55:39 +0000 Subject: [IronPython] Generate xap for SL when assemblies are located in sub-directory In-Reply-To: <1dab55500906100319m5dd642e2jae12de81ca52d967@mail.gmail.com> References: <1dab55500906100319m5dd642e2jae12de81ca52d967@mail.gmail.com> Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC1399222E@tk5ex14mbxc105.redmond.corp.microsoft.com> Replace the /x with /z: Chiron.exe /d:app /z:app.xap /r:app/dependencies Looking at Chiron.exe help: /x[ap]: Specifies XAP file to generate Does not start the web server, cannot be combined with /w or /b ... /z[ipdlr]: Like /x, but includes files needed for dynamic language apps Does not start the web server, cannot be combined with /w or /b Also, I'd move any DLR/IronPython binaries in the dependencies folder outside the app folder; Chiron will put the needed DLR/IronPython assemblies in the generated XAP for you. Seems like now you'll have two copies of assemblies in your XAP! =( The /r switch should not be needed then, and Chiron will find the DLR/Python assemblies if they are all in the same directory (as they should be for an installation of IronPython). This then allows you to set the urlPrefix Chiron.exe.config option to keep the assemblies outside the XAP, which will be better for deployment (if your domain allows transmission of DLLs). If you have other binary dependencies they should be inside the app folder. ~js From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kristian Jaksch Sent: Wednesday, June 10, 2009 3:19 AM To: users at lists.ironpython.com Subject: [IronPython] Generate xap for SL when assemblies are located in sub-directory This works fine when the xap is generated in memory with /b from VS 2008 but how to make it work when creating a real app.xap file? What I have is this: root/app/dependencies chiron is located in the "root". The "app.py" is located in "app" and the assemblies are located in "dependencies". The following didn't work: chiron /d:app /r:app/dependencies /x:app.xap The .xap is generated but it can't be loaded. Thanks for help! -------------- next part -------------- An HTML attachment was scrubbed... URL: From harri.vartiainen at iki.fi Wed Jun 10 21:52:35 2009 From: harri.vartiainen at iki.fi (Harri Vartiainen) Date: Wed, 10 Jun 2009 22:52:35 +0300 Subject: [IronPython] Checking syntax of source code without running it Message-ID: Hi, What's the best way to check syntax of IronPython source code without actually running it? I'd like to embed IronPython to application and make it as user friendly as possible, so all checking before running the code would be helpful. There are many options listed here for CPython: http://stackoverflow.com/questions/205704/how-can-i-check-the-syntax-of-python-code-in-emacs-without-actually-executing-it Next stop, debugging.. From curt at hagenlocher.org Thu Jun 11 00:15:07 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 10 Jun 2009 15:15:07 -0700 Subject: [IronPython] Checking syntax of source code without running it In-Reply-To: References: Message-ID: Through the hosting API, it's something like this: engine = IronPython.Hosting.Python.CreateEngine() source = engine.CreateScriptSourceFromString(text, SourceCodeKind.File) errors = ErrorListener() command = source.Compile(errors) if command is None: # compilation failed Here, ErrorListener is some class that derives from Microsoft.Scripting.Hosting.ErrorListener and stores the errors. On Wed, Jun 10, 2009 at 12:52 PM, Harri Vartiainen wrote: > Hi, > > What's the best way to check syntax of IronPython source code without > actually running it? > > I'd like to embed IronPython to application and make it as user > friendly as possible, so all checking before running the code would be > helpful. > > There are many options listed here for CPython: > > http://stackoverflow.com/questions/205704/how-can-i-check-the-syntax-of-python-code-in-emacs-without-actually-executing-it > > > > Next stop, debugging.. > _______________________________________________ > 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 Thu Jun 11 00:54:55 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 10 Jun 2009 15:54:55 -0700 Subject: [IronPython] suddenly IronPython needs 2.0 SDK In-Reply-To: <8429660906081843i6001634fxd6722adc87d43566@mail.gmail.com> References: <8429660906081843i6001634fxd6722adc87d43566@mail.gmail.com> Message-ID: Sounds strange. Did reinstallation of the SDK solve your problem? On Mon, Jun 8, 2009 at 6:43 PM, Justin Regele wrote: > Last week I moved a python application into IronPython and under IronPython > studio I was building and debugging and everything just worked. But today I > was getting errors saying that Framework 2.0 was not found in my registry. > ran regedit and yes, its not there. I have 3.5 installed. > > I downloaded the 2.0 sdk, and its installing right now, but why would there > suddenly be a problem today? > > _______________________________________________ > 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 jregele23 at gmail.com Thu Jun 11 03:04:56 2009 From: jregele23 at gmail.com (Justin Regele) Date: Wed, 10 Jun 2009 18:04:56 -0700 Subject: [IronPython] suddenly IronPython needs 2.0 SDK In-Reply-To: References: <8429660906081843i6001634fxd6722adc87d43566@mail.gmail.com> Message-ID: <8429660906101804o62acf9a8g4fd3b60dddbb13cc@mail.gmail.com> Yeah, everything suddenly worked again. On Wed, Jun 10, 2009 at 3:54 PM, Curt Hagenlocher wrote: > Sounds strange. Did reinstallation of the SDK solve your problem? > > On Mon, Jun 8, 2009 at 6:43 PM, Justin Regele wrote: > >> Last week I moved a python application into IronPython and under >> IronPython studio I was building and debugging and everything just worked. >> But today I was getting errors saying that Framework 2.0 was not found in my >> registry. ran regedit and yes, its not there. I have 3.5 installed. >> >> I downloaded the 2.0 sdk, and its installing right now, but why would >> there suddenly be a problem today? >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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 Thu Jun 11 15:42:22 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 11 Jun 2009 14:42:22 +0100 Subject: [IronPython] [Python.NET] Reasons to use ironpython In-Reply-To: <2311471F8507984BBFCCB85ABD03B06823D575149A@OFFC-MAIL01.office.iseoptions.com> References: <2311471F8507984BBFCCB85ABD03B06823D575149A@OFFC-MAIL01.office.iseoptions.com> Message-ID: <4A3109BE.3000200@voidspace.org.uk> Hello Matthew, Why send an email about IronPython to the Python.NET mailing list? (Sorry for multiple replies by the way - my client went bat-crazy on me.) Both Python and C# are 'general purpose' programming langugages suited to a wide range of problem domains. Choice of programming language is therefore *usually* a matter of aesthetics, what you are used to, personal workflow, issues within a team and so on rather than a matter of which is more appropriate to the job. Obviously there are exceptions where one language is obviously more appropriate or obviously inappropriate but these are the exception rather than the rule. Place where you should *obviously* use IronPython: * For embedding as a user scripting language / plugin mechanism or are doing runtime code generation Place where you should obviously use C#: * You have already implemented in a dynamic language, profiled and optimised, and *need* faster performance than the dynamic language is capable of Other than that the choice is yours! Reasons why I / some people prefer IronPython: * The interactive environment is an invaluable tool for exploration * No need to create a whole 'object-oriented-application' for simple tasks where it is not needed * Without a compile phase and with duck typing / dynamic typing IronPython makes it *dramatically* easier to do test driven development or even normal unit testing * Python has many language capabilities missing from C# which make it a flexible and concise language. These include: - Duck typing (no need for interfaces) - Heterogeneous containers (no need for generics) - Pain free introspection (no need for the complexity inherent in System.Reflection) - Metaprogramming including good old eval, type creation at runtime, decorators and descriptors - Late binding and runtime type dispatch - 'Little features' like tuple unpacking, returning multiple values, everything is an object (including primitives, functions, classes and modules) There are things that C# has that Python doesn't (compile time checking, method overloading, access to .NET attributes), but choose whichever you prefer. :-) Michael Harelick, Matthew wrote: > > Hi: > > My background is primarily UNIX. I have been programming in C, TCL, > Perl, and Python in UNIX and Linux for a long time. > > I recently started working in Visual Studio and C#. > > Visual Studio and C# make everything very easy. Python was nice when > you didn?t have the convenience of Visual Studio and intellisense with > a nice debugger. > > In the windows world I see no major reason not to use C#. > > Why would I want to use IronPython? > > Thanks > > Matthew Harelick > > ------------------------------------------------------------------------ > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet -- http://www.ironpythoninaction.com/ From patrick at toolmaker.nl Thu Jun 11 16:32:24 2009 From: patrick at toolmaker.nl (Patrick van der Willik) Date: Thu, 11 Jun 2009 16:32:24 +0200 Subject: [IronPython] Embedding IronPython and calling python functions from C# Message-ID: <4A311578.2000604@toolmaker.nl> I'm currently attempting to embed the IronPython 2 runtimes into an existing application written in C#. However, I find the amount of documentation lacking on what I'm trying to do. I currently have a proof-of-concept version which uses Lua and LuaInterface, but the people who have to write the scripts dislike Lua(Well, more hate it with a passion) and would love to see this working with Python. My host application is a networked application that must trigger certain scripts functions on events generated by the connected clients. The idea is that when my application starts, it will load the IronPython script environment, launches an 'autoexec.py' which will load various other scripts files and do some housekeeping. Once this all is completed, it will start listening to incoming connections. However, in various scenarios, the application has to trigger scripted functions when data is received from a client. Which script function is called is different per client and per event. I have events for connecting, logging on, disconnecting and a set of data specific events after receiving data. This highly depends on the received packets. My question here is: How do I embed IronPython in such a fashion that I can load my scripts and then trigger various functions within that? I've seen many examples that just call CreateScriptSourceFromString() or File each time in which just 1 piece of code is implemented. This is not suitable for the needs here because the scripted systems can become quite complex. With regards, Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From adamb at silverkeytech.com Thu Jun 11 16:34:48 2009 From: adamb at silverkeytech.com (Adam Brand) Date: Thu, 11 Jun 2009 07:34:48 -0700 Subject: [IronPython] VS Support/Intelllisense for IronPython Message-ID: <014b01c9eaa1$c5d49f50$517dddf0$@com> I was wondering if there is any ongoing development to support Intellisense with IronPython in Visual Studio. Can someone from the team comment on this? Thanks, Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From empirebuilder at gmail.com Thu Jun 11 18:08:46 2009 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Thu, 11 Jun 2009 19:08:46 +0300 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <4A311578.2000604@toolmaker.nl> References: <4A311578.2000604@toolmaker.nl> Message-ID: <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> You can read all yours file scripts, then using StringBuilder to combine then and call CreateScriptSourceFromString()Then you can call your functions within the combined scripts normally. Pretty much you are creating a giant source code on the fly. On Thu, Jun 11, 2009 at 5:32 PM, Patrick van der Willik < patrick at toolmaker.nl> wrote: > I'm currently attempting to embed the IronPython 2 runtimes into an > existing application written in C#. However, I find the amount of > documentation lacking on what I'm trying to do. I currently have a > proof-of-concept version which uses Lua and LuaInterface, but the people who > have to write the scripts dislike Lua(Well, more hate it with a passion) and > would love to see this working with Python. > > My host application is a networked application that must trigger certain > scripts functions on events generated by the connected clients. The idea is > that when my application starts, it will load the IronPython script > environment, launches an 'autoexec.py' which will load various other scripts > files and do some housekeeping. Once this all is completed, it will start > listening to incoming connections. However, in various scenarios, the > application has to trigger scripted functions when data is received from a > client. Which script function is called is different per client and per > event. I have events for connecting, logging on, disconnecting and a set of > data specific events after receiving data. This highly depends on the > received packets. > > My question here is: How do I embed IronPython in such a fashion that I can > load my scripts and then trigger various functions within that? I've seen > many examples that just call CreateScriptSourceFromString() or File each > time in which just 1 piece of code is implemented. This is not suitable for > the needs here because the scripted systems can become quite complex. > > With regards, > Patrick > > _______________________________________________ > 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 Marty.Nelson at symyx.com Thu Jun 11 18:24:17 2009 From: Marty.Nelson at symyx.com (Marty Nelson) Date: Thu, 11 Jun 2009 09:24:17 -0700 Subject: [IronPython] Need for third-party embeddable Iron Python Editor In-Reply-To: References: Message-ID: <515335F32AA04440B3DE6FEA1993E9AD044E3D3F@srv-be-101.Symyx-IC.symyx.com> What is that state of a prebuilt Python Editor? My understanding is that there are bits and pieces, and stuff that was never brought up to 2.x, but nothing comprehensive currently exists. Maybe I just don't know what is available (anything in Visual Studio we could use via VSIP?) For those of us that use IronPython as an application extensibility mechanism, we could really use this functionality (and would be willing to pay for it if it were a third-party component we could purchase). It's not our core competency and not something we want to use resources on. Thanks, Marty Nelson From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Wednesday, June 10, 2009 6:15 PM To: Discussion of IronPython Subject: Re: [IronPython] Checking syntax of source code without running it Through the hosting API, it's something like this: engine = IronPython.Hosting.Python.CreateEngine() source = engine.CreateScriptSourceFromString(text, SourceCodeKind.File) errors = ErrorListener() command = source.Compile(errors) if command is None: # compilation failed Here, ErrorListener is some class that derives from Microsoft.Scripting.Hosting.ErrorListener and stores the errors. On Wed, Jun 10, 2009 at 12:52 PM, Harri Vartiainen wrote: Hi, What's the best way to check syntax of IronPython source code without actually running it? I'd like to embed IronPython to application and make it as user friendly as possible, so all checking before running the code would be helpful. There are many options listed here for CPython: http://stackoverflow.com/questions/205704/how-can-i-check-the-syntax-of- python-code-in-emacs-without-actually-executing-it Next stop, debugging.. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ======= 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 stephen.p.lepisto at intel.com Thu Jun 11 18:34:25 2009 From: stephen.p.lepisto at intel.com (Lepisto, Stephen P) Date: Thu, 11 Jun 2009 09:34:25 -0700 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> References: <4A311578.2000604@toolmaker.nl> <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> Message-ID: <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> What I do when I want to work with python modules from embedded IronPython is set the IronPython search path with the path of the module to load then create and execute a small python script that loads the main python modules into the current scope. string moduleName = Path.GetFileName(modulePath); string path = Path.GetDirectoryName(modulePath); ICollection paths = _pythonEngine.GetSearchPaths(); if (!paths.Contains(path)) { paths.Add(path); _pythonEngine.SetSearchPaths(paths); } string modInvoke = String.Format("import {0}\nfrom {0} import *\n", moduleName); ScriptSource source = _pythonEngine.CreateScriptSourceFromString(modInvoke, Microsoft.Scripting.SourceCodeKind.Statements); Where modulePath is the full path to the python module or package to load. I can then invoke methods or access attributes using the IronPython scope. In this way, I can interact with the python modules for as long as necessary before closing down the scope/engine. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dody Gunawinata Sent: Thursday, June 11, 2009 9:09 AM To: Discussion of IronPython Subject: Re: [IronPython] Embedding IronPython and calling python functions from C# You can read all yours file scripts, then using StringBuilder to combine then and call CreateScriptSourceFromString() Then you can call your functions within the combined scripts normally. Pretty much you are creating a giant source code on the fly. On Thu, Jun 11, 2009 at 5:32 PM, Patrick van der Willik > wrote: I'm currently attempting to embed the IronPython 2 runtimes into an existing application written in C#. However, I find the amount of documentation lacking on what I'm trying to do. I currently have a proof-of-concept version which uses Lua and LuaInterface, but the people who have to write the scripts dislike Lua(Well, more hate it with a passion) and would love to see this working with Python. My host application is a networked application that must trigger certain scripts functions on events generated by the connected clients. The idea is that when my application starts, it will load the IronPython script environment, launches an 'autoexec.py' which will load various other scripts files and do some housekeeping. Once this all is completed, it will start listening to incoming connections. However, in various scenarios, the application has to trigger scripted functions when data is received from a client. Which script function is called is different per client and per event. I have events for connecting, logging on, disconnecting and a set of data specific events after receiving data. This highly depends on the received packets. My question here is: How do I embed IronPython in such a fashion that I can load my scripts and then trigger various functions within that? I've seen many examples that just call CreateScriptSourceFromString() or File each time in which just 1 piece of code is implemented. This is not suitable for the needs here because the scripted systems can become quite complex. With regards, Patrick _______________________________________________ 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 brian.curtin at gmail.com Thu Jun 11 18:59:21 2009 From: brian.curtin at gmail.com (Brian Curtin) Date: Thu, 11 Jun 2009 11:59:21 -0500 Subject: [IronPython] Need for third-party embeddable Iron Python Editor In-Reply-To: <515335F32AA04440B3DE6FEA1993E9AD044E3D3F@srv-be-101.Symyx-IC.symyx.com> References: <515335F32AA04440B3DE6FEA1993E9AD044E3D3F@srv-be-101.Symyx-IC.symyx.com> Message-ID: Check out http://code.google.com/p/davysironpythoneditor/ I haven't used this, but it might be worth a shot. Works with 2.0 and the 2.6 beta. Michael Foord has also done work to get some nifty IronPython functionality working in the Wing IDE, which might be worth looking at if you have Wing licenses. http://www.voidspace.org.uk/ironpython/wing-how-to.shtml On Thu, Jun 11, 2009 at 11:24, Marty Nelson wrote: > What is that state of a prebuilt Python Editor? My understanding is that > there are bits and pieces, and stuff that was never brought up to 2.x, but > nothing comprehensive currently exists. Maybe I just don?t know what is > available (anything in Visual Studio we could use via VSIP?) > > > > For those of us that use IronPython as an application extensibility > mechanism, we could really use this functionality (and would be willing to > pay for it if it were a third-party component we could purchase). It?s not > our core competency and not something we want to use resources on. > > > > Thanks, > > > > Marty Nelson > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Curt Hagenlocher > *Sent:* Wednesday, June 10, 2009 6:15 PM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Checking syntax of source code without running > it > > > > Through the hosting API, it's something like this: > > > > engine = IronPython.Hosting.Python.CreateEngine() > > source = engine.CreateScriptSourceFromString(text, SourceCodeKind.File) > > errors = ErrorListener() > > command = source.Compile(errors) > > if command is None: > > # compilation failed > > > > Here, ErrorListener is some class that derives > from Microsoft.Scripting.Hosting.ErrorListener and stores the errors. > > > > On Wed, Jun 10, 2009 at 12:52 PM, Harri Vartiainen < > harri.vartiainen at iki.fi> wrote: > > Hi, > > What's the best way to check syntax of IronPython source code without > actually running it? > > I'd like to embed IronPython to application and make it as user > friendly as possible, so all checking before running the code would be > helpful. > > There are many options listed here for CPython: > > http://stackoverflow.com/questions/205704/how-can-i-check-the-syntax-of-python-code-in-emacs-without-actually-executing-it > > > > Next stop, debugging.. > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > ======= > 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 Marty.Nelson at symyx.com Thu Jun 11 19:24:17 2009 From: Marty.Nelson at symyx.com (Marty Nelson) Date: Thu, 11 Jun 2009 10:24:17 -0700 Subject: [IronPython] Need for third-party embeddable Iron Python Editor In-Reply-To: References: <515335F32AA04440B3DE6FEA1993E9AD044E3D3F@srv-be-101.Symyx-IC.symyx.com> Message-ID: <515335F32AA04440B3DE6FEA1993E9AD044E3D78@srv-be-101.Symyx-IC.symyx.com> Thanks, I'll check those out. I guess I'm use to a higher level of ISV support from Microsoft around these kinds of tooling issues J. Using IronPython (and DLR generally) for application extensibility is very compelling for .NET apps. I think that this issue is going to come up again and again as ISV's look at using it this way. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Brian Curtin Sent: Thursday, June 11, 2009 12:59 PM To: Discussion of IronPython Subject: Re: [IronPython] Need for third-party embeddable Iron Python Editor Check out http://code.google.com/p/davysironpythoneditor/ I haven't used this, but it might be worth a shot. Works with 2.0 and the 2.6 beta. Michael Foord has also done work to get some nifty IronPython functionality working in the Wing IDE, which might be worth looking at if you have Wing licenses. http://www.voidspace.org.uk/ironpython/wing-how-to.shtml On Thu, Jun 11, 2009 at 11:24, Marty Nelson wrote: What is that state of a prebuilt Python Editor? My understanding is that there are bits and pieces, and stuff that was never brought up to 2.x, but nothing comprehensive currently exists. Maybe I just don't know what is available (anything in Visual Studio we could use via VSIP?) For those of us that use IronPython as an application extensibility mechanism, we could really use this functionality (and would be willing to pay for it if it were a third-party component we could purchase). It's not our core competency and not something we want to use resources on. Thanks, Marty Nelson From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Wednesday, June 10, 2009 6:15 PM To: Discussion of IronPython Subject: Re: [IronPython] Checking syntax of source code without running it Through the hosting API, it's something like this: engine = IronPython.Hosting.Python.CreateEngine() source = engine.CreateScriptSourceFromString(text, SourceCodeKind.File) errors = ErrorListener() command = source.Compile(errors) if command is None: # compilation failed Here, ErrorListener is some class that derives from Microsoft.Scripting.Hosting.ErrorListener and stores the errors. On Wed, Jun 10, 2009 at 12:52 PM, Harri Vartiainen wrote: Hi, What's the best way to check syntax of IronPython source code without actually running it? I'd like to embed IronPython to application and make it as user friendly as possible, so all checking before running the code would be helpful. There are many options listed here for CPython: http://stackoverflow.com/questions/205704/how-can-i-check-the-syntax-of- python-code-in-emacs-without-actually-executing-it Next stop, debugging.. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ======= 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 dinov at microsoft.com Thu Jun 11 20:18:03 2009 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 11 Jun 2009 18:18:03 +0000 Subject: [IronPython] VS Support/Intelllisense for IronPython In-Reply-To: <014b01c9eaa1$c5d49f50$517dddf0$@com> References: <014b01c9eaa1$c5d49f50$517dddf0$@com> Message-ID: <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> We've made some attempts in the past (e.g. IronPython Studio) but there's no longer any active development for intellisense. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Adam Brand Sent: Thursday, June 11, 2009 7:35 AM To: Discussion of IronPython Subject: [IronPython] VS Support/Intelllisense for IronPython I was wondering if there is any ongoing development to support Intellisense with IronPython in Visual Studio. Can someone from the team comment on this? Thanks, Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From jregele23 at gmail.com Thu Jun 11 21:03:40 2009 From: jregele23 at gmail.com (Justin Regele) Date: Thu, 11 Jun 2009 12:03:40 -0700 Subject: [IronPython] VS Support/Intelllisense for IronPython In-Reply-To: <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> References: <014b01c9eaa1$c5d49f50$517dddf0$@com> <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> Message-ID: <8429660906111203rdd25d86gb710c5258b72267e@mail.gmail.com> I'd like to know why VS constantly botches my code. I turned off auto-complete, but it still manages to insert hidden nasties that make me re-write entire functions that are perfectly valid. Has anyone else had this problem, where VS claims your blocks are not spaced equally? It normally happens when leaving an embedded block, ie if this: something happens else: sometjhing else the problem VS has is at the return to the outer code, it thinks else is not indented the same as if, when it is. On Thu, Jun 11, 2009 at 11:18 AM, Dino Viehland wrote: > We?ve made some attempts in the past (e.g. IronPython Studio) but there?s > no longer any active development for intellisense. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Adam Brand > *Sent:* Thursday, June 11, 2009 7:35 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] VS Support/Intelllisense for IronPython > > > > I was wondering if there is any ongoing development to support Intellisense > with IronPython in Visual Studio. > > > > Can someone from the team comment on this? > > > > Thanks, > > Adam > > _______________________________________________ > 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 dblank at brynmawr.edu Thu Jun 11 21:32:38 2009 From: dblank at brynmawr.edu (Douglas S. Blank) Date: Thu, 11 Jun 2009 15:32:38 -0400 Subject: [IronPython] Need for third-party embeddable Iron Python Editor In-Reply-To: <515335F32AA04440B3DE6FEA1993E9AD044E3D3F@srv-be-101.Symyx-IC.symyx.com> References: <515335F32AA04440B3DE6FEA1993E9AD044E3D3F@srv-be-101.Symyx-IC.symyx.com> Message-ID: <4A315BD6.1000009@brynmawr.edu> Marty, You'll find a few little projects that revolve around a DLR editor, including: 1) http://www.codeplex.com/IronEditor - last edited Jul 2008 2) http://codeplex.com/DlrPad - last edited Nov 2007 There were a group of us, largely from this mailing list, who discussed issues for such an editor/shell combo in Aug 2008. Notes available here: http://wiki.roboteducation.org/IDE_Specs From that discussion, I have been working on a cross-platform (Mono on Linux/Mac, .NET on Windows), cross-language (currently Ruby and Python) IDE for education, called Pyjama: http://wiki.roboteducation.org/Pyjama It is now in a pre-alpha state, and may not be at all what you are looking for. Some points about Pyjama: 1) Can be built and run from Visual Studio (including Express) and through Make files (on Mac and Linux) 2) Does not (yet) support some things that developers love (such as code completion). As a IDE for beginners, this isn't necessarily a focus of ours, but could probably be added. 3) As this is cross-platform, we have avoided P/Invokes. That means that it can be (currently) sluggish doing some things like color syntax highlighting on code. 4) Languages share a common environment, which allows them to share code and data. The shell code can be run in its own thread, or in the same thread as the IDE. 5) The current code is a hodge-podge of open source projects, and needs some serious refactoring. However, most everything sorta works on all platforms. 6) We had to do some tricky, crazy things to work around bugs/issues/incompatibilities between/in Mono and .NET. We expect that this will get better over time. 7) Many things are currently hardcoded (such as the languages). We image that DLR language will be able to be added by simply dropping in the DLLs in a folder. If anyone would like to contribute to our effort (with code, comments, feedback, etc) please feel free to join us! We imagine this to be a long-term effort with sponsorship from grants and other funding agencies. We have a codeplex Issue Tracker: http://pyjama.codeplex.com/WorkItem/List.aspx Hope this info helps! -Doug Marty Nelson wrote: > What is that state of a prebuilt Python Editor? My understanding is > that there are bits and pieces, and stuff that was never brought up to > 2.x, but nothing comprehensive currently exists. Maybe I just don?t > know what is available (anything in Visual Studio we could use via VSIP?) > > > > For those of us that use IronPython as an application extensibility > mechanism, we could really use this functionality (and would be willing > to pay for it if it were a third-party component we could purchase). > It?s not our core competency and not something we want to use resources on. > > > > Thanks, > > > > Marty Nelson > > > > *From:* users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Curt Hagenlocher > *Sent:* Wednesday, June 10, 2009 6:15 PM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Checking syntax of source code without > running it > > > > Through the hosting API, it's something like this: > > > > engine = IronPython.Hosting.Python.CreateEngine() > > source = engine.CreateScriptSourceFromString(text, SourceCodeKind.File) > > errors = ErrorListener() > > command = source.Compile(errors) > > if command is None: > > # compilation failed > > > > Here, ErrorListener is some class that derives > from Microsoft.Scripting.Hosting.ErrorListener and stores the errors. > > > > On Wed, Jun 10, 2009 at 12:52 PM, Harri Vartiainen > > wrote: > > Hi, > > What's the best way to check syntax of IronPython source code without > actually running it? > > I'd like to embed IronPython to application and make it as user > friendly as possible, so all checking before running the code would be > helpful. > > There are many options listed here for CPython: > http://stackoverflow.com/questions/205704/how-can-i-check-the-syntax-of-python-code-in-emacs-without-actually-executing-it > > > > Next stop, debugging.. > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > ======= > 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 -- Douglas S. Blank Director, Institute for Personal Robots in Education (IPRE) http://www.roboteducation.org Chair, and Associate Professor, Computer Science, Bryn Mawr College http://cs.brynmawr.edu/~dblank (610)526-6501 From fuzzyman at voidspace.org.uk Thu Jun 11 21:34:39 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 11 Jun 2009 20:34:39 +0100 Subject: [IronPython] __objclass__ In-Reply-To: <5b0248170906091934u7cf7c19dp2914f08d49b4da30@mail.gmail.com> References: <4A2EA2C9.5090703@voidspace.org.uk> <5b0248170906091934u7cf7c19dp2914f08d49b4da30@mail.gmail.com> Message-ID: <4A315C4F.9060208@voidspace.org.uk> Seo Sanghyeon wrote: > 2009/6/10 Michael Foord : > >> All .NET classes used from IronPython have an __objclass__ attribute on >> their methods / members. This is *really* useful for introspection - can I >> rely on it staying or is it an implementation detail that may change? >> > > Since this is also a CPython behavior (although undocumented, or poorly > documented one), it's unlikely to change. __objclass__ of a descriptor > points to its class. > > C:\>python > Python 2.6.1 > >>>> object.__repr__.__objclass__ >>>> > > > Ah - didn't know that, and if google knew she hid it from me. Thanks Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From adamb at silverkeytech.com Thu Jun 11 21:40:54 2009 From: adamb at silverkeytech.com (Adam Brand) Date: Thu, 11 Jun 2009 12:40:54 -0700 Subject: [IronPython] VS Support/Intelllisense for IronPython In-Reply-To: <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> References: <014b01c9eaa1$c5d49f50$517dddf0$@com> <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> Message-ID: <01f301c9eacc$8947c5a0$9bd750e0$@com> Is adding Intellisense for IPY to VS something that can be done by the community, or does it require access to source code that we can?t access? I?m not familiar with the extent to which VS can be customized for languages. Thanks, Adam Adam Brand SilverKey Technologies *From:* users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] *On Behalf Of *Dino Viehland *Sent:* Thursday, June 11, 2009 11:18 AM *To:* Discussion of IronPython *Subject:* Re: [IronPython] VS Support/Intelllisense for IronPython We?ve made some attempts in the past (e.g. IronPython Studio) but there?s no longer any active development for intellisense. *From:* users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] *On Behalf Of *Adam Brand *Sent:* Thursday, June 11, 2009 7:35 AM *To:* Discussion of IronPython *Subject:* [IronPython] VS Support/Intelllisense for IronPython I was wondering if there is any ongoing development to support Intellisense with IronPython in Visual Studio. Can someone from the team comment on this? Thanks, Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From olegtk at microsoft.com Thu Jun 11 22:03:25 2009 From: olegtk at microsoft.com (Oleg Tkachenko) Date: Thu, 11 Jun 2009 20:03:25 +0000 Subject: [IronPython] VS Support/Intelllisense for IronPython In-Reply-To: <01f301c9eacc$8947c5a0$9bd750e0$@com> References: <014b01c9eaa1$c5d49f50$517dddf0$@com> <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> <01f301c9eacc$8947c5a0$9bd750e0$@com> Message-ID: <0010643C1B87CA488E22FE64F0547D8D041EB0@TK5EX14MBXC112.redmond.corp.microsoft.com> This is totally can be done by the community + maybe some help from Dino if you hit any IPy issues. The VS interfaces are open and VS SDK includes IPy integration sample that contains simple intellisense implementation. -- Oleg From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Adam Brand Sent: Thursday, June 11, 2009 12:41 PM To: Discussion of IronPython Subject: Re: [IronPython] VS Support/Intelllisense for IronPython Is adding Intellisense for IPY to VS something that can be done by the community, or does it require access to source code that we can't access? I'm not familiar with the extent to which VS can be customized for languages. Thanks, Adam Adam Brand SilverKey Technologies From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Thursday, June 11, 2009 11:18 AM To: Discussion of IronPython Subject: Re: [IronPython] VS Support/Intelllisense for IronPython We've made some attempts in the past (e.g. IronPython Studio) but there's no longer any active development for intellisense. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Adam Brand Sent: Thursday, June 11, 2009 7:35 AM To: Discussion of IronPython Subject: [IronPython] VS Support/Intelllisense for IronPython I was wondering if there is any ongoing development to support Intellisense with IronPython in Visual Studio. Can someone from the team comment on this? Thanks, Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From jregele23 at gmail.com Thu Jun 11 22:12:07 2009 From: jregele23 at gmail.com (Justin Regele) Date: Thu, 11 Jun 2009 13:12:07 -0700 Subject: [IronPython] VS Support/Intelllisense for IronPython In-Reply-To: <0010643C1B87CA488E22FE64F0547D8D041EB0@TK5EX14MBXC112.redmond.corp.microsoft.com> References: <014b01c9eaa1$c5d49f50$517dddf0$@com> <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> <01f301c9eacc$8947c5a0$9bd750e0$@com> <0010643C1B87CA488E22FE64F0547D8D041EB0@TK5EX14MBXC112.redmond.corp.microsoft.com> Message-ID: <8429660906111312n282e8bcbv1f318dfc51d3e64@mail.gmail.com> Could the intellisense be written in IronPython itself? Given pythons reflective nature, this could be very easy, and then the community could re-write how it behaves to suit wha they want. open up the console and do this #make a list, or whatever x=[] for attr in dir(x): print attr.__doc__ On Thu, Jun 11, 2009 at 1:03 PM, Oleg Tkachenko wrote: > This is totally can be done by the community + maybe some help from Dino > if you hit any IPy issues. The VS interfaces are open and VS SDK includes > IPy integration sample that contains simple intellisense implementation. > > > > -- > > Oleg > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Adam Brand > *Sent:* Thursday, June 11, 2009 12:41 PM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] VS Support/Intelllisense for IronPython > > > > Is adding Intellisense for IPY to VS something that can be done by the > community, or does it require access to source code that we can?t access? > > > > I?m not familiar with the extent to which VS can be customized for > languages. > > > > Thanks, > > Adam > > > > Adam Brand > > SilverKey Technologies > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Dino Viehland > *Sent:* Thursday, June 11, 2009 11:18 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] VS Support/Intelllisense for IronPython > > > > We?ve made some attempts in the past (e.g. IronPython Studio) but there?s > no longer any active development for intellisense. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Adam Brand > *Sent:* Thursday, June 11, 2009 7:35 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] VS Support/Intelllisense for IronPython > > > > I was wondering if there is any ongoing development to support Intellisense > with IronPython in Visual Studio. > > > > Can someone from the team comment on this? > > > > Thanks, > > Adam > > _______________________________________________ > 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 adamb at silverkeytech.com Thu Jun 11 22:20:13 2009 From: adamb at silverkeytech.com (Adam Brand) Date: Thu, 11 Jun 2009 13:20:13 -0700 Subject: [IronPython] VS Support/Intelllisense for IronPython In-Reply-To: <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> References: <014b01c9eaa1$c5d49f50$517dddf0$@com> <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> Message-ID: <021401c9ead2$071c0b80$15542280$@com> Ah?I didn?t know about IronPython Studio ( http://ironpythonstudio.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=8934 ). ?it seems fairly thorough. What happened to that project? What are its main limitations? Adam Adam Brand SilverKey Technologies *From:* users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] *On Behalf Of *Dino Viehland *Sent:* Thursday, June 11, 2009 11:18 AM *To:* Discussion of IronPython *Subject:* Re: [IronPython] VS Support/Intelllisense for IronPython We?ve made some attempts in the past (e.g. IronPython Studio) but there?s no longer any active development for intellisense. *From:* users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] *On Behalf Of *Adam Brand *Sent:* Thursday, June 11, 2009 7:35 AM *To:* Discussion of IronPython *Subject:* [IronPython] VS Support/Intelllisense for IronPython I was wondering if there is any ongoing development to support Intellisense with IronPython in Visual Studio. Can someone from the team comment on this? Thanks, Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From jregele23 at gmail.com Thu Jun 11 22:23:58 2009 From: jregele23 at gmail.com (Justin Regele) Date: Thu, 11 Jun 2009 13:23:58 -0700 Subject: [IronPython] VS Support/Intelllisense for IronPython In-Reply-To: <8429660906111312n282e8bcbv1f318dfc51d3e64@mail.gmail.com> References: <014b01c9eaa1$c5d49f50$517dddf0$@com> <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> <01f301c9eacc$8947c5a0$9bd750e0$@com> <0010643C1B87CA488E22FE64F0547D8D041EB0@TK5EX14MBXC112.redmond.corp.microsoft.com> <8429660906111312n282e8bcbv1f318dfc51d3e64@mail.gmail.com> Message-ID: <8429660906111323s166032d6p666bbede73ec634b@mail.gmail.com> actually, didn't quite do what i thought, now that I tested after I posted (doh!) if you remove the '.__doc__' from the print, then yes you can actually see the attributes. the problem with the doc strings here is that they are all the same. On Thu, Jun 11, 2009 at 1:12 PM, Justin Regele wrote: > Could the intellisense be written in IronPython itself? Given pythons > reflective nature, this could be very easy, and then the community could > re-write how it behaves to suit wha they want. > > > open up the console and do this > > #make a list, or whatever > x=[] > for attr in dir(x): > print attr.__doc__ > > > > > On Thu, Jun 11, 2009 at 1:03 PM, Oleg Tkachenko wrote: > >> This is totally can be done by the community + maybe some help from Dino >> if you hit any IPy issues. The VS interfaces are open and VS SDK includes >> IPy integration sample that contains simple intellisense implementation. >> >> >> >> -- >> >> Oleg >> >> >> >> *From:* users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] *On Behalf Of *Adam Brand >> *Sent:* Thursday, June 11, 2009 12:41 PM >> *To:* Discussion of IronPython >> *Subject:* Re: [IronPython] VS Support/Intelllisense for IronPython >> >> >> >> Is adding Intellisense for IPY to VS something that can be done by the >> community, or does it require access to source code that we can?t access? >> >> >> >> I?m not familiar with the extent to which VS can be customized for >> languages. >> >> >> >> Thanks, >> >> Adam >> >> >> >> Adam Brand >> >> SilverKey Technologies >> >> >> >> *From:* users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] *On Behalf Of *Dino Viehland >> *Sent:* Thursday, June 11, 2009 11:18 AM >> *To:* Discussion of IronPython >> *Subject:* Re: [IronPython] VS Support/Intelllisense for IronPython >> >> >> >> We?ve made some attempts in the past (e.g. IronPython Studio) but there?s >> no longer any active development for intellisense. >> >> >> >> *From:* users-bounces at lists.ironpython.com [mailto: >> users-bounces at lists.ironpython.com] *On Behalf Of *Adam Brand >> *Sent:* Thursday, June 11, 2009 7:35 AM >> *To:* Discussion of IronPython >> *Subject:* [IronPython] VS Support/Intelllisense for IronPython >> >> >> >> I was wondering if there is any ongoing development to support >> Intellisense with IronPython in Visual Studio. >> >> >> >> Can someone from the team comment on this? >> >> >> >> Thanks, >> >> Adam >> >> _______________________________________________ >> 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 Thu Jun 11 22:30:55 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 11 Jun 2009 21:30:55 +0100 Subject: [IronPython] VS Support/Intelllisense for IronPython In-Reply-To: <8429660906111323s166032d6p666bbede73ec634b@mail.gmail.com> References: <014b01c9eaa1$c5d49f50$517dddf0$@com> <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> <01f301c9eacc$8947c5a0$9bd750e0$@com> <0010643C1B87CA488E22FE64F0547D8D041EB0@TK5EX14MBXC112.redmond.corp.microsoft.com> <8429660906111312n282e8bcbv1f318dfc51d3e64@mail.gmail.com> <8429660906111323s166032d6p666bbede73ec634b@mail.gmail.com> Message-ID: <4A31697F.4060800@voidspace.org.uk> Justin Regele wrote: > actually, didn't quite do what i thought, now that I tested after I > posted (doh!) > > if you remove the '.__doc__' from the print, then yes you can actually > see the attributes. the problem with the doc strings here is that they > are all the same. > > On Thu, Jun 11, 2009 at 1:12 PM, Justin Regele > wrote: > > Could the intellisense be written in IronPython itself? Given > pythons reflective nature, this could be very easy, and then the > community could re-write how it behaves to suit wha they want. > > > open up the console and do this > > #make a list, or whatever > x=[] > for attr in dir(x): > print attr.__doc__ > dir returns a list of strings. Here you are just printing the docstring of the string in the loop - string docstrings are unsurprising all the same... See this code for how to fetch docstrings from object attributes. It's more fiddly than you would expect: http://www.voidspace.org.uk/python/weblog/arch_d7_2009_05_16.shtml#e1090 There's actually another corner case that code doesn't handle - where a descriptor shadows a name that also exists in the instance dictionary. This code will return the docstring from the object in the instance dictionary when it should return the descriptor docstring. Of course none of this is really much help for intellisense where you need to do it from static analysis and not from live objects. All the best, Michael Foord > > > > > On Thu, Jun 11, 2009 at 1:03 PM, Oleg Tkachenko > > wrote: > > This is totally can be done by the community + maybe some help > from Dino if you hit any IPy issues. The VS interfaces are > open and VS SDK includes IPy integration sample that contains > simple intellisense implementation. > > > > -- > > Oleg > > > > *From:* users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] *On Behalf Of > *Adam Brand > *Sent:* Thursday, June 11, 2009 12:41 PM > > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] VS Support/Intelllisense for > IronPython > > > > Is adding Intellisense for IPY to VS something that can be > done by the community, or does it require access to source > code that we can?t access? > > > > I?m not familiar with the extent to which VS can be customized > for languages. > > > > Thanks, > > Adam > > > > Adam Brand > > SilverKey Technologies > > > > *From:* users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] *On Behalf Of > *Dino Viehland > *Sent:* Thursday, June 11, 2009 11:18 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] VS Support/Intelllisense for > IronPython > > > > We?ve made some attempts in the past (e.g. IronPython Studio) > but there?s no longer any active development for intellisense. > > > > *From:* users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] *On Behalf Of > *Adam Brand > *Sent:* Thursday, June 11, 2009 7:35 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] VS Support/Intelllisense for IronPython > > > > I was wondering if there is any ongoing development to support > Intellisense with IronPython in Visual Studio. > > > > Can someone from the team comment on this? > > > > Thanks, > > Adam > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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/blog From brian.curtin at gmail.com Thu Jun 11 22:36:14 2009 From: brian.curtin at gmail.com (Brian Curtin) Date: Thu, 11 Jun 2009 15:36:14 -0500 Subject: [IronPython] VS Support/Intelllisense for IronPython In-Reply-To: <021401c9ead2$071c0b80$15542280$@com> References: <014b01c9eaa1$c5d49f50$517dddf0$@com> <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> <021401c9ead2$071c0b80$15542280$@com> Message-ID: IronPython Studio is abandonware. The forms editor seemed nice at first, but minor changes to the source it generated caused the forms editor to no longer render what the form should look like ever again (in my experience). I believe this was more of a showcase of the VS SDK than a tool you can legitimately use and depend on. On Thu, Jun 11, 2009 at 15:20, Adam Brand wrote: > Ah?I didn?t know about IronPython Studio > > ( > http://ironpythonstudio.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=8934 > ). > > > > ?it seems fairly thorough. What happened to that project? What are its main > limitations? > > > > Adam > > > > Adam Brand > > SilverKey Technologies > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Dino Viehland > *Sent:* Thursday, June 11, 2009 11:18 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] VS Support/Intelllisense for IronPython > > > > We?ve made some attempts in the past (e.g. IronPython Studio) but there?s > no longer any active development for intellisense. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Adam Brand > *Sent:* Thursday, June 11, 2009 7:35 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] VS Support/Intelllisense for IronPython > > > > I was wondering if there is any ongoing development to support Intellisense > with IronPython in Visual Studio. > > > > Can someone from the team comment on this? > > > > Thanks, > > Adam > > _______________________________________________ > 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 Thu Jun 11 22:38:34 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 11 Jun 2009 21:38:34 +0100 Subject: [IronPython] VS Support/Intelllisense for IronPython In-Reply-To: References: <014b01c9eaa1$c5d49f50$517dddf0$@com> <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> <021401c9ead2$071c0b80$15542280$@com> Message-ID: <4A316B4A.2080403@voidspace.org.uk> Brian Curtin wrote: > IronPython Studio is abandonware. > > The forms editor seemed nice at first, but minor changes to the source > it generated caused the forms editor to no longer render what the form > should look like ever again (in my experience). I believe this was > more of a showcase of the VS SDK than a tool you can legitimately use > and depend on. SharpDevelop 3.1 has a forms designer plus other very interesting IronPython support features (convert from C# to IronPython, some intellisense, compile to executable even for IronPython 2). Definitely worth looking at. Michael > > On Thu, Jun 11, 2009 at 15:20, Adam Brand > wrote: > > Ah?I didn?t know about IronPython Studio > > (http://ironpythonstudio.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=8934). > > > > ?it seems fairly thorough. What happened to that project? What are > its main limitations? > > > > Adam > > > > Adam Brand > > SilverKey Technologies > > > > *From:* users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] *On Behalf Of *Dino > Viehland > *Sent:* Thursday, June 11, 2009 11:18 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] VS Support/Intelllisense for IronPython > > > > We?ve made some attempts in the past (e.g. IronPython Studio) but > there?s no longer any active development for intellisense. > > > > *From:* users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] *On Behalf Of *Adam Brand > *Sent:* Thursday, June 11, 2009 7:35 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] VS Support/Intelllisense for IronPython > > > > I was wondering if there is any ongoing development to support > Intellisense with IronPython in Visual Studio. > > > > Can someone from the team comment on this? > > > > Thanks, > > Adam > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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/blog From olegtk at microsoft.com Thu Jun 11 23:07:56 2009 From: olegtk at microsoft.com (Oleg Tkachenko) Date: Thu, 11 Jun 2009 21:07:56 +0000 Subject: [IronPython] VS Support/Intelllisense for IronPython In-Reply-To: <021401c9ead2$071c0b80$15542280$@com> References: <014b01c9eaa1$c5d49f50$517dddf0$@com> <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> <021401c9ead2$071c0b80$15542280$@com> Message-ID: <0010643C1B87CA488E22FE64F0547D8D041FA5@TK5EX14MBXC112.redmond.corp.microsoft.com> It's IPy 1.X and it's basically VS integration sample hence as you can imagine it's more focused on integration aspects, not on tool quality. I wish it was an open source project driven by the community... -- Oleg From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Adam Brand Sent: Thursday, June 11, 2009 1:20 PM To: Discussion of IronPython Subject: Re: [IronPython] VS Support/Intelllisense for IronPython Ah...I didn't know about IronPython Studio (http://ironpythonstudio.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=8934). ...it seems fairly thorough. What happened to that project? What are its main limitations? Adam Adam Brand SilverKey Technologies From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Thursday, June 11, 2009 11:18 AM To: Discussion of IronPython Subject: Re: [IronPython] VS Support/Intelllisense for IronPython We've made some attempts in the past (e.g. IronPython Studio) but there's no longer any active development for intellisense. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Adam Brand Sent: Thursday, June 11, 2009 7:35 AM To: Discussion of IronPython Subject: [IronPython] VS Support/Intelllisense for IronPython I was wondering if there is any ongoing development to support Intellisense with IronPython in Visual Studio. Can someone from the team comment on this? Thanks, Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From adamb at silverkeytech.com Thu Jun 11 23:30:56 2009 From: adamb at silverkeytech.com (Adam Brand) Date: Thu, 11 Jun 2009 14:30:56 -0700 Subject: [IronPython] VS Support/Intelllisense for IronPython In-Reply-To: <0010643C1B87CA488E22FE64F0547D8D041FA5@TK5EX14MBXC112.redmond.corp.microsoft.com> References: <014b01c9eaa1$c5d49f50$517dddf0$@com> <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> <021401c9ead2$071c0b80$15542280$@com> <0010643C1B87CA488E22FE64F0547D8D041FA5@TK5EX14MBXC112.redmond.corp.microsoft.com> Message-ID: <024901c9eadb$e7faf1d0$b7f0d570$@com> We could probably wrangle a few people together for it from the list?could anyone over on the DLR team PM it or help with initial architectural support? I volunteer myself to help?probably with the specs/docs and testing as I?m not a hardcore developer. Any volunteers to help with the dev side? Adam Adam Brand SilverKey Technologies *From:* users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] *On Behalf Of *Oleg Tkachenko *Sent:* Thursday, June 11, 2009 2:08 PM *To:* Discussion of IronPython *Subject:* Re: [IronPython] VS Support/Intelllisense for IronPython It?s IPy 1.X and it?s basically VS integration sample hence as you can imagine it?s more focused on integration aspects, not on tool quality. I wish it was an open source project driven by the community? -- Oleg *From:* users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] *On Behalf Of *Adam Brand *Sent:* Thursday, June 11, 2009 1:20 PM *To:* Discussion of IronPython *Subject:* Re: [IronPython] VS Support/Intelllisense for IronPython Ah?I didn?t know about IronPython Studio ( http://ironpythonstudio.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=8934 ). ?it seems fairly thorough. What happened to that project? What are its main limitations? Adam Adam Brand SilverKey Technologies *From:* users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] *On Behalf Of *Dino Viehland *Sent:* Thursday, June 11, 2009 11:18 AM *To:* Discussion of IronPython *Subject:* Re: [IronPython] VS Support/Intelllisense for IronPython We?ve made some attempts in the past (e.g. IronPython Studio) but there?s no longer any active development for intellisense. *From:* users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] *On Behalf Of *Adam Brand *Sent:* Thursday, June 11, 2009 7:35 AM *To:* Discussion of IronPython *Subject:* [IronPython] VS Support/Intelllisense for IronPython I was wondering if there is any ongoing development to support Intellisense with IronPython in Visual Studio. Can someone from the team comment on this? Thanks, Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kyle.Howland-Rose at aar.com.au Fri Jun 12 01:29:15 2009 From: Kyle.Howland-Rose at aar.com.au (Howland-Rose, Kyle) Date: Fri, 12 Jun 2009 09:29:15 +1000 Subject: [IronPython] [Python.NET] Reasons to use ironpython In-Reply-To: <4A3109BE.3000200@voidspace.org.uk> References: <2311471F8507984BBFCCB85ABD03B06823D575149A@OFFC-MAIL01.office.iseoptions.com> <4A3109BE.3000200@voidspace.org.uk> Message-ID: Hi Matthew, Where I have worked in the past, the argument for Python has been productivity. I don't recall the numbers quoted back then but I am an infrequent user of Python and a frequent user of VB (C# is not used here) and Python is easily twice as fast as VB for me to develop with. Regards, Kyle -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Thursday, 11 June 2009 11:42 PM To: Discussion of IronPython Cc: 'pythondotnet at python.org' Subject: Re: [IronPython] [Python.NET] Reasons to use ironpython Hello Matthew, Why send an email about IronPython to the Python.NET mailing list? (Sorry for multiple replies by the way - my client went bat-crazy on me.) Both Python and C# are 'general purpose' programming langugages suited to a wide range of problem domains. Choice of programming language is therefore *usually* a matter of aesthetics, what you are used to, personal workflow, issues within a team and so on rather than a matter of which is more appropriate to the job. Obviously there are exceptions where one language is obviously more appropriate or obviously inappropriate but these are the exception rather than the rule. Place where you should *obviously* use IronPython: * For embedding as a user scripting language / plugin mechanism or are doing runtime code generation Place where you should obviously use C#: * You have already implemented in a dynamic language, profiled and optimised, and *need* faster performance than the dynamic language is capable of Other than that the choice is yours! Reasons why I / some people prefer IronPython: * The interactive environment is an invaluable tool for exploration * No need to create a whole 'object-oriented-application' for simple tasks where it is not needed * Without a compile phase and with duck typing / dynamic typing IronPython makes it *dramatically* easier to do test driven development or even normal unit testing * Python has many language capabilities missing from C# which make it a flexible and concise language. These include: - Duck typing (no need for interfaces) - Heterogeneous containers (no need for generics) - Pain free introspection (no need for the complexity inherent in System.Reflection) - Metaprogramming including good old eval, type creation at runtime, decorators and descriptors - Late binding and runtime type dispatch - 'Little features' like tuple unpacking, returning multiple values, everything is an object (including primitives, functions, classes and modules) There are things that C# has that Python doesn't (compile time checking, method overloading, access to .NET attributes), but choose whichever you prefer. :-) Michael Harelick, Matthew wrote: > > Hi: > > My background is primarily UNIX. I have been programming in C, TCL, > Perl, and Python in UNIX and Linux for a long time. > > I recently started working in Visual Studio and C#. > > Visual Studio and C# make everything very easy. Python was nice when > you didn't have the convenience of Visual Studio and intellisense with > a nice debugger. > > In the windows world I see no major reason not to use C#. > > Why would I want to use IronPython? > > Thanks > > Matthew Harelick > > ------------------------------------------------------------------------ > > _________________________________________________ > Python.NET mailing list - PythonDotNet at python.org > http://mail.python.org/mailman/listinfo/pythondotnet -- http://www.ironpythoninaction.com/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ************************************************************************ Allens Arthur Robinson online: http://www.aar.com.au This email is confidential and may be subject to legal or other professional privilege. It is also subject to copyright. If you have received it in error, confidentiality and privilege are not waived and you must not disclose or use the information in it. Please notify the sender by return email and delete it from your system. Any personal information in this email must be handled in accordance with the Privacy Act 1988 (Cth). ************************************************************************* From daftspaniel at gmail.com Fri Jun 12 06:58:29 2009 From: daftspaniel at gmail.com (Davy Mitchell) Date: Fri, 12 Jun 2009 05:58:29 +0100 Subject: [IronPython] VS Support/Intelllisense for IronPython In-Reply-To: <024901c9eadb$e7faf1d0$b7f0d570$@com> References: <014b01c9eaa1$c5d49f50$517dddf0$@com> <1A472770E042064698CB5ADC83A12ACD031BD82F@TK5EX14MBXC120.redmond.corp.microsoft.com> <021401c9ead2$071c0b80$15542280$@com> <0010643C1B87CA488E22FE64F0547D8D041FA5@TK5EX14MBXC112.redmond.corp.microsoft.com> <024901c9eadb$e7faf1d0$b7f0d570$@com> Message-ID: <20253b0c0906112158s17274996ve77c98cd145a402b@mail.gmail.com> Just to say if any project makes use of SyntaxBox component then keep in mind it is not being developed by the author as far as I can tell and not 100% documented. In fact DIE uses a modified version with a few minor changes (really should upload that source). That said it is pretty good and should suffice for embedded editors etc. One of the things you may want to consider too is that MS may put IronPython in VS2012 and make the Community project redundant (unless it is some sort of joint effort). Of course if you are impatient for VS integration then go for it :-) Cheers, Davy -- Davy Stuff - http://daftspaniel.blogspot.com Geeky Stuff - http://daftpython.blogspot.com Davy's Ironpython Editor - http://code.google.com/p/davysironpythoneditor/ From merllab at microsoft.com Fri Jun 12 17:52:40 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Fri, 12 Jun 2009 08:52:40 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <94d93e0e-b11a-4b75-8c61-b67daf3e45b1@tk5-exsmh-c102.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/54584. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/Parameter.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/NameExpression.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/MemberExpression.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/IndexExpression.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/Expression.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/ErrorExpression.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/DelStatement.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/ContinueStatement.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/ConstantExpression.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/CallExpression.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/BreakStatement.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/BinaryExpression.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/AstGenerator.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/AssignmentStatement.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/YieldExpression.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/TupleExpression.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/SequenceExpression.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/ReturnStatement.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/ParenthesisExpression.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/TokenKind.Generated.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Tokenizer.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Parser.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/NamespaceTracker.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/TopNamespaceTracker.cs $/IronPython/IronPython_Main/Src/Tests/hosting/editor_svcs/errorlistener.py $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/PythonAssemblyOps.cs $/IronPython/IronPython_Main/Src/Tests/hosting/editor_svcs/tokencategorizer.py $/IronPython/IronPython_Main/Src/Tests/test_syntax.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 941816 Date: 6/11/2009 9:22:19 AM (dinov) Fixes these two issues: 22692 - compile() incompatibility with CPython 12907 - Missing PyCF_DONT_IMPLY_DEDENT compile Flag Also moves all error reporting out of the AST generator and into the Parser. This will enable total lazy transformation of the trees if we want to do it. It also means that editors using our Parser for syntax highlighting will see all errors instead of missing things like break outside of a loop. This is just removing the places in transform into explicit virtual calls (CheckAssign, CheckDelete, CheckAugmentedAssign) that we call and if we get a string back we report that string as the error. Most of the change is about tracking blank lines and reporting them from the tokenizer as NL tokens. This isn?t what the documentation says we should be doing (all blank lines are to be ignored) but it matches what CPython?s tokenize module is doing and presumably what CPython?s actual tokenizer is doing as well. Certainly it?s hard to imagine otherwise how code that only differs by new lines could report different exceptions. So do this the tokenizer now needs to keep track whether it just gave out a newline and if so when it will give out another one it should instead give out a NL token. Don?t imply dedent is also updated to look at this state and yield a real newline (if we don?t have one, for example consider ?def f(): return 2?) and then yield the pending dedent(s). Also there?s a fun little hack to match CPython?s behavior where it differs on how it reports errors w/ ?compile()? vs an imported file. If we are doing a ?compile? (we have interactive code or statements) then re-indenting at turns into an error ("def Foo():\n\n pass\n\n "). But if this is just some random source file that we?re bringing in via import then this is perfectly fine. I?ve also updated most of the test_syntax tests to run on both CPython and IronPython ? we still differ on some of the errors. (Shelveset: ReallySignificantWhitespaceFinal;REDMOND\dinov | SNAP CheckinId: m9439) From adamb at silverkeytech.com Fri Jun 12 17:54:26 2009 From: adamb at silverkeytech.com (Adam Brand) Date: Fri, 12 Jun 2009 08:54:26 -0700 Subject: [IronPython] FW: App_Script Problem in latest IronPython for ASP.Net Message-ID: <032301c9eb76$10ce3eb0$326abc10$@com> Does anyone have any insight into this? Thanks, Adam Adam Brand SilverKey Technologies *From:* Adam Brand [mailto:adamb at silverkeytech.com] *Sent:* Sunday, May 31, 2009 7:53 AM *To:* 'Discussion of IronPython' *Subject:* App_Script Problem in latest IronPython for ASP.Net I?ve noticed that with the latest bits for IronPython for ASP.Net, files in app_script only seem to be revisited when the app pool is restarted. For example, if I have a file called hello_world.py in App_Script, and delete that file, the app still executes code in that file as if it were there. If I change a line in the file, that line is not shown as changed until I restart the app pool. Is this by design, a bug, or something I?m doing wrong? Thanks, Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Fri Jun 12 18:01:12 2009 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 12 Jun 2009 16:01:12 +0000 Subject: [IronPython] IPython is breathing but there's a compile() problem In-Reply-To: References: <1A472770E042064698CB5ADC83A12ACD028E352B@TK5EX14MBXC120.redmond.corp.microsoft.com> <4A1C2BF8.5080301@voidspace.org.uk> Message-ID: <1A472770E042064698CB5ADC83A12ACD031DB580@TK5EX14MBXC120.redmond.corp.microsoft.com> Ok, this should now be fixed w/ the latest source push. It turned out to be a little tricky so I wouldn't be too surprised if there's other issues but hopefully they'll be easier if they exist :) From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mike Krell Sent: Tuesday, May 26, 2009 11:02 AM To: Discussion of IronPython Subject: Re: [IronPython] IPython is breathing but there's a compile() problem On Tue, May 26, 2009 at 10:50 AM, Michael Foord > wrote I wonder if it isn't in fact caused by the fact that the repr of an IronPython syntax error doesn't change if the you add new lines to the source code you are compiling. Yes, in this case that is the crux of the issue. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Fri Jun 12 23:47:19 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Fri, 12 Jun 2009 21:47:19 +0000 Subject: [IronPython] FW: App_Script Problem in latest IronPython for ASP.Net In-Reply-To: <032301c9eb76$10ce3eb0$326abc10$@com> References: <032301c9eb76$10ce3eb0$326abc10$@com> Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC14388ED7@tk5ex14mbxc105.redmond.corp.microsoft.com> Not sure if it's by design or just failing to reload it correctly. I'll take a look shortly. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Adam Brand Sent: Friday, June 12, 2009 8:54 AM To: Discussion of IronPython Subject: [IronPython] FW: App_Script Problem in latest IronPython for ASP.Net Does anyone have any insight into this? Thanks, Adam Adam Brand SilverKey Technologies From: Adam Brand [mailto:adamb at silverkeytech.com] Sent: Sunday, May 31, 2009 7:53 AM To: 'Discussion of IronPython' Subject: App_Script Problem in latest IronPython for ASP.Net I've noticed that with the latest bits for IronPython for ASP.Net, files in app_script only seem to be revisited when the app pool is restarted. For example, if I have a file called hello_world.py in App_Script, and delete that file, the app still executes code in that file as if it were there. If I change a line in the file, that line is not shown as changed until I restart the app pool. Is this by design, a bug, or something I'm doing wrong? Thanks, Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbk.lists at gmail.com Sat Jun 13 15:40:35 2009 From: mbk.lists at gmail.com (Mike Krell) Date: Sat, 13 Jun 2009 06:40:35 -0700 Subject: [IronPython] IPython is breathing but there's a compile() problem In-Reply-To: <1A472770E042064698CB5ADC83A12ACD031DB580@TK5EX14MBXC120.redmond.corp.microsoft.com> References: <1A472770E042064698CB5ADC83A12ACD028E352B@TK5EX14MBXC120.redmond.corp.microsoft.com> <4A1C2BF8.5080301@voidspace.org.uk> <1A472770E042064698CB5ADC83A12ACD031DB580@TK5EX14MBXC120.redmond.corp.microsoft.com> Message-ID: Great! I don't build from source, but I'm looking forward to playing with this when the next beta comes out. Thanks, Mike On Fri, Jun 12, 2009 at 9:01 AM, Dino Viehland wrote: > Ok, this should now be fixed w/ the latest source push. It turned out to > be a little tricky so I wouldn?t be too surprised if there?s other issues > but hopefully they?ll be easier if they exist J > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jdhardy at gmail.com Sat Jun 13 20:32:25 2009 From: jdhardy at gmail.com (Jeff Hardy) Date: Sat, 13 Jun 2009 12:32:25 -0600 Subject: [IronPython] Hosting, Adaptive Compilation, and Interpreted Mode Message-ID: I'm a little confused as to the various ways of configuring IronPython's compilation behaviour. From what I gather, there should be three possible settings: fully interpreted, adaptive compilation, and fully compiled. It seems that the "AdaptiveCompilation" and "Interpreted" settings can control these settings, but I'm not sure how they interact. What combinations should I be using to acheive the three options above? And what would be the result of setting both of them to true? - Jeff From jregele23 at gmail.com Sun Jun 14 06:34:48 2009 From: jregele23 at gmail.com (Justin Regele) Date: Sat, 13 Jun 2009 21:34:48 -0700 Subject: [IronPython] new compilations problems, now on xp Message-ID: <8429660906132134y2e0f87k3d7bdbdb09bef334@mail.gmail.com> After getting my python project moved into IronPython studio, and working, I'm having to move it to an xp virtual machine on my laptop to present at a business meeting on monday. VisualStudio is erroring out with: the element 'PropertyGroup' in namespace...has invalid child elements' Googling this, I find a bunch of listings that this is from beta 2, but all responses says you can safely ignore it. However, I can't even get my program to run. Gonna keep digging through google for the answer, but figured i'd post to the list just in case someone is on and knows a quick fix. on time deadline for monday morning... -------------- next part -------------- An HTML attachment was scrubbed... URL: From jregele23 at gmail.com Sun Jun 14 09:15:30 2009 From: jregele23 at gmail.com (Justin Regele) Date: Sun, 14 Jun 2009 00:15:30 -0700 Subject: [IronPython] new compilations problems, now on xp In-Reply-To: <8429660906132134y2e0f87k3d7bdbdb09bef334@mail.gmail.com> References: <8429660906132134y2e0f87k3d7bdbdb09bef334@mail.gmail.com> Message-ID: <8429660906140015v73f5a7c7ob79c4240e36a293c@mail.gmail.com> Ok. that was a dumb question. The problem wasn't related to the warning at all. A few other problems were the result of why the program was unable to compile, namely having a module the same name as the solution name and a sys.path.append line that had not been modified from the vista path. Renaming the module fixed the problem. On Sat, Jun 13, 2009 at 9:34 PM, Justin Regele wrote: > After getting my python project moved into IronPython studio, and working, > I'm having to move it to an xp virtual machine on my laptop to present at a > business meeting on monday. > > VisualStudio is erroring out with: > the element 'PropertyGroup' in namespace...has invalid child elements' > > Googling this, I find a bunch of listings that this is from beta 2, but all > responses says you can safely ignore it. However, I can't even get my > program to run. Gonna keep digging through google for the answer, but > figured i'd post to the list just in case someone is on and knows a quick > fix. on time deadline for monday morning... > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Sun Jun 14 21:09:25 2009 From: sanxiyn at gmail.com (Seo Sanghyeon) Date: Mon, 15 Jun 2009 04:09:25 +0900 Subject: [IronPython] Exception for setting attributes of built-in type Message-ID: <5b0248170906141209y4398defanacfd0bb62504e550@mail.gmail.com> Exception for setting attributes of built-in type differs between CPython and IronPython. This is not purely theoretical, as zope.interface tries to set Implements declaration as __implemented__ attribute of built-in type object, and excepts TypeError. Python 2.6.1 >>> object.flag = True TypeError: can't set attributes of built-in/extension type 'object' IronPython 2.6 >>> object.flag = True AttributeError: 'object' object has no attribute 'flag' I was surprised that CPython raises TypeError. Library Reference seems to mention it here: exception AttributeError Raised when an attribute reference or assignment fails. (When an object does not support attribute references or attribute assignments at all, TypeError is raised.) http://docs.python.org/library/exceptions.html What does it mean that "an object does not support attribute references or attribute assignments at all"? -- Seo Sanghyeon From guido at python.org Mon Jun 15 01:19:18 2009 From: guido at python.org (Guido van Rossum) Date: Sun, 14 Jun 2009 16:19:18 -0700 Subject: [IronPython] [Python-Dev] Exception for setting attributes of built-in type In-Reply-To: <4A357CF0.2050604@mrabarnett.plus.com> References: <5b0248170906141209y4398defanacfd0bb62504e550@mail.gmail.com> <4A357CF0.2050604@mrabarnett.plus.com> Message-ID: On Sun, Jun 14, 2009 at 3:42 PM, MRAB wrote: > Seo Sanghyeon wrote: >> >> Exception for setting attributes of built-in type differs between >> CPython and IronPython. This is not purely theoretical, as >> zope.interface tries to set Implements declaration as __implemented__ >> attribute of built-in type object, and excepts TypeError. >> >> Python 2.6.1 >>>>> >>>>> object.flag = True >> >> TypeError: can't set attributes of built-in/extension type 'object' >> >> IronPython 2.6 >>>>> >>>>> object.flag = True >> >> AttributeError: 'object' object has no attribute 'flag' >> >> I was surprised that CPython raises TypeError. Library Reference seems >> to mention it here: >> >> exception AttributeError >> Raised when an attribute reference or assignment fails. (When an >> object does not support attribute references or attribute assignments >> at all, TypeError is raised.) >> http://docs.python.org/library/exceptions.html >> >> What does it mean that "an object does not support attribute >> references or attribute assignments at all"? >> > Here's my guess: > > Some objects have a fixed (and possibly empty) set of attributes. > Attempting to add a new attribute or get a non-existent attribute raises > an AttributeError. > > Other objects, such as types (are there any that aren't types?), don't > have attributes at all. Attempting to add or get an attribute raises a > TypeError. This particular error comes (grep tells me :-) from type_setattro() in Objects/typeobject.c. It makes a specific check whether the type object whose attribute you want to set is a "built-in type" (this is done by checking the HEAPTYPE flag, which is never set for built-in types and always for user-defined types). For built-in types it disallows setting attributes. This is a pure policy issue: it prevents different 3rd party modules to make incompatible modifications of built-in types. In general, CPython isn't always consistent in raising AttributeError and TypeError when it comes to such policy issues: there are various places that raise TypeError in typeobject.c (and probably elsewhere) that simply forbid setting a specific attribute (another example is __name__). Given how poorly Python exceptions are specified in general, I don't want to hold IronPython to this standard (nor CPython :-). The reason this breaks zope.interfaces in IronPython is probably just that zope.interfaces was primarily written/tested against CPython. Going back to the phrase quoted from the reference manual, it's probably referring to the possibility that a type's tp_getattro slot is NULL; but even so it's wrong: PyObject_GetAttr() raises AttributeError in this case. Uselessly y'rs, -- --Guido van Rossum (home page: http://www.python.org/~guido/) From et at et3d.com Mon Jun 15 08:47:27 2009 From: et at et3d.com (ET3D) Date: Sun, 14 Jun 2009 23:47:27 -0700 (PDT) Subject: [IronPython] How do I SetVariable to None? Message-ID: <24018839.post@talk.nabble.com> I'm using ScriptScope.SetVariable to set variables in C# for calling IronPython scripts. However, I can't find how to set a variable to None. -- View this message in context: http://www.nabble.com/How-do-I-SetVariable-to-None--tp24018839p24018839.html Sent from the IronPython mailing list archive at Nabble.com. From fuzzyman at voidspace.org.uk Mon Jun 15 11:38:21 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 15 Jun 2009 10:38:21 +0100 Subject: [IronPython] How do I SetVariable to None? In-Reply-To: <24018839.post@talk.nabble.com> References: <24018839.post@talk.nabble.com> Message-ID: <4A36168D.9070706@voidspace.org.uk> ET3D wrote: > I'm using ScriptScope.SetVariable to set variables in C# for calling > IronPython scripts. However, I can't find how to set a variable to None. > You should just be able to set it to null from C#. Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From et at et3d.com Mon Jun 15 11:50:34 2009 From: et at et3d.com (ET3D) Date: Mon, 15 Jun 2009 02:50:34 -0700 (PDT) Subject: [IronPython] How do I SetVariable to None? In-Reply-To: <4A36168D.9070706@voidspace.org.uk> References: <24018839.post@talk.nabble.com> <4A36168D.9070706@voidspace.org.uk> Message-ID: <24031784.post@talk.nabble.com> ET3D wrote: > I'm using ScriptScope.SetVariable to set variables in C# for calling > IronPython scripts. However, I can't find how to set a variable to None. > You should just be able to set it to null from C#. Should have mentioned I tried this (scope.SetVariable("f", null);). It gives a ArgumentNullException. -- View this message in context: http://www.nabble.com/How-do-I-SetVariable-to-None--tp24018839p24031784.html Sent from the IronPython mailing list archive at Nabble.com. From patrick at toolmaker.nl Mon Jun 15 14:15:28 2009 From: patrick at toolmaker.nl (Patrick van der Willik) Date: Mon, 15 Jun 2009 14:15:28 +0200 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> References: <4A311578.2000604@toolmaker.nl> <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> Message-ID: <4A363B60.1040006@toolmaker.nl> I'm a bit late with responding to this as I was kinda busy. I used the code that was given Stephen and it seems to run properly without throwing exceptions. However, I created a little autoexec.py file with a simple function in it with 2 parameters. The main problem here is: How do I call the function through the scope? I used engine.CreateScope() to create myself a new scope, but from there on, I'm basically lost(again). What I basically want to do, is call my function 'add' with 2 parameters(say, 10 and 15). The modules itself are loaded into a ScriptSource. Thanks, Patrick Lepisto, Stephen P wrote: > > What I do when I want to work with python modules from embedded > IronPython is set the IronPython search path with the path of the > module to load then create and execute a small python script that > loads the main python modules into the current scope. > > > > string moduleName = Path.GetFileName(modulePath); > > string path = Path.GetDirectoryName(modulePath); > > > > ICollection paths = _pythonEngine.GetSearchPaths(); > > if (!paths.Contains(path)) > > { > > paths.Add(path); > > _pythonEngine.SetSearchPaths(paths); > > } > > string modInvoke = String.Format("import {0}\nfrom {0} import *\n", > moduleName); > > ScriptSource source = > _pythonEngine.CreateScriptSourceFromString(modInvoke, > > > Microsoft.Scripting.SourceCodeKind.Statements); > > > > Where modulePath is the full path to the python module or package to load. > > > > I can then invoke methods or access attributes using the IronPython > scope. In this way, I can interact with the python modules for as > long as necessary before closing down the scope/engine. > > > > > > *From:* users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Dody Gunawinata > *Sent:* Thursday, June 11, 2009 9:09 AM > *To:* Discussion of IronPython > *Subject:* Re: [IronPython] Embedding IronPython and calling python > functions from C# > > > > You can read all yours file scripts, then using StringBuilder to > combine then and call CreateScriptSourceFromString() > > Then you can call your functions within the combined scripts normally. > Pretty much you are creating a giant source code on the fly. > > > > On Thu, Jun 11, 2009 at 5:32 PM, Patrick van der Willik > > wrote: > > I'm currently attempting to embed the IronPython 2 runtimes into an > existing application written in C#. However, I find the amount of > documentation lacking on what I'm trying to do. I currently have a > proof-of-concept version which uses Lua and LuaInterface, but the > people who have to write the scripts dislike Lua(Well, more hate it > with a passion) and would love to see this working with Python. > > My host application is a networked application that must trigger > certain scripts functions on events generated by the connected > clients. The idea is that when my application starts, it will load the > IronPython script environment, launches an 'autoexec.py' which will > load various other scripts files and do some housekeeping. Once this > all is completed, it will start listening to incoming connections. > However, in various scenarios, the application has to trigger scripted > functions when data is received from a client. Which script function > is called is different per client and per event. I have events for > connecting, logging on, disconnecting and a set of data specific > events after receiving data. This highly depends on the received packets. > > My question here is: How do I embed IronPython in such a fashion that > I can load my scripts and then trigger various functions within that? > I've seen many examples that just call CreateScriptSourceFromString() > or File each time in which just 1 piece of code is implemented. This > is not suitable for the needs here because the scripted systems can > become quite complex. > > With regards, > Patrick > > > _______________________________________________ > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Jun 15 14:40:31 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 15 Jun 2009 13:40:31 +0100 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <4A363B60.1040006@toolmaker.nl> References: <4A311578.2000604@toolmaker.nl> <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> <4A363B60.1040006@toolmaker.nl> Message-ID: <4A36413F.5060704@voidspace.org.uk> See this section of my hosting article: http://www.voidspace.org.uk/ironpython/hosting_api.shtml#functions-as-delegates You cast the function to a delegate as you fetch it out of the scope. Michael Patrick van der Willik wrote: > I'm a bit late with responding to this as I was kinda busy. I used the > code that was given Stephen and it seems to run properly without > throwing exceptions. However, I created a little autoexec.py file with > a simple function in it with 2 parameters. > > The main problem here is: How do I call the function through the > scope? I used engine.CreateScope() to create myself a new scope, but > from there on, I'm basically lost(again). What I basically want to do, > is call my function 'add' with 2 parameters(say, 10 and 15). The > modules itself are loaded into a ScriptSource. > > Thanks, > Patrick > > Lepisto, Stephen P wrote: >> >> What I do when I want to work with python modules from embedded >> IronPython is set the IronPython search path with the path of the >> module to load then create and execute a small python script that >> loads the main python modules into the current scope. >> >> >> >> string moduleName = Path.GetFileName(modulePath); >> >> string path = Path.GetDirectoryName(modulePath); >> >> >> >> ICollection paths = _pythonEngine.GetSearchPaths(); >> >> if (!paths.Contains(path)) >> >> { >> >> paths.Add(path); >> >> _pythonEngine.SetSearchPaths(paths); >> >> } >> >> string modInvoke = String.Format("import {0}\nfrom {0} import *\n", >> moduleName); >> >> ScriptSource source = >> _pythonEngine.CreateScriptSourceFromString(modInvoke, >> >> >> Microsoft.Scripting.SourceCodeKind.Statements); >> >> >> >> Where modulePath is the full path to the python module or package to >> load. >> >> >> >> I can then invoke methods or access attributes using the IronPython >> scope. In this way, I can interact with the python modules for as >> long as necessary before closing down the scope/engine. >> >> >> >> >> >> *From:* users-bounces at lists.ironpython.com >> [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Dody >> Gunawinata >> *Sent:* Thursday, June 11, 2009 9:09 AM >> *To:* Discussion of IronPython >> *Subject:* Re: [IronPython] Embedding IronPython and calling python >> functions from C# >> >> >> >> You can read all yours file scripts, then using StringBuilder to >> combine then and call CreateScriptSourceFromString() >> >> Then you can call your functions within the combined scripts >> normally. Pretty much you are creating a giant source code on the fly. >> >> >> >> On Thu, Jun 11, 2009 at 5:32 PM, Patrick van der Willik >> > wrote: >> >> I'm currently attempting to embed the IronPython 2 runtimes into an >> existing application written in C#. However, I find the amount of >> documentation lacking on what I'm trying to do. I currently have a >> proof-of-concept version which uses Lua and LuaInterface, but the >> people who have to write the scripts dislike Lua(Well, more hate it >> with a passion) and would love to see this working with Python. >> >> My host application is a networked application that must trigger >> certain scripts functions on events generated by the connected >> clients. The idea is that when my application starts, it will load >> the IronPython script environment, launches an 'autoexec.py' which >> will load various other scripts files and do some housekeeping. Once >> this all is completed, it will start listening to incoming >> connections. However, in various scenarios, the application has to >> trigger scripted functions when data is received from a client. Which >> script function is called is different per client and per event. I >> have events for connecting, logging on, disconnecting and a set of >> data specific events after receiving data. This highly depends on the >> received packets. >> >> My question here is: How do I embed IronPython in such a fashion that >> I can load my scripts and then trigger various functions within that? >> I've seen many examples that just call CreateScriptSourceFromString() >> or File each time in which just 1 piece of code is implemented. This >> is not suitable for the needs here because the scripted systems can >> become quite complex. >> >> With regards, >> Patrick >> >> >> _______________________________________________ >> 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 >> > > ------------------------------------------------------------------------ > > _______________________________________________ > 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/blog From guido at python.org Mon Jun 15 16:48:33 2009 From: guido at python.org (Guido van Rossum) Date: Mon, 15 Jun 2009 07:48:33 -0700 Subject: [IronPython] [Python-Dev] Exception for setting attributes of built-in type In-Reply-To: References: <5b0248170906141209y4398defanacfd0bb62504e550@mail.gmail.com> <4A357CF0.2050604@mrabarnett.plus.com> Message-ID: On Sun, Jun 14, 2009 at 4:19 PM, Guido van Rossum wrote: > In general, CPython isn't always consistent in raising AttributeError > and TypeError when it comes to such policy issues: there are various > places that raise TypeError in typeobject.c (and probably elsewhere) > that simply forbid setting a specific attribute (another example is > __name__). I should add that this policy is also forced somewhat by the existence of the "multiple interpreters in one address space" feature, which is used e.g. by mod_python. This feature attempts to provide isolation between interpreters to the point that each one can have a completely different set of modules loaded and can be working on a totally different application. The implementation of CPython shares built-in types between multiple interpreters (and it wouldn't be easy to change this); if you were able to modify a built-in type from one interpreter, all other interpreters would see that same modification. -- --Guido van Rossum (home page: http://www.python.org/~guido/) From dinov at microsoft.com Mon Jun 15 17:54:51 2009 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 15 Jun 2009 15:54:51 +0000 Subject: [IronPython] [Python-Dev] Exception for setting attributes of built-in type In-Reply-To: References: <5b0248170906141209y4398defanacfd0bb62504e550@mail.gmail.com> <4A357CF0.2050604@mrabarnett.plus.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD0324503A@TK5EX14MBXC116.redmond.corp.microsoft.com> Guido wrote: > I should add that this policy is also forced somewhat by the existence > of the "multiple interpreters in one address space" feature, which is > used e.g. by mod_python. This feature attempts to provide isolation > between interpreters to the point that each one can have a completely > different set of modules loaded and can be working on a totally > different application. The implementation of CPython shares built-in > types between multiple interpreters (and it wouldn't be easy to change > this); if you were able to modify a built-in type from one > interpreter, all other interpreters would see that same modification. IronPython is in the exact same boat here - we share built-in types Across multiple Python engines as well. From dinov at microsoft.com Mon Jun 15 18:08:02 2009 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 15 Jun 2009 16:08:02 +0000 Subject: [IronPython] How do I SetVariable to None? In-Reply-To: <24031784.post@talk.nabble.com> References: <24018839.post@talk.nabble.com> <4A36168D.9070706@voidspace.org.uk> <24031784.post@talk.nabble.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD032450A1@TK5EX14MBXC116.redmond.corp.microsoft.com> You probably need to actually cast null to (object). I suspect you could be getting the ObjectHandle overload which is used for remoting purposes. I'm a little surprised C# doesn't report this as ambiguous but then again IronPython doesn't either and selects the ObjectHandle overload just like C#. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of ET3D Sent: Monday, June 15, 2009 2:51 AM To: users at lists.ironpython.com Subject: Re: [IronPython] How do I SetVariable to None? ET3D wrote: > I'm using ScriptScope.SetVariable to set variables in C# for calling > IronPython scripts. However, I can't find how to set a variable to None. > You should just be able to set it to null from C#. Should have mentioned I tried this (scope.SetVariable("f", null);). It gives a ArgumentNullException. -- View this message in context: http://www.nabble.com/How-do-I-SetVariable-to-None--tp24018839p24031784.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 fuzzyman at voidspace.org.uk Mon Jun 15 18:10:08 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 15 Jun 2009 17:10:08 +0100 Subject: [IronPython] [Python-Dev] Exception for setting attributes of built-in type In-Reply-To: <1A472770E042064698CB5ADC83A12ACD0324503A@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <5b0248170906141209y4398defanacfd0bb62504e550@mail.gmail.com> <4A357CF0.2050604@mrabarnett.plus.com> <1A472770E042064698CB5ADC83A12ACD0324503A@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4A367260.2010400@voidspace.org.uk> Dino Viehland wrote: > Guido wrote: > >> I should add that this policy is also forced somewhat by the existence >> of the "multiple interpreters in one address space" feature, which is >> used e.g. by mod_python. This feature attempts to provide isolation >> between interpreters to the point that each one can have a completely >> different set of modules loaded and can be working on a totally >> different application. The implementation of CPython shares built-in >> types between multiple interpreters (and it wouldn't be easy to change >> this); if you were able to modify a built-in type from one >> interpreter, all other interpreters would see that same modification. >> > > IronPython is in the exact same boat here - we share built-in types > Across multiple Python engines as well. > > > And indeed it is needed - if you are working with multiple interpreters (engines in IronPython) you don't want isinstance(something, dict) to fail because it is a dictionary from a different interpreter... Michael > _______________________________________________ > Python-Dev mailing list > Python-Dev at python.org > http://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From guido at python.org Mon Jun 15 19:10:59 2009 From: guido at python.org (Guido van Rossum) Date: Mon, 15 Jun 2009 10:10:59 -0700 Subject: [IronPython] [Python-Dev] Exception for setting attributes of built-in type In-Reply-To: <4A367260.2010400@voidspace.org.uk> References: <5b0248170906141209y4398defanacfd0bb62504e550@mail.gmail.com> <4A357CF0.2050604@mrabarnett.plus.com> <1A472770E042064698CB5ADC83A12ACD0324503A@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A367260.2010400@voidspace.org.uk> Message-ID: On Mon, Jun 15, 2009 at 9:10 AM, Michael Foord wrote: > Dino Viehland wrote: >> Guido wrote: >>> I should add that this policy is also forced somewhat by the existence >>> of the "multiple interpreters in one address space" feature, which is >>> used e.g. by mod_python. This feature attempts to provide isolation >>> between interpreters to the point that each one can have a completely >>> different set of modules loaded and can be working on a totally >>> different application. The implementation of CPython shares built-in >>> types between multiple interpreters (and it wouldn't be easy to change >>> this); if you were able to modify a built-in type from one >>> interpreter, all other interpreters would see that same modification. >> IronPython is in the exact same boat here - we share built-in types >> Across multiple Python engines as well. > And indeed it is needed - if you are working with multiple interpreters > (engines in IronPython) you don't want isinstance(something, dict) to fail > because it is a dictionary from a different interpreter... Ah, but that suggests you have sharing between different interpreters. If you're doing that, perhaps you shouldn't be using multiple interpreters, but instead multiple threads? -- --Guido van Rossum (home page: http://www.python.org/~guido/) From fuzzyman at voidspace.org.uk Mon Jun 15 19:20:41 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 15 Jun 2009 18:20:41 +0100 Subject: [IronPython] [Python-Dev] Exception for setting attributes of built-in type In-Reply-To: References: <5b0248170906141209y4398defanacfd0bb62504e550@mail.gmail.com> <4A357CF0.2050604@mrabarnett.plus.com> <1A472770E042064698CB5ADC83A12ACD0324503A@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A367260.2010400@voidspace.org.uk> Message-ID: <4A3682E9.3000405@voidspace.org.uk> Guido van Rossum wrote: > On Mon, Jun 15, 2009 at 9:10 AM, Michael Foord wrote: > >> Dino Viehland wrote: >> >>> Guido wrote: >>> >>>> I should add that this policy is also forced somewhat by the existence >>>> of the "multiple interpreters in one address space" feature, which is >>>> used e.g. by mod_python. This feature attempts to provide isolation >>>> between interpreters to the point that each one can have a completely >>>> different set of modules loaded and can be working on a totally >>>> different application. The implementation of CPython shares built-in >>>> types between multiple interpreters (and it wouldn't be easy to change >>>> this); if you were able to modify a built-in type from one >>>> interpreter, all other interpreters would see that same modification. >>>> > > >>> IronPython is in the exact same boat here - we share built-in types >>> Across multiple Python engines as well. >>> > > >> And indeed it is needed - if you are working with multiple interpreters >> (engines in IronPython) you don't want isinstance(something, dict) to fail >> because it is a dictionary from a different interpreter... >> > > Ah, but that suggests you have sharing between different interpreters. > If you're doing that, perhaps you shouldn't be using multiple > interpreters, but instead multiple threads? > > Well, in our use case we use multiple engines to provide an isolated execution context for every document (the Resolver One spreadsheet written in IronPython). Each of these has their own calculation thread as well - but the engine per document structure is nice and clean and means each document can have its own set of modules loaded without affecting the other documents (although they share a core set of modules). Once we move these engines into their own app domains we can completely isolate each document and apply separate security permissions to each one. That might mean each document effectively paying the not-insubstantial startup time hit and we haven't begun to look at how to mitigate that. Michael -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/blog From i-ellang at microsoft.com Mon Jun 15 20:32:24 2009 From: i-ellang at microsoft.com (Elise Langham (Elanit)) Date: Mon, 15 Jun 2009 19:32:24 +0100 Subject: [IronPython] private functions within a module Message-ID: <361073EA5313C84E95A847FF752AD9653D5033C69F@EA-EXMSG-C334.europe.corp.microsoft.com> How can i define some functions within a module as private ? Do i need to make them part of a static class ? or is this this not possible? Thanks, Elise -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Jun 15 20:34:22 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 15 Jun 2009 19:34:22 +0100 Subject: [IronPython] private functions within a module In-Reply-To: <361073EA5313C84E95A847FF752AD9653D5033C69F@EA-EXMSG-C334.europe.corp.microsoft.com> References: <361073EA5313C84E95A847FF752AD9653D5033C69F@EA-EXMSG-C334.europe.corp.microsoft.com> Message-ID: <4A36942E.7020906@voidspace.org.uk> Elise Langham (Elanit) wrote: > > How can i define some functions within a module as private ? > > Do i need to make them part of a static class ? or is this this not > possible? > The convention is to start their names with an underscore. That will tell other developers not to call them directly. Michael > Thanks, > > > > Elise > > ------------------------------------------------------------------------ > > _______________________________________________ > 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/blog From patrick at toolmaker.nl Tue Jun 16 01:09:51 2009 From: patrick at toolmaker.nl (Patrick van der Willik) Date: Tue, 16 Jun 2009 01:09:51 +0200 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <4A36413F.5060704@voidspace.org.uk> References: <4A311578.2000604@toolmaker.nl> <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> <4A363B60.1040006@toolmaker.nl> <4A36413F.5060704@voidspace.org.uk> Message-ID: <4A36D4BF.9000608@toolmaker.nl> Alright, that actually really worked pretty good, and I finally got it all working as it should. However, I'm running into 1 more little issue, now I need to go the other way around aswell. I have several functions marked in my application as PythonExportable. In a certain startup phase of the application, after creating the IronPython hosting environment, I walk over all these classes using Reflection, take the tagged functions and put these into my IP scope. However, my simple tests for some reason cause my SetVariable() calls to not work. I added 2 tests to my scripts, one where I add a variable into the scope and another one where I add a delegate. However, in both cases, whenever I use these variables from within my scripts, they don't seem to work. Code: Func test = new Func(Test); scope.SetVariable("x", 10); scope.SetVariable("Test", test); Accessing them in my scripts have the effect of triggering an exception that shows that x is undefined. Some insights into this would be of great help. Patrick Michael Foord wrote: > See this section of my hosting article: > > http://www.voidspace.org.uk/ironpython/hosting_api.shtml#functions-as-delegates > > > You cast the function to a delegate as you fetch it out of the scope. > > Michael > > Patrick van der Willik wrote: >> I'm a bit late with responding to this as I was kinda busy. I used >> the code that was given Stephen and it seems to run properly without >> throwing exceptions. However, I created a little autoexec.py file >> with a simple function in it with 2 parameters. >> >> The main problem here is: How do I call the function through the >> scope? I used engine.CreateScope() to create myself a new scope, but >> from there on, I'm basically lost(again). What I basically want to >> do, is call my function 'add' with 2 parameters(say, 10 and 15). The >> modules itself are loaded into a ScriptSource. >> >> Thanks, >> Patrick >> >> Lepisto, Stephen P wrote: >>> >>> What I do when I want to work with python modules from embedded >>> IronPython is set the IronPython search path with the path of the >>> module to load then create and execute a small python script that >>> loads the main python modules into the current scope. >>> >>> >>> >>> string moduleName = Path.GetFileName(modulePath); >>> >>> string path = Path.GetDirectoryName(modulePath); >>> >>> >>> >>> ICollection paths = _pythonEngine.GetSearchPaths(); >>> >>> if (!paths.Contains(path)) >>> >>> { >>> >>> paths.Add(path); >>> >>> _pythonEngine.SetSearchPaths(paths); >>> >>> } >>> >>> string modInvoke = String.Format("import {0}\nfrom {0} import *\n", >>> moduleName); >>> >>> ScriptSource source = >>> _pythonEngine.CreateScriptSourceFromString(modInvoke, >>> >>> >>> Microsoft.Scripting.SourceCodeKind.Statements); >>> >>> >>> >>> Where modulePath is the full path to the python module or package to >>> load. >>> >>> >>> >>> I can then invoke methods or access attributes using the IronPython >>> scope. In this way, I can interact with the python modules for as >>> long as necessary before closing down the scope/engine. >>> >>> >>> >>> >>> >>> *From:* users-bounces at lists.ironpython.com >>> [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Dody >>> Gunawinata >>> *Sent:* Thursday, June 11, 2009 9:09 AM >>> *To:* Discussion of IronPython >>> *Subject:* Re: [IronPython] Embedding IronPython and calling python >>> functions from C# >>> >>> >>> >>> You can read all yours file scripts, then using StringBuilder to >>> combine then and call CreateScriptSourceFromString() >>> >>> Then you can call your functions within the combined scripts >>> normally. Pretty much you are creating a giant source code on the fly. >>> >>> >>> >>> On Thu, Jun 11, 2009 at 5:32 PM, Patrick van der Willik >>> > wrote: >>> >>> I'm currently attempting to embed the IronPython 2 runtimes into an >>> existing application written in C#. However, I find the amount of >>> documentation lacking on what I'm trying to do. I currently have a >>> proof-of-concept version which uses Lua and LuaInterface, but the >>> people who have to write the scripts dislike Lua(Well, more hate it >>> with a passion) and would love to see this working with Python. >>> >>> My host application is a networked application that must trigger >>> certain scripts functions on events generated by the connected >>> clients. The idea is that when my application starts, it will load >>> the IronPython script environment, launches an 'autoexec.py' which >>> will load various other scripts files and do some housekeeping. Once >>> this all is completed, it will start listening to incoming >>> connections. However, in various scenarios, the application has to >>> trigger scripted functions when data is received from a client. >>> Which script function is called is different per client and per >>> event. I have events for connecting, logging on, disconnecting and a >>> set of data specific events after receiving data. This highly >>> depends on the received packets. >>> >>> My question here is: How do I embed IronPython in such a fashion >>> that I can load my scripts and then trigger various functions within >>> that? I've seen many examples that just call >>> CreateScriptSourceFromString() or File each time in which just 1 >>> piece of code is implemented. This is not suitable for the needs >>> here because the scripted systems can become quite complex. >>> >>> With regards, >>> Patrick >>> >>> >>> _______________________________________________ >>> 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 >>> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > > From patrick at toolmaker.nl Tue Jun 16 01:09:51 2009 From: patrick at toolmaker.nl (Patrick van der Willik) Date: Tue, 16 Jun 2009 01:09:51 +0200 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <4A36413F.5060704@voidspace.org.uk> References: <4A311578.2000604@toolmaker.nl> <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> <4A363B60.1040006@toolmaker.nl> <4A36413F.5060704@voidspace.org.uk> Message-ID: <4A36D4BF.9000608@toolmaker.nl> Alright, that actually really worked pretty good, and I finally got it all working as it should. However, I'm running into 1 more little issue, now I need to go the other way around aswell. I have several functions marked in my application as PythonExportable. In a certain startup phase of the application, after creating the IronPython hosting environment, I walk over all these classes using Reflection, take the tagged functions and put these into my IP scope. However, my simple tests for some reason cause my SetVariable() calls to not work. I added 2 tests to my scripts, one where I add a variable into the scope and another one where I add a delegate. However, in both cases, whenever I use these variables from within my scripts, they don't seem to work. Code: Func test = new Func(Test); scope.SetVariable("x", 10); scope.SetVariable("Test", test); Accessing them in my scripts have the effect of triggering an exception that shows that x is undefined. Some insights into this would be of great help. Patrick Michael Foord wrote: > See this section of my hosting article: > > http://www.voidspace.org.uk/ironpython/hosting_api.shtml#functions-as-delegates > > > You cast the function to a delegate as you fetch it out of the scope. > > Michael > > Patrick van der Willik wrote: >> I'm a bit late with responding to this as I was kinda busy. I used >> the code that was given Stephen and it seems to run properly without >> throwing exceptions. However, I created a little autoexec.py file >> with a simple function in it with 2 parameters. >> >> The main problem here is: How do I call the function through the >> scope? I used engine.CreateScope() to create myself a new scope, but >> from there on, I'm basically lost(again). What I basically want to >> do, is call my function 'add' with 2 parameters(say, 10 and 15). The >> modules itself are loaded into a ScriptSource. >> >> Thanks, >> Patrick >> >> Lepisto, Stephen P wrote: >>> >>> What I do when I want to work with python modules from embedded >>> IronPython is set the IronPython search path with the path of the >>> module to load then create and execute a small python script that >>> loads the main python modules into the current scope. >>> >>> >>> >>> string moduleName = Path.GetFileName(modulePath); >>> >>> string path = Path.GetDirectoryName(modulePath); >>> >>> >>> >>> ICollection paths = _pythonEngine.GetSearchPaths(); >>> >>> if (!paths.Contains(path)) >>> >>> { >>> >>> paths.Add(path); >>> >>> _pythonEngine.SetSearchPaths(paths); >>> >>> } >>> >>> string modInvoke = String.Format("import {0}\nfrom {0} import *\n", >>> moduleName); >>> >>> ScriptSource source = >>> _pythonEngine.CreateScriptSourceFromString(modInvoke, >>> >>> >>> Microsoft.Scripting.SourceCodeKind.Statements); >>> >>> >>> >>> Where modulePath is the full path to the python module or package to >>> load. >>> >>> >>> >>> I can then invoke methods or access attributes using the IronPython >>> scope. In this way, I can interact with the python modules for as >>> long as necessary before closing down the scope/engine. >>> >>> >>> >>> >>> >>> *From:* users-bounces at lists.ironpython.com >>> [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Dody >>> Gunawinata >>> *Sent:* Thursday, June 11, 2009 9:09 AM >>> *To:* Discussion of IronPython >>> *Subject:* Re: [IronPython] Embedding IronPython and calling python >>> functions from C# >>> >>> >>> >>> You can read all yours file scripts, then using StringBuilder to >>> combine then and call CreateScriptSourceFromString() >>> >>> Then you can call your functions within the combined scripts >>> normally. Pretty much you are creating a giant source code on the fly. >>> >>> >>> >>> On Thu, Jun 11, 2009 at 5:32 PM, Patrick van der Willik >>> > wrote: >>> >>> I'm currently attempting to embed the IronPython 2 runtimes into an >>> existing application written in C#. However, I find the amount of >>> documentation lacking on what I'm trying to do. I currently have a >>> proof-of-concept version which uses Lua and LuaInterface, but the >>> people who have to write the scripts dislike Lua(Well, more hate it >>> with a passion) and would love to see this working with Python. >>> >>> My host application is a networked application that must trigger >>> certain scripts functions on events generated by the connected >>> clients. The idea is that when my application starts, it will load >>> the IronPython script environment, launches an 'autoexec.py' which >>> will load various other scripts files and do some housekeeping. Once >>> this all is completed, it will start listening to incoming >>> connections. However, in various scenarios, the application has to >>> trigger scripted functions when data is received from a client. >>> Which script function is called is different per client and per >>> event. I have events for connecting, logging on, disconnecting and a >>> set of data specific events after receiving data. This highly >>> depends on the received packets. >>> >>> My question here is: How do I embed IronPython in such a fashion >>> that I can load my scripts and then trigger various functions within >>> that? I've seen many examples that just call >>> CreateScriptSourceFromString() or File each time in which just 1 >>> piece of code is implemented. This is not suitable for the needs >>> here because the scripted systems can become quite complex. >>> >>> With regards, >>> Patrick >>> >>> >>> _______________________________________________ >>> 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 >>> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> 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 16 01:14:27 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 16 Jun 2009 00:14:27 +0100 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <4A36D4BF.9000608@toolmaker.nl> References: <4A311578.2000604@toolmaker.nl> <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> <4A363B60.1040006@toolmaker.nl> <4A36413F.5060704@voidspace.org.uk> <4A36D4BF.9000608@toolmaker.nl> Message-ID: <4A36D5D3.9080302@voidspace.org.uk> Patrick van der Willik wrote: > Alright, that actually really worked pretty good, and I finally got it > all working as it should. However, I'm running into 1 more little > issue, now I need to go the other way around aswell. I have several > functions marked in my application as PythonExportable. In a certain > startup phase of the application, after creating the IronPython > hosting environment, I walk over all these classes using Reflection, > take the tagged functions and put these into my IP scope. > > However, my simple tests for some reason cause my SetVariable() calls > to not work. I added 2 tests to my scripts, one where I add a variable > into the scope and another one where I add a delegate. However, in > both cases, whenever I use these variables from within my scripts, > they don't seem to work. Code: > Func test = new Func(Test); > scope.SetVariable("x", 10); > scope.SetVariable("Test", test); > > Accessing them in my scripts have the effect of triggering an > exception that shows that x is undefined. Can you show the actual code that attempts to use them and the actual exception message raised. Michael > > Some insights into this would be of great help. > > Patrick > > Michael Foord wrote: >> See this section of my hosting article: >> >> http://www.voidspace.org.uk/ironpython/hosting_api.shtml#functions-as-delegates >> >> >> You cast the function to a delegate as you fetch it out of the scope. >> >> Michael >> >> Patrick van der Willik wrote: >>> I'm a bit late with responding to this as I was kinda busy. I used >>> the code that was given Stephen and it seems to run properly without >>> throwing exceptions. However, I created a little autoexec.py file >>> with a simple function in it with 2 parameters. >>> >>> The main problem here is: How do I call the function through the >>> scope? I used engine.CreateScope() to create myself a new scope, but >>> from there on, I'm basically lost(again). What I basically want to >>> do, is call my function 'add' with 2 parameters(say, 10 and 15). The >>> modules itself are loaded into a ScriptSource. >>> >>> Thanks, >>> Patrick >>> >>> Lepisto, Stephen P wrote: >>>> >>>> What I do when I want to work with python modules from embedded >>>> IronPython is set the IronPython search path with the path of the >>>> module to load then create and execute a small python script that >>>> loads the main python modules into the current scope. >>>> >>>> >>>> >>>> string moduleName = Path.GetFileName(modulePath); >>>> >>>> string path = Path.GetDirectoryName(modulePath); >>>> >>>> >>>> >>>> ICollection paths = _pythonEngine.GetSearchPaths(); >>>> >>>> if (!paths.Contains(path)) >>>> >>>> { >>>> >>>> paths.Add(path); >>>> >>>> _pythonEngine.SetSearchPaths(paths); >>>> >>>> } >>>> >>>> string modInvoke = String.Format("import {0}\nfrom {0} import *\n", >>>> moduleName); >>>> >>>> ScriptSource source = >>>> _pythonEngine.CreateScriptSourceFromString(modInvoke, >>>> >>>> >>>> Microsoft.Scripting.SourceCodeKind.Statements); >>>> >>>> >>>> >>>> Where modulePath is the full path to the python module or package >>>> to load. >>>> >>>> >>>> >>>> I can then invoke methods or access attributes using the IronPython >>>> scope. In this way, I can interact with the python modules for as >>>> long as necessary before closing down the scope/engine. >>>> >>>> >>>> >>>> >>>> >>>> *From:* users-bounces at lists.ironpython.com >>>> [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Dody >>>> Gunawinata >>>> *Sent:* Thursday, June 11, 2009 9:09 AM >>>> *To:* Discussion of IronPython >>>> *Subject:* Re: [IronPython] Embedding IronPython and calling python >>>> functions from C# >>>> >>>> >>>> >>>> You can read all yours file scripts, then using StringBuilder to >>>> combine then and call CreateScriptSourceFromString() >>>> >>>> Then you can call your functions within the combined scripts >>>> normally. Pretty much you are creating a giant source code on the fly. >>>> >>>> >>>> >>>> On Thu, Jun 11, 2009 at 5:32 PM, Patrick van der Willik >>>> > wrote: >>>> >>>> I'm currently attempting to embed the IronPython 2 runtimes into an >>>> existing application written in C#. However, I find the amount of >>>> documentation lacking on what I'm trying to do. I currently have a >>>> proof-of-concept version which uses Lua and LuaInterface, but the >>>> people who have to write the scripts dislike Lua(Well, more hate it >>>> with a passion) and would love to see this working with Python. >>>> >>>> My host application is a networked application that must trigger >>>> certain scripts functions on events generated by the connected >>>> clients. The idea is that when my application starts, it will load >>>> the IronPython script environment, launches an 'autoexec.py' which >>>> will load various other scripts files and do some housekeeping. >>>> Once this all is completed, it will start listening to incoming >>>> connections. However, in various scenarios, the application has to >>>> trigger scripted functions when data is received from a client. >>>> Which script function is called is different per client and per >>>> event. I have events for connecting, logging on, disconnecting and >>>> a set of data specific events after receiving data. This highly >>>> depends on the received packets. >>>> >>>> My question here is: How do I embed IronPython in such a fashion >>>> that I can load my scripts and then trigger various functions >>>> within that? I've seen many examples that just call >>>> CreateScriptSourceFromString() or File each time in which just 1 >>>> piece of code is implemented. This is not suitable for the needs >>>> here because the scripted systems can become quite complex. >>>> >>>> With regards, >>>> Patrick >>>> >>>> >>>> _______________________________________________ >>>> 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 >>>> >>> >>> ------------------------------------------------------------------------ >>> >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.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/blog From patrick at toolmaker.nl Tue Jun 16 01:26:17 2009 From: patrick at toolmaker.nl (Patrick van der Willik) Date: Tue, 16 Jun 2009 01:26:17 +0200 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <4A36D5D3.9080302@voidspace.org.uk> References: <4A311578.2000604@toolmaker.nl> <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> <4A363B60.1040006@toolmaker.nl> <4A36413F.5060704@voidspace.org.uk> <4A36D4BF.9000608@toolmaker.nl> <4A36D5D3.9080302@voidspace.org.uk> Message-ID: <4A36D899.4020600@toolmaker.nl> The actual code that uses these variables from within a script looks like this: def OnConnect(user): s = "The value of x: " + str(x) user.Send(s, True) user.Receiver = "user_username" return True And the complete exception is: [ERROR] [16-6-2009 1:18:16] An error occured while attempting to accept a new connection. Error: name 'x' is not defined [ERROR] [16-6-2009 1:18:16] Stacktrace: at IronPython.Runtime.PythonContext.MissingName(SymbolId name) at Microsoft.Scripting.Runtime.ModuleGlobalWrapper.GetCachedValue() at Microsoft.Scripting.Runtime.ModuleGlobalWrapper.get_CurrentValue() at S$2.OnConnect$6(Object user) at _stub_$17##8(Closure , CallSite , Object , User ) at Microsoft.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4 target, CallSite site, Object[] args) 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 System.Boolean(User)(Object[] , User ) at TestProject.Users.ConnectionManager.AcceptNewConnnections() in C:\Users\Patrick\Documents\Visual Studio 2008\Projects\test\TestProject\Users\ConnectionManager.cs :line 108 Weird thing is: If I use GetVariable, it works fine. The call is done at a later location in the program that where I do the SetVariable, but the script scope hasn't ben changed in the meantime. Patrick Michael Foord wrote: > Patrick van der Willik wrote: >> Alright, that actually really worked pretty good, and I finally got >> it all working as it should. However, I'm running into 1 more little >> issue, now I need to go the other way around aswell. I have several >> functions marked in my application as PythonExportable. In a certain >> startup phase of the application, after creating the IronPython >> hosting environment, I walk over all these classes using Reflection, >> take the tagged functions and put these into my IP scope. >> >> However, my simple tests for some reason cause my SetVariable() calls >> to not work. I added 2 tests to my scripts, one where I add a >> variable into the scope and another one where I add a delegate. >> However, in both cases, whenever I use these variables from within my >> scripts, they don't seem to work. Code: >> Func test = new Func(Test); >> scope.SetVariable("x", 10); >> scope.SetVariable("Test", test); >> >> Accessing them in my scripts have the effect of triggering an >> exception that shows that x is undefined. > > Can you show the actual code that attempts to use them and the actual > exception message raised. > > Michael > >> >> Some insights into this would be of great help. >> >> Patrick >> >> Michael Foord wrote: >>> See this section of my hosting article: >>> >>> http://www.voidspace.org.uk/ironpython/hosting_api.shtml#functions-as-delegates >>> >>> >>> You cast the function to a delegate as you fetch it out of the scope. >>> >>> Michael >>> >>> Patrick van der Willik wrote: >>>> I'm a bit late with responding to this as I was kinda busy. I used >>>> the code that was given Stephen and it seems to run properly >>>> without throwing exceptions. However, I created a little >>>> autoexec.py file with a simple function in it with 2 parameters. >>>> >>>> The main problem here is: How do I call the function through the >>>> scope? I used engine.CreateScope() to create myself a new scope, >>>> but from there on, I'm basically lost(again). What I basically want >>>> to do, is call my function 'add' with 2 parameters(say, 10 and 15). >>>> The modules itself are loaded into a ScriptSource. >>>> >>>> Thanks, >>>> Patrick >>>> >>>> Lepisto, Stephen P wrote: >>>>> >>>>> What I do when I want to work with python modules from embedded >>>>> IronPython is set the IronPython search path with the path of the >>>>> module to load then create and execute a small python script that >>>>> loads the main python modules into the current scope. >>>>> >>>>> >>>>> >>>>> string moduleName = Path.GetFileName(modulePath); >>>>> >>>>> string path = Path.GetDirectoryName(modulePath); >>>>> >>>>> >>>>> >>>>> ICollection paths = _pythonEngine.GetSearchPaths(); >>>>> >>>>> if (!paths.Contains(path)) >>>>> >>>>> { >>>>> >>>>> paths.Add(path); >>>>> >>>>> _pythonEngine.SetSearchPaths(paths); >>>>> >>>>> } >>>>> >>>>> string modInvoke = String.Format("import {0}\nfrom {0} import >>>>> *\n", moduleName); >>>>> >>>>> ScriptSource source = >>>>> _pythonEngine.CreateScriptSourceFromString(modInvoke, >>>>> >>>>> >>>>> Microsoft.Scripting.SourceCodeKind.Statements); >>>>> >>>>> >>>>> >>>>> Where modulePath is the full path to the python module or package >>>>> to load. >>>>> >>>>> >>>>> >>>>> I can then invoke methods or access attributes using the >>>>> IronPython scope. In this way, I can interact with the python >>>>> modules for as long as necessary before closing down the >>>>> scope/engine. >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> *From:* users-bounces at lists.ironpython.com >>>>> [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Dody >>>>> Gunawinata >>>>> *Sent:* Thursday, June 11, 2009 9:09 AM >>>>> *To:* Discussion of IronPython >>>>> *Subject:* Re: [IronPython] Embedding IronPython and calling >>>>> python functions from C# >>>>> >>>>> >>>>> >>>>> You can read all yours file scripts, then using StringBuilder to >>>>> combine then and call CreateScriptSourceFromString() >>>>> >>>>> Then you can call your functions within the combined scripts >>>>> normally. Pretty much you are creating a giant source code on the >>>>> fly. >>>>> >>>>> >>>>> >>>>> On Thu, Jun 11, 2009 at 5:32 PM, Patrick van der Willik >>>>> > wrote: >>>>> >>>>> I'm currently attempting to embed the IronPython 2 runtimes into >>>>> an existing application written in C#. However, I find the amount >>>>> of documentation lacking on what I'm trying to do. I currently >>>>> have a proof-of-concept version which uses Lua and LuaInterface, >>>>> but the people who have to write the scripts dislike Lua(Well, >>>>> more hate it with a passion) and would love to see this working >>>>> with Python. >>>>> >>>>> My host application is a networked application that must trigger >>>>> certain scripts functions on events generated by the connected >>>>> clients. The idea is that when my application starts, it will load >>>>> the IronPython script environment, launches an 'autoexec.py' which >>>>> will load various other scripts files and do some housekeeping. >>>>> Once this all is completed, it will start listening to incoming >>>>> connections. However, in various scenarios, the application has to >>>>> trigger scripted functions when data is received from a client. >>>>> Which script function is called is different per client and per >>>>> event. I have events for connecting, logging on, disconnecting and >>>>> a set of data specific events after receiving data. This highly >>>>> depends on the received packets. >>>>> >>>>> My question here is: How do I embed IronPython in such a fashion >>>>> that I can load my scripts and then trigger various functions >>>>> within that? I've seen many examples that just call >>>>> CreateScriptSourceFromString() or File each time in which just 1 >>>>> piece of code is implemented. This is not suitable for the needs >>>>> here because the scripted systems can become quite complex. >>>>> >>>>> With regards, >>>>> Patrick >>>>> >>>>> >>>>> _______________________________________________ >>>>> 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 >>>>> >>>> >>>> ------------------------------------------------------------------------ >>>> >>>> >>>> _______________________________________________ >>>> Users mailing list >>>> Users at lists.ironpython.com >>>> http://lists.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 microsoft.com Tue Jun 16 01:36:17 2009 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 15 Jun 2009 23:36:17 +0000 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <4A36D899.4020600@toolmaker.nl> References: <4A311578.2000604@toolmaker.nl> <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> <4A363B60.1040006@toolmaker.nl> <4A36413F.5060704@voidspace.org.uk> <4A36D4BF.9000608@toolmaker.nl> <4A36D5D3.9080302@voidspace.org.uk> <4A36D899.4020600@toolmaker.nl> Message-ID: <1A472770E042064698CB5ADC83A12ACD0324BFB3@TK5EX14MBXC116.redmond.corp.microsoft.com> What about the code which is actually running the code that "def OnConnect" lives in? I would expect you have either: engine.ExecuteFile(..., scope) or: code = engine.CreateScriptSource*(...) cc = code.Compile() cc.Execute(scope) or code = engine.CreateScriptSource*(...) code.Execute(scope) where scope in all of these would be the scope that you've populated with the value of "x". I suspect the 2nd one is the one you want so that you can run the same code against multiple scopes w/ different sets of bound variables based upon the current request. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Patrick van der Willik Sent: Monday, June 15, 2009 4:26 PM To: Discussion of IronPython Subject: Re: [IronPython] Embedding IronPython and calling python functions from C# The actual code that uses these variables from within a script looks like this: def OnConnect(user): s = "The value of x: " + str(x) user.Send(s, True) user.Receiver = "user_username" return True And the complete exception is: [ERROR] [16-6-2009 1:18:16] An error occured while attempting to accept a new connection. Error: name 'x' is not defined [ERROR] [16-6-2009 1:18:16] Stacktrace: at IronPython.Runtime.PythonContext.MissingName(SymbolId name) at Microsoft.Scripting.Runtime.ModuleGlobalWrapper.GetCachedValue() at Microsoft.Scripting.Runtime.ModuleGlobalWrapper.get_CurrentValue() at S$2.OnConnect$6(Object user) at _stub_$17##8(Closure , CallSite , Object , User ) at Microsoft.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4 target, CallSite site, Object[] args) 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 System.Boolean(User)(Object[] , User ) at TestProject.Users.ConnectionManager.AcceptNewConnnections() in C:\Users\Patrick\Documents\Visual Studio 2008\Projects\test\TestProject\Users\ConnectionManager.cs :line 108 Weird thing is: If I use GetVariable, it works fine. The call is done at a later location in the program that where I do the SetVariable, but the script scope hasn't ben changed in the meantime. Patrick Michael Foord wrote: > Patrick van der Willik wrote: >> Alright, that actually really worked pretty good, and I finally got >> it all working as it should. However, I'm running into 1 more little >> issue, now I need to go the other way around aswell. I have several >> functions marked in my application as PythonExportable. In a certain >> startup phase of the application, after creating the IronPython >> hosting environment, I walk over all these classes using Reflection, >> take the tagged functions and put these into my IP scope. >> >> However, my simple tests for some reason cause my SetVariable() calls >> to not work. I added 2 tests to my scripts, one where I add a >> variable into the scope and another one where I add a delegate. >> However, in both cases, whenever I use these variables from within my >> scripts, they don't seem to work. Code: >> Func test = new Func(Test); >> scope.SetVariable("x", 10); >> scope.SetVariable("Test", test); >> >> Accessing them in my scripts have the effect of triggering an >> exception that shows that x is undefined. > > Can you show the actual code that attempts to use them and the actual > exception message raised. > > Michael > >> >> Some insights into this would be of great help. >> >> Patrick >> >> Michael Foord wrote: >>> See this section of my hosting article: >>> >>> http://www.voidspace.org.uk/ironpython/hosting_api.shtml#functions-as-delegates >>> >>> >>> You cast the function to a delegate as you fetch it out of the scope. >>> >>> Michael >>> >>> Patrick van der Willik wrote: >>>> I'm a bit late with responding to this as I was kinda busy. I used >>>> the code that was given Stephen and it seems to run properly >>>> without throwing exceptions. However, I created a little >>>> autoexec.py file with a simple function in it with 2 parameters. >>>> >>>> The main problem here is: How do I call the function through the >>>> scope? I used engine.CreateScope() to create myself a new scope, >>>> but from there on, I'm basically lost(again). What I basically want >>>> to do, is call my function 'add' with 2 parameters(say, 10 and 15). >>>> The modules itself are loaded into a ScriptSource. >>>> >>>> Thanks, >>>> Patrick >>>> >>>> Lepisto, Stephen P wrote: >>>>> >>>>> What I do when I want to work with python modules from embedded >>>>> IronPython is set the IronPython search path with the path of the >>>>> module to load then create and execute a small python script that >>>>> loads the main python modules into the current scope. >>>>> >>>>> >>>>> >>>>> string moduleName = Path.GetFileName(modulePath); >>>>> >>>>> string path = Path.GetDirectoryName(modulePath); >>>>> >>>>> >>>>> >>>>> ICollection paths = _pythonEngine.GetSearchPaths(); >>>>> >>>>> if (!paths.Contains(path)) >>>>> >>>>> { >>>>> >>>>> paths.Add(path); >>>>> >>>>> _pythonEngine.SetSearchPaths(paths); >>>>> >>>>> } >>>>> >>>>> string modInvoke = String.Format("import {0}\nfrom {0} import >>>>> *\n", moduleName); >>>>> >>>>> ScriptSource source = >>>>> _pythonEngine.CreateScriptSourceFromString(modInvoke, >>>>> >>>>> >>>>> Microsoft.Scripting.SourceCodeKind.Statements); >>>>> >>>>> >>>>> >>>>> Where modulePath is the full path to the python module or package >>>>> to load. >>>>> >>>>> >>>>> >>>>> I can then invoke methods or access attributes using the >>>>> IronPython scope. In this way, I can interact with the python >>>>> modules for as long as necessary before closing down the >>>>> scope/engine. >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> *From:* users-bounces at lists.ironpython.com >>>>> [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Dody >>>>> Gunawinata >>>>> *Sent:* Thursday, June 11, 2009 9:09 AM >>>>> *To:* Discussion of IronPython >>>>> *Subject:* Re: [IronPython] Embedding IronPython and calling >>>>> python functions from C# >>>>> >>>>> >>>>> >>>>> You can read all yours file scripts, then using StringBuilder to >>>>> combine then and call CreateScriptSourceFromString() >>>>> >>>>> Then you can call your functions within the combined scripts >>>>> normally. Pretty much you are creating a giant source code on the >>>>> fly. >>>>> >>>>> >>>>> >>>>> On Thu, Jun 11, 2009 at 5:32 PM, Patrick van der Willik >>>>> > wrote: >>>>> >>>>> I'm currently attempting to embed the IronPython 2 runtimes into >>>>> an existing application written in C#. However, I find the amount >>>>> of documentation lacking on what I'm trying to do. I currently >>>>> have a proof-of-concept version which uses Lua and LuaInterface, >>>>> but the people who have to write the scripts dislike Lua(Well, >>>>> more hate it with a passion) and would love to see this working >>>>> with Python. >>>>> >>>>> My host application is a networked application that must trigger >>>>> certain scripts functions on events generated by the connected >>>>> clients. The idea is that when my application starts, it will load >>>>> the IronPython script environment, launches an 'autoexec.py' which >>>>> will load various other scripts files and do some housekeeping. >>>>> Once this all is completed, it will start listening to incoming >>>>> connections. However, in various scenarios, the application has to >>>>> trigger scripted functions when data is received from a client. >>>>> Which script function is called is different per client and per >>>>> event. I have events for connecting, logging on, disconnecting and >>>>> a set of data specific events after receiving data. This highly >>>>> depends on the received packets. >>>>> >>>>> My question here is: How do I embed IronPython in such a fashion >>>>> that I can load my scripts and then trigger various functions >>>>> within that? I've seen many examples that just call >>>>> CreateScriptSourceFromString() or File each time in which just 1 >>>>> piece of code is implemented. This is not suitable for the needs >>>>> here because the scripted systems can become quite complex. >>>>> >>>>> With regards, >>>>> Patrick >>>>> >>>>> >>>>> _______________________________________________ >>>>> 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 >>>>> >>>> >>>> ------------------------------------------------------------------------ >>>> >>>> >>>> _______________________________________________ >>>> Users mailing list >>>> Users at lists.ironpython.com >>>> http://lists.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 patrick at toolmaker.nl Tue Jun 16 01:48:40 2009 From: patrick at toolmaker.nl (Patrick van der Willik) Date: Tue, 16 Jun 2009 01:48:40 +0200 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <1A472770E042064698CB5ADC83A12ACD0324BFB3@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4A311578.2000604@toolmaker.nl> <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> <4A363B60.1040006@toolmaker.nl> <4A36413F.5060704@voidspace.org.uk> <4A36D4BF.9000608@toolmaker.nl> <4A36D5D3.9080302@voidspace.org.uk> <4A36D899.4020600@toolmaker.nl> <1A472770E042064698CB5ADC83A12ACD0324BFB3@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4A36DDD8.4010602@toolmaker.nl> I am in fact using the 2nd 'flavour': string modInvoke = String.Format("import {0}\nfrom {0} import *\n", "autoexec"); var source = engine.CreateScriptSourceFromString(modInvoke, SourceCodeKind.Statements); CompiledCode cc = source.Compile(); cc.Execute(scope); // And bind our public delegates OnConnect = scope.GetVariable>("OnConnect"); OnDisconnect = scope.GetVariable>("OnDisconnect"); OnDataRecv = scope.GetVariable>("OnDataReceived"); OnPreLogin = scope.GetVariable>("OnPreLogin"); OnLogin = scope.GetVariable>("OnLogin"); Func test = new Func(Test); scope.SetVariable("x", 10); scope.SetVariable("Test", test); And in a later piece of code, I just call the OnConnect(newUser) delegate(in my C# part). Perhaps interesting to know, the autoexec has an import clientconn and from clientconn import *. Is my assumption that should work correct or am I missing something? Patrick Dino Viehland wrote: > What about the code which is actually running the code that "def OnConnect" lives in? > > I would expect you have either: > engine.ExecuteFile(..., scope) > > or: > > > code = engine.CreateScriptSource*(...) > cc = code.Compile() > cc.Execute(scope) > > or > > code = engine.CreateScriptSource*(...) > code.Execute(scope) > > where scope in all of these would be the scope that you've populated with the value of "x". > > I suspect the 2nd one is the one you want so that you can run the same code against multiple > scopes w/ different sets of bound variables based upon the current request. > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Patrick van der Willik > Sent: Monday, June 15, 2009 4:26 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Embedding IronPython and calling python functions from C# > > The actual code that uses these variables from within a script looks > like this: > def OnConnect(user): > s = "The value of x: " + str(x) > user.Send(s, True) > user.Receiver = "user_username" > return True > > And the complete exception is: > [ERROR] [16-6-2009 1:18:16] An error occured while attempting to accept > a new connection. Error: name 'x' is not defined > [ERROR] [16-6-2009 1:18:16] Stacktrace: at > IronPython.Runtime.PythonContext.MissingName(SymbolId name) > at Microsoft.Scripting.Runtime.ModuleGlobalWrapper.GetCachedValue() > at Microsoft.Scripting.Runtime.ModuleGlobalWrapper.get_CurrentValue() > at S$2.OnConnect$6(Object user) > at _stub_$17##8(Closure , CallSite , Object , User ) > at Microsoft.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4 > target, CallSite site, Object[] args) > 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 System.Boolean(User)(Object[] , User ) > at TestProject.Users.ConnectionManager.AcceptNewConnnections() in > C:\Users\Patrick\Documents\Visual Studio > 2008\Projects\test\TestProject\Users\ConnectionManager.cs > :line 108 > > Weird thing is: If I use GetVariable, it works fine. The call is done at > a later location in the program that where I do the SetVariable, but the > script scope hasn't ben changed in the meantime. > > Patrick > > Michael Foord wrote: > >> Patrick van der Willik wrote: >> >>> Alright, that actually really worked pretty good, and I finally got >>> it all working as it should. However, I'm running into 1 more little >>> issue, now I need to go the other way around aswell. I have several >>> functions marked in my application as PythonExportable. In a certain >>> startup phase of the application, after creating the IronPython >>> hosting environment, I walk over all these classes using Reflection, >>> take the tagged functions and put these into my IP scope. >>> >>> However, my simple tests for some reason cause my SetVariable() calls >>> to not work. I added 2 tests to my scripts, one where I add a >>> variable into the scope and another one where I add a delegate. >>> However, in both cases, whenever I use these variables from within my >>> scripts, they don't seem to work. Code: >>> Func test = new Func(Test); >>> scope.SetVariable("x", 10); >>> scope.SetVariable("Test", test); >>> >>> Accessing them in my scripts have the effect of triggering an >>> exception that shows that x is undefined. >>> >> Can you show the actual code that attempts to use them and the actual >> exception message raised. >> >> Michael >> >> >>> Some insights into this would be of great help. >>> >>> Patrick >>> >>> Michael Foord wrote: >>> >>>> See this section of my hosting article: >>>> >>>> http://www.voidspace.org.uk/ironpython/hosting_api.shtml#functions-as-delegates >>>> >>>> >>>> You cast the function to a delegate as you fetch it out of the scope. >>>> >>>> Michael >>>> >>>> Patrick van der Willik wrote: >>>> >>>>> I'm a bit late with responding to this as I was kinda busy. I used >>>>> the code that was given Stephen and it seems to run properly >>>>> without throwing exceptions. However, I created a little >>>>> autoexec.py file with a simple function in it with 2 parameters. >>>>> >>>>> The main problem here is: How do I call the function through the >>>>> scope? I used engine.CreateScope() to create myself a new scope, >>>>> but from there on, I'm basically lost(again). What I basically want >>>>> to do, is call my function 'add' with 2 parameters(say, 10 and 15). >>>>> The modules itself are loaded into a ScriptSource. >>>>> >>>>> Thanks, >>>>> Patrick >>>>> >>>>> Lepisto, Stephen P wrote: >>>>> >>>>>> What I do when I want to work with python modules from embedded >>>>>> IronPython is set the IronPython search path with the path of the >>>>>> module to load then create and execute a small python script that >>>>>> loads the main python modules into the current scope. >>>>>> >>>>>> >>>>>> >>>>>> string moduleName = Path.GetFileName(modulePath); >>>>>> >>>>>> string path = Path.GetDirectoryName(modulePath); >>>>>> >>>>>> >>>>>> >>>>>> ICollection paths = _pythonEngine.GetSearchPaths(); >>>>>> >>>>>> if (!paths.Contains(path)) >>>>>> >>>>>> { >>>>>> >>>>>> paths.Add(path); >>>>>> >>>>>> _pythonEngine.SetSearchPaths(paths); >>>>>> >>>>>> } >>>>>> >>>>>> string modInvoke = String.Format("import {0}\nfrom {0} import >>>>>> *\n", moduleName); >>>>>> >>>>>> ScriptSource source = >>>>>> _pythonEngine.CreateScriptSourceFromString(modInvoke, >>>>>> >>>>>> >>>>>> Microsoft.Scripting.SourceCodeKind.Statements); >>>>>> >>>>>> >>>>>> >>>>>> Where modulePath is the full path to the python module or package >>>>>> to load. >>>>>> >>>>>> >>>>>> >>>>>> I can then invoke methods or access attributes using the >>>>>> IronPython scope. In this way, I can interact with the python >>>>>> modules for as long as necessary before closing down the >>>>>> scope/engine. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> *From:* users-bounces at lists.ironpython.com >>>>>> [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Dody >>>>>> Gunawinata >>>>>> *Sent:* Thursday, June 11, 2009 9:09 AM >>>>>> *To:* Discussion of IronPython >>>>>> *Subject:* Re: [IronPython] Embedding IronPython and calling >>>>>> python functions from C# >>>>>> >>>>>> >>>>>> >>>>>> You can read all yours file scripts, then using StringBuilder to >>>>>> combine then and call CreateScriptSourceFromString() >>>>>> >>>>>> Then you can call your functions within the combined scripts >>>>>> normally. Pretty much you are creating a giant source code on the >>>>>> fly. >>>>>> >>>>>> >>>>>> >>>>>> On Thu, Jun 11, 2009 at 5:32 PM, Patrick van der Willik >>>>>> > wrote: >>>>>> >>>>>> I'm currently attempting to embed the IronPython 2 runtimes into >>>>>> an existing application written in C#. However, I find the amount >>>>>> of documentation lacking on what I'm trying to do. I currently >>>>>> have a proof-of-concept version which uses Lua and LuaInterface, >>>>>> but the people who have to write the scripts dislike Lua(Well, >>>>>> more hate it with a passion) and would love to see this working >>>>>> with Python. >>>>>> >>>>>> My host application is a networked application that must trigger >>>>>> certain scripts functions on events generated by the connected >>>>>> clients. The idea is that when my application starts, it will load >>>>>> the IronPython script environment, launches an 'autoexec.py' which >>>>>> will load various other scripts files and do some housekeeping. >>>>>> Once this all is completed, it will start listening to incoming >>>>>> connections. However, in various scenarios, the application has to >>>>>> trigger scripted functions when data is received from a client. >>>>>> Which script function is called is different per client and per >>>>>> event. I have events for connecting, logging on, disconnecting and >>>>>> a set of data specific events after receiving data. This highly >>>>>> depends on the received packets. >>>>>> >>>>>> My question here is: How do I embed IronPython in such a fashion >>>>>> that I can load my scripts and then trigger various functions >>>>>> within that? I've seen many examples that just call >>>>>> CreateScriptSourceFromString() or File each time in which just 1 >>>>>> piece of code is implemented. This is not suitable for the needs >>>>>> here because the scripted systems can become quite complex. >>>>>> >>>>>> With regards, >>>>>> Patrick >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >>>>>> >>>>>> >>>>> ------------------------------------------------------------------------ >>>>> >>>>> >>>>> _______________________________________________ >>>>> Users mailing list >>>>> Users at lists.ironpython.com >>>>> http://lists.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 fuzzyman at voidspace.org.uk Tue Jun 16 02:17:03 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 16 Jun 2009 01:17:03 +0100 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <4A36DDD8.4010602@toolmaker.nl> References: <4A311578.2000604@toolmaker.nl> <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> <4A363B60.1040006@toolmaker.nl> <4A36413F.5060704@voidspace.org.uk> <4A36D4BF.9000608@toolmaker.nl> <4A36D5D3.9080302@voidspace.org.uk> <4A36D899.4020600@toolmaker.nl> <1A472770E042064698CB5ADC83A12ACD0324BFB3@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A36DDD8.4010602@toolmaker.nl> Message-ID: <4A36E47F.3030509@voidspace.org.uk> Patrick van der Willik wrote: > I am in fact using the 2nd 'flavour': > string modInvoke = String.Format("import {0}\nfrom {0} > import *\n", "autoexec"); So OnConnect is defined in your autoexec.py module? In this case it is looking for x in the scope in which it is defined *not* in the scope from which it is called (lexical scoping). You should make x another parameter - and perhaps in modInvoke create a wrapper function that looks up x in its scope and passes it to OnConnect. Michael > > var source = > engine.CreateScriptSourceFromString(modInvoke, SourceCodeKind.Statements); > CompiledCode cc = source.Compile(); > cc.Execute(scope); > > // And bind our public delegates > OnConnect = scope.GetVariable bool>>("OnConnect"); > OnDisconnect = scope.GetVariable bool>>("OnDisconnect"); > OnDataRecv = scope.GetVariable bool>>("OnDataReceived"); > OnPreLogin = scope.GetVariable bool>>("OnPreLogin"); > OnLogin = scope.GetVariable>("OnLogin"); > > Func test = new Func(Test); > scope.SetVariable("x", 10); > scope.SetVariable("Test", test); > > And in a later piece of code, I just call the OnConnect(newUser) > delegate(in my C# part). Perhaps interesting to know, the autoexec has > an import clientconn and from clientconn import *. > > Is my assumption that should work correct or am I missing something? > > Patrick > > Dino Viehland wrote: >> What about the code which is actually running the code that "def OnConnect" lives in? >> >> I would expect you have either: >> engine.ExecuteFile(..., scope) >> >> or: >> >> >> code = engine.CreateScriptSource*(...) >> cc = code.Compile() >> cc.Execute(scope) >> >> or >> >> code = engine.CreateScriptSource*(...) >> code.Execute(scope) >> >> where scope in all of these would be the scope that you've populated with the value of "x". >> >> I suspect the 2nd one is the one you want so that you can run the same code against multiple >> scopes w/ different sets of bound variables based upon the current request. >> >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Patrick van der Willik >> Sent: Monday, June 15, 2009 4:26 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] Embedding IronPython and calling python functions from C# >> >> The actual code that uses these variables from within a script looks >> like this: >> def OnConnect(user): >> s = "The value of x: " + str(x) >> user.Send(s, True) >> user.Receiver = "user_username" >> return True >> >> And the complete exception is: >> [ERROR] [16-6-2009 1:18:16] An error occured while attempting to accept >> a new connection. Error: name 'x' is not defined >> [ERROR] [16-6-2009 1:18:16] Stacktrace: at >> IronPython.Runtime.PythonContext.MissingName(SymbolId name) >> at Microsoft.Scripting.Runtime.ModuleGlobalWrapper.GetCachedValue() >> at Microsoft.Scripting.Runtime.ModuleGlobalWrapper.get_CurrentValue() >> at S$2.OnConnect$6(Object user) >> at _stub_$17##8(Closure , CallSite , Object , User ) >> at Microsoft.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4 >> target, CallSite site, Object[] args) >> 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 System.Boolean(User)(Object[] , User ) >> at TestProject.Users.ConnectionManager.AcceptNewConnnections() in >> C:\Users\Patrick\Documents\Visual Studio >> 2008\Projects\test\TestProject\Users\ConnectionManager.cs >> :line 108 >> >> Weird thing is: If I use GetVariable, it works fine. The call is done at >> a later location in the program that where I do the SetVariable, but the >> script scope hasn't ben changed in the meantime. >> >> Patrick >> >> Michael Foord wrote: >> >>> Patrick van der Willik wrote: >>> >>>> Alright, that actually really worked pretty good, and I finally got >>>> it all working as it should. However, I'm running into 1 more little >>>> issue, now I need to go the other way around aswell. I have several >>>> functions marked in my application as PythonExportable. In a certain >>>> startup phase of the application, after creating the IronPython >>>> hosting environment, I walk over all these classes using Reflection, >>>> take the tagged functions and put these into my IP scope. >>>> >>>> However, my simple tests for some reason cause my SetVariable() calls >>>> to not work. I added 2 tests to my scripts, one where I add a >>>> variable into the scope and another one where I add a delegate. >>>> However, in both cases, whenever I use these variables from within my >>>> scripts, they don't seem to work. Code: >>>> Func test = new Func(Test); >>>> scope.SetVariable("x", 10); >>>> scope.SetVariable("Test", test); >>>> >>>> Accessing them in my scripts have the effect of triggering an >>>> exception that shows that x is undefined. >>>> >>> Can you show the actual code that attempts to use them and the actual >>> exception message raised. >>> >>> Michael >>> >>> >>>> Some insights into this would be of great help. >>>> >>>> Patrick >>>> >>>> Michael Foord wrote: >>>> >>>>> See this section of my hosting article: >>>>> >>>>> http://www.voidspace.org.uk/ironpython/hosting_api.shtml#functions-as-delegates >>>>> >>>>> >>>>> You cast the function to a delegate as you fetch it out of the scope. >>>>> >>>>> Michael >>>>> >>>>> Patrick van der Willik wrote: >>>>> >>>>>> I'm a bit late with responding to this as I was kinda busy. I used >>>>>> the code that was given Stephen and it seems to run properly >>>>>> without throwing exceptions. However, I created a little >>>>>> autoexec.py file with a simple function in it with 2 parameters. >>>>>> >>>>>> The main problem here is: How do I call the function through the >>>>>> scope? I used engine.CreateScope() to create myself a new scope, >>>>>> but from there on, I'm basically lost(again). What I basically want >>>>>> to do, is call my function 'add' with 2 parameters(say, 10 and 15). >>>>>> The modules itself are loaded into a ScriptSource. >>>>>> >>>>>> Thanks, >>>>>> Patrick >>>>>> >>>>>> Lepisto, Stephen P wrote: >>>>>> >>>>>>> What I do when I want to work with python modules from embedded >>>>>>> IronPython is set the IronPython search path with the path of the >>>>>>> module to load then create and execute a small python script that >>>>>>> loads the main python modules into the current scope. >>>>>>> >>>>>>> >>>>>>> >>>>>>> string moduleName = Path.GetFileName(modulePath); >>>>>>> >>>>>>> string path = Path.GetDirectoryName(modulePath); >>>>>>> >>>>>>> >>>>>>> >>>>>>> ICollection paths = _pythonEngine.GetSearchPaths(); >>>>>>> >>>>>>> if (!paths.Contains(path)) >>>>>>> >>>>>>> { >>>>>>> >>>>>>> paths.Add(path); >>>>>>> >>>>>>> _pythonEngine.SetSearchPaths(paths); >>>>>>> >>>>>>> } >>>>>>> >>>>>>> string modInvoke = String.Format("import {0}\nfrom {0} import >>>>>>> *\n", moduleName); >>>>>>> >>>>>>> ScriptSource source = >>>>>>> _pythonEngine.CreateScriptSourceFromString(modInvoke, >>>>>>> >>>>>>> >>>>>>> Microsoft.Scripting.SourceCodeKind.Statements); >>>>>>> >>>>>>> >>>>>>> >>>>>>> Where modulePath is the full path to the python module or package >>>>>>> to load. >>>>>>> >>>>>>> >>>>>>> >>>>>>> I can then invoke methods or access attributes using the >>>>>>> IronPython scope. In this way, I can interact with the python >>>>>>> modules for as long as necessary before closing down the >>>>>>> scope/engine. >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> *From:* users-bounces at lists.ironpython.com >>>>>>> [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Dody >>>>>>> Gunawinata >>>>>>> *Sent:* Thursday, June 11, 2009 9:09 AM >>>>>>> *To:* Discussion of IronPython >>>>>>> *Subject:* Re: [IronPython] Embedding IronPython and calling >>>>>>> python functions from C# >>>>>>> >>>>>>> >>>>>>> >>>>>>> You can read all yours file scripts, then using StringBuilder to >>>>>>> combine then and call CreateScriptSourceFromString() >>>>>>> >>>>>>> Then you can call your functions within the combined scripts >>>>>>> normally. Pretty much you are creating a giant source code on the >>>>>>> fly. >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Thu, Jun 11, 2009 at 5:32 PM, Patrick van der Willik >>>>>>> > wrote: >>>>>>> >>>>>>> I'm currently attempting to embed the IronPython 2 runtimes into >>>>>>> an existing application written in C#. However, I find the amount >>>>>>> of documentation lacking on what I'm trying to do. I currently >>>>>>> have a proof-of-concept version which uses Lua and LuaInterface, >>>>>>> but the people who have to write the scripts dislike Lua(Well, >>>>>>> more hate it with a passion) and would love to see this working >>>>>>> with Python. >>>>>>> >>>>>>> My host application is a networked application that must trigger >>>>>>> certain scripts functions on events generated by the connected >>>>>>> clients. The idea is that when my application starts, it will load >>>>>>> the IronPython script environment, launches an 'autoexec.py' which >>>>>>> will load various other scripts files and do some housekeeping. >>>>>>> Once this all is completed, it will start listening to incoming >>>>>>> connections. However, in various scenarios, the application has to >>>>>>> trigger scripted functions when data is received from a client. >>>>>>> Which script function is called is different per client and per >>>>>>> event. I have events for connecting, logging on, disconnecting and >>>>>>> a set of data specific events after receiving data. This highly >>>>>>> depends on the received packets. >>>>>>> >>>>>>> My question here is: How do I embed IronPython in such a fashion >>>>>>> that I can load my scripts and then trigger various functions >>>>>>> within that? I've seen many examples that just call >>>>>>> CreateScriptSourceFromString() or File each time in which just 1 >>>>>>> piece of code is implemented. This is not suitable for the needs >>>>>>> here because the scripted systems can become quite complex. >>>>>>> >>>>>>> With regards, >>>>>>> Patrick >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> 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 >>>>>>> >>>>>>> >>>>>> ------------------------------------------------------------------------ >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Users mailing list >>>>>> Users at lists.ironpython.com >>>>>> http://lists.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/blog From patrick at toolmaker.nl Tue Jun 16 02:37:41 2009 From: patrick at toolmaker.nl (Patrick van der Willik) Date: Tue, 16 Jun 2009 02:37:41 +0200 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <4A36E47F.3030509@voidspace.org.uk> References: <4A311578.2000604@toolmaker.nl> <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> <4A363B60.1040006@toolmaker.nl> <4A36413F.5060704@voidspace.org.uk> <4A36D4BF.9000608@toolmaker.nl> <4A36D5D3.9080302@voidspace.org.uk> <4A36D899.4020600@toolmaker.nl> <1A472770E042064698CB5ADC83A12ACD0324BFB3@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A36DDD8.4010602@toolmaker.nl> <4A36E47F.3030509@voidspace.org.uk> Message-ID: <4A36E955.1080904@toolmaker.nl> The OnConnect is in the autoexec.py yes. While this works perfectly for setting variables, how does this work when I want to set my callback functions? I have several helper functions which reside on the C# side of my application in objects which I cannot spawn from within my scripts(As they're of vital importance to actually start my application). I actually thought the scope I created was shared. Is there a way to get this working, so I can update the global table Is there a way so I can update the global scope? Michael Foord wrote: > Patrick van der Willik wrote: >> I am in fact using the 2nd 'flavour': >> string modInvoke = String.Format("import {0}\nfrom >> {0} import *\n", "autoexec"); > > So OnConnect is defined in your autoexec.py module? > > In this case it is looking for x in the scope in which it is defined > *not* in the scope from which it is called (lexical scoping). > > You should make x another parameter - and perhaps in modInvoke create > a wrapper function that looks up x in its scope and passes it to > OnConnect. > > Michael > >> var source = >> engine.CreateScriptSourceFromString(modInvoke, >> SourceCodeKind.Statements); >> CompiledCode cc = source.Compile(); >> cc.Execute(scope); >> >> // And bind our public delegates >> OnConnect = scope.GetVariable> bool>>("OnConnect"); >> OnDisconnect = scope.GetVariable> bool>>("OnDisconnect"); >> OnDataRecv = scope.GetVariable> bool>>("OnDataReceived"); >> OnPreLogin = scope.GetVariable> bool>>("OnPreLogin"); >> OnLogin = scope.GetVariable> bool>>("OnLogin"); >> >> Func test = new Func(Test); >> scope.SetVariable("x", 10); >> scope.SetVariable("Test", test); >> >> And in a later piece of code, I just call the OnConnect(newUser) >> delegate(in my C# part). Perhaps interesting to know, the autoexec >> has an import clientconn and from clientconn import *. >> >> Is my assumption that should work correct or am I missing something? >> >> Patrick >> >> Dino Viehland wrote: >>> What about the code which is actually running the code that "def >>> OnConnect" lives in? >>> >>> I would expect you have either: >>> engine.ExecuteFile(..., scope) >>> >>> or: >>> >>> >>> code = engine.CreateScriptSource*(...) >>> cc = code.Compile() >>> cc.Execute(scope) >>> >>> or >>> >>> code = engine.CreateScriptSource*(...) >>> code.Execute(scope) >>> >>> where scope in all of these would be the scope that you've populated >>> with the value of "x". >>> >>> I suspect the 2nd one is the one you want so that you can run the >>> same code against multiple >>> scopes w/ different sets of bound variables based upon the current >>> request. >>> >>> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com >>> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Patrick van >>> der Willik >>> Sent: Monday, June 15, 2009 4:26 PM >>> To: Discussion of IronPython >>> Subject: Re: [IronPython] Embedding IronPython and calling python >>> functions from C# >>> >>> The actual code that uses these variables from within a script looks >>> like this: >>> def OnConnect(user): >>> s = "The value of x: " + str(x) >>> user.Send(s, True) >>> user.Receiver = "user_username" >>> return True >>> >>> And the complete exception is: >>> [ERROR] [16-6-2009 1:18:16] An error occured while attempting to accept >>> a new connection. Error: name 'x' is not defined >>> [ERROR] [16-6-2009 1:18:16] Stacktrace: at >>> IronPython.Runtime.PythonContext.MissingName(SymbolId name) >>> at Microsoft.Scripting.Runtime.ModuleGlobalWrapper.GetCachedValue() >>> at >>> Microsoft.Scripting.Runtime.ModuleGlobalWrapper.get_CurrentValue() >>> at S$2.OnConnect$6(Object user) >>> at _stub_$17##8(Closure , CallSite , Object , User ) >>> at Microsoft.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4 >>> target, CallSite site, Object[] args) >>> 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 System.Boolean(User)(Object[] , User ) >>> at TestProject.Users.ConnectionManager.AcceptNewConnnections() in >>> C:\Users\Patrick\Documents\Visual Studio >>> 2008\Projects\test\TestProject\Users\ConnectionManager.cs >>> :line 108 >>> >>> Weird thing is: If I use GetVariable, it works fine. The call is >>> done at >>> a later location in the program that where I do the SetVariable, but >>> the >>> script scope hasn't ben changed in the meantime. >>> >>> Patrick >>> >>> Michael Foord wrote: >>> >>>> Patrick van der Willik wrote: >>>> >>>>> Alright, that actually really worked pretty good, and I finally got >>>>> it all working as it should. However, I'm running into 1 more little >>>>> issue, now I need to go the other way around aswell. I have several >>>>> functions marked in my application as PythonExportable. In a certain >>>>> startup phase of the application, after creating the IronPython >>>>> hosting environment, I walk over all these classes using Reflection, >>>>> take the tagged functions and put these into my IP scope. >>>>> >>>>> However, my simple tests for some reason cause my SetVariable() calls >>>>> to not work. I added 2 tests to my scripts, one where I add a >>>>> variable into the scope and another one where I add a delegate. >>>>> However, in both cases, whenever I use these variables from within my >>>>> scripts, they don't seem to work. Code: >>>>> Func test = new Func(Test); >>>>> scope.SetVariable("x", 10); >>>>> scope.SetVariable("Test", test); >>>>> >>>>> Accessing them in my scripts have the effect of triggering an >>>>> exception that shows that x is undefined. >>>>> >>>> Can you show the actual code that attempts to use them and the actual >>>> exception message raised. >>>> >>>> Michael >>>> >>>> >>>>> Some insights into this would be of great help. >>>>> >>>>> Patrick >>>>> >>>>> Michael Foord wrote: >>>>> >>>>>> See this section of my hosting article: >>>>>> >>>>>> http://www.voidspace.org.uk/ironpython/hosting_api.shtml#functions-as-delegates >>>>>> >>>>>> >>>>>> >>>>>> You cast the function to a delegate as you fetch it out of the >>>>>> scope. >>>>>> >>>>>> Michael >>>>>> >>>>>> Patrick van der Willik wrote: >>>>>> >>>>>>> I'm a bit late with responding to this as I was kinda busy. I used >>>>>>> the code that was given Stephen and it seems to run properly >>>>>>> without throwing exceptions. However, I created a little >>>>>>> autoexec.py file with a simple function in it with 2 parameters. >>>>>>> >>>>>>> The main problem here is: How do I call the function through the >>>>>>> scope? I used engine.CreateScope() to create myself a new scope, >>>>>>> but from there on, I'm basically lost(again). What I basically want >>>>>>> to do, is call my function 'add' with 2 parameters(say, 10 and 15). >>>>>>> The modules itself are loaded into a ScriptSource. >>>>>>> >>>>>>> Thanks, >>>>>>> Patrick >>>>>>> >>>>>>> Lepisto, Stephen P wrote: >>>>>>> >>>>>>>> What I do when I want to work with python modules from embedded >>>>>>>> IronPython is set the IronPython search path with the path of the >>>>>>>> module to load then create and execute a small python script that >>>>>>>> loads the main python modules into the current scope. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> string moduleName = Path.GetFileName(modulePath); >>>>>>>> >>>>>>>> string path = Path.GetDirectoryName(modulePath); >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> ICollection paths = _pythonEngine.GetSearchPaths(); >>>>>>>> >>>>>>>> if (!paths.Contains(path)) >>>>>>>> >>>>>>>> { >>>>>>>> >>>>>>>> paths.Add(path); >>>>>>>> >>>>>>>> _pythonEngine.SetSearchPaths(paths); >>>>>>>> >>>>>>>> } >>>>>>>> >>>>>>>> string modInvoke = String.Format("import {0}\nfrom {0} import >>>>>>>> *\n", moduleName); >>>>>>>> >>>>>>>> ScriptSource source = >>>>>>>> _pythonEngine.CreateScriptSourceFromString(modInvoke, >>>>>>>> >>>>>>>> >>>>>>>> Microsoft.Scripting.SourceCodeKind.Statements); >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Where modulePath is the full path to the python module or package >>>>>>>> to load. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> I can then invoke methods or access attributes using the >>>>>>>> IronPython scope. In this way, I can interact with the python >>>>>>>> modules for as long as necessary before closing down the >>>>>>>> scope/engine. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> *From:* users-bounces at lists.ironpython.com >>>>>>>> [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Dody >>>>>>>> Gunawinata >>>>>>>> *Sent:* Thursday, June 11, 2009 9:09 AM >>>>>>>> *To:* Discussion of IronPython >>>>>>>> *Subject:* Re: [IronPython] Embedding IronPython and calling >>>>>>>> python functions from C# >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> You can read all yours file scripts, then using StringBuilder to >>>>>>>> combine then and call CreateScriptSourceFromString() >>>>>>>> >>>>>>>> Then you can call your functions within the combined scripts >>>>>>>> normally. Pretty much you are creating a giant source code on the >>>>>>>> fly. >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Thu, Jun 11, 2009 at 5:32 PM, Patrick van der Willik >>>>>>>> > wrote: >>>>>>>> >>>>>>>> I'm currently attempting to embed the IronPython 2 runtimes into >>>>>>>> an existing application written in C#. However, I find the amount >>>>>>>> of documentation lacking on what I'm trying to do. I currently >>>>>>>> have a proof-of-concept version which uses Lua and LuaInterface, >>>>>>>> but the people who have to write the scripts dislike Lua(Well, >>>>>>>> more hate it with a passion) and would love to see this working >>>>>>>> with Python. >>>>>>>> >>>>>>>> My host application is a networked application that must trigger >>>>>>>> certain scripts functions on events generated by the connected >>>>>>>> clients. The idea is that when my application starts, it will load >>>>>>>> the IronPython script environment, launches an 'autoexec.py' which >>>>>>>> will load various other scripts files and do some housekeeping. >>>>>>>> Once this all is completed, it will start listening to incoming >>>>>>>> connections. However, in various scenarios, the application has to >>>>>>>> trigger scripted functions when data is received from a client. >>>>>>>> Which script function is called is different per client and per >>>>>>>> event. I have events for connecting, logging on, disconnecting and >>>>>>>> a set of data specific events after receiving data. This highly >>>>>>>> depends on the received packets. >>>>>>>> >>>>>>>> My question here is: How do I embed IronPython in such a fashion >>>>>>>> that I can load my scripts and then trigger various functions >>>>>>>> within that? I've seen many examples that just call >>>>>>>> CreateScriptSourceFromString() or File each time in which just 1 >>>>>>>> piece of code is implemented. This is not suitable for the needs >>>>>>>> here because the scripted systems can become quite complex. >>>>>>>> >>>>>>>> With regards, >>>>>>>> Patrick >>>>>>>> >>>>>>>> >>>>>>>> _______________________________________________ >>>>>>>> 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 >>>>>>>> >>>>>>>> >>>>>>> ------------------------------------------------------------------------ >>>>>>> >>>>>>> >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Users mailing list >>>>>>> Users at lists.ironpython.com >>>>>>> http://lists.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 dinov at microsoft.com Tue Jun 16 02:52:23 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 16 Jun 2009 00:52:23 +0000 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <4A36E955.1080904@toolmaker.nl> References: <4A311578.2000604@toolmaker.nl> <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> <4A363B60.1040006@toolmaker.nl> <4A36413F.5060704@voidspace.org.uk> <4A36D4BF.9000608@toolmaker.nl> <4A36D5D3.9080302@voidspace.org.uk> <4A36D899.4020600@toolmaker.nl> <1A472770E042064698CB5ADC83A12ACD0324BFB3@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A36DDD8.4010602@toolmaker.nl> <4A36E47F.3030509@voidspace.org.uk> <4A36E955.1080904@toolmaker.nl> Message-ID: <1A472770E042064698CB5ADC83A12ACD0324C643@TK5EX14MBXC116.redmond.corp.microsoft.com> You can set the variables in ScriptRuntime.Globals but then the user will need to import them from Globals to have access to them. There's no way to automatically expose globals to every script though. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Patrick van der Willik > Sent: Monday, June 15, 2009 5:38 PM > To: Discussion of IronPython > Subject: Re: [IronPython] Embedding IronPython and calling python > functions from C# > > The OnConnect is in the autoexec.py yes. While this works perfectly for > setting variables, how does this work when I want to set my callback > functions? I have several helper functions which reside on the C# side > of my application in objects which I cannot spawn from within my > scripts(As they're of vital importance to actually start my > application). > > I actually thought the scope I created was shared. Is there a way to > get > this working, so I can update the global table > > Is there a way so I can update the global scope? > > Michael Foord wrote: > > Patrick van der Willik wrote: > >> I am in fact using the 2nd 'flavour': > >> string modInvoke = String.Format("import {0}\nfrom > >> {0} import *\n", "autoexec"); > > > > So OnConnect is defined in your autoexec.py module? > > > > In this case it is looking for x in the scope in which it is defined > > *not* in the scope from which it is called (lexical scoping). > > > > You should make x another parameter - and perhaps in modInvoke create > > a wrapper function that looks up x in its scope and passes it to > > OnConnect. > > > > Michael > > > >> var source = > >> engine.CreateScriptSourceFromString(modInvoke, > >> SourceCodeKind.Statements); > >> CompiledCode cc = source.Compile(); > >> cc.Execute(scope); > >> > >> // And bind our public delegates > >> OnConnect = scope.GetVariable >> bool>>("OnConnect"); > >> OnDisconnect = scope.GetVariable >> bool>>("OnDisconnect"); > >> OnDataRecv = scope.GetVariable >> bool>>("OnDataReceived"); > >> OnPreLogin = scope.GetVariable >> bool>>("OnPreLogin"); > >> OnLogin = scope.GetVariable >> bool>>("OnLogin"); > >> > >> Func test = new Func(Test); > >> scope.SetVariable("x", 10); > >> scope.SetVariable("Test", test); > >> > >> And in a later piece of code, I just call the OnConnect(newUser) > >> delegate(in my C# part). Perhaps interesting to know, the autoexec > >> has an import clientconn and from clientconn import *. > >> > >> Is my assumption that should work correct or am I missing something? > >> > >> Patrick > >> > >> Dino Viehland wrote: > >>> What about the code which is actually running the code that "def > >>> OnConnect" lives in? > >>> > >>> I would expect you have either: > >>> engine.ExecuteFile(..., scope) > >>> > >>> or: > >>> > >>> > >>> code = engine.CreateScriptSource*(...) > >>> cc = code.Compile() > >>> cc.Execute(scope) > >>> > >>> or > >>> > >>> code = engine.CreateScriptSource*(...) > >>> code.Execute(scope) > >>> > >>> where scope in all of these would be the scope that you've > populated > >>> with the value of "x". > >>> > >>> I suspect the 2nd one is the one you want so that you can run the > >>> same code against multiple > >>> scopes w/ different sets of bound variables based upon the current > >>> request. > >>> > >>> > >>> -----Original Message----- > >>> From: users-bounces at lists.ironpython.com > >>> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Patrick > van > >>> der Willik > >>> Sent: Monday, June 15, 2009 4:26 PM > >>> To: Discussion of IronPython > >>> Subject: Re: [IronPython] Embedding IronPython and calling python > >>> functions from C# > >>> > >>> The actual code that uses these variables from within a script > looks > >>> like this: > >>> def OnConnect(user): > >>> s = "The value of x: " + str(x) > >>> user.Send(s, True) > >>> user.Receiver = "user_username" > >>> return True > >>> > >>> And the complete exception is: > >>> [ERROR] [16-6-2009 1:18:16] An error occured while attempting to > accept > >>> a new connection. Error: name 'x' is not defined > >>> [ERROR] [16-6-2009 1:18:16] Stacktrace: at > >>> IronPython.Runtime.PythonContext.MissingName(SymbolId name) > >>> at > Microsoft.Scripting.Runtime.ModuleGlobalWrapper.GetCachedValue() > >>> at > >>> Microsoft.Scripting.Runtime.ModuleGlobalWrapper.get_CurrentValue() > >>> at S$2.OnConnect$6(Object user) > >>> at _stub_$17##8(Closure , CallSite , Object , User ) > >>> at > Microsoft.Scripting.Actions.MatchCaller.Call2[T0,T1,TRet](Func`4 > >>> target, CallSite site, Object[] args) > >>> at > >>> Microsoft.Scripting.Actions.CallSite`1.UpdateAndExecute(Object[] > args) > >>> at > >>> > Microsoft.Scripting.Actions.UpdateDelegates.Update2[T,T0,T1,TRet](CallS > ite > >>> > >>> site, T0 arg0, T1 arg1) > >>> at System.Boolean(User)(Object[] , User ) > >>> at TestProject.Users.ConnectionManager.AcceptNewConnnections() > in > >>> C:\Users\Patrick\Documents\Visual Studio > >>> 2008\Projects\test\TestProject\Users\ConnectionManager.cs > >>> :line 108 > >>> > >>> Weird thing is: If I use GetVariable, it works fine. The call is > >>> done at > >>> a later location in the program that where I do the SetVariable, > but > >>> the > >>> script scope hasn't ben changed in the meantime. > >>> > >>> Patrick > >>> > >>> Michael Foord wrote: > >>> > >>>> Patrick van der Willik wrote: > >>>> > >>>>> Alright, that actually really worked pretty good, and I finally > got > >>>>> it all working as it should. However, I'm running into 1 more > little > >>>>> issue, now I need to go the other way around aswell. I have > several > >>>>> functions marked in my application as PythonExportable. In a > certain > >>>>> startup phase of the application, after creating the IronPython > >>>>> hosting environment, I walk over all these classes using > Reflection, > >>>>> take the tagged functions and put these into my IP scope. > >>>>> > >>>>> However, my simple tests for some reason cause my SetVariable() > calls > >>>>> to not work. I added 2 tests to my scripts, one where I add a > >>>>> variable into the scope and another one where I add a delegate. > >>>>> However, in both cases, whenever I use these variables from > within my > >>>>> scripts, they don't seem to work. Code: > >>>>> Func test = new Func(Test); > >>>>> scope.SetVariable("x", 10); > >>>>> scope.SetVariable("Test", test); > >>>>> > >>>>> Accessing them in my scripts have the effect of triggering an > >>>>> exception that shows that x is undefined. > >>>>> > >>>> Can you show the actual code that attempts to use them and the > actual > >>>> exception message raised. > >>>> > >>>> Michael > >>>> > >>>> > >>>>> Some insights into this would be of great help. > >>>>> > >>>>> Patrick > >>>>> > >>>>> Michael Foord wrote: > >>>>> > >>>>>> See this section of my hosting article: > >>>>>> > >>>>>> > http://www.voidspace.org.uk/ironpython/hosting_api.shtml#functions-as- > delegates > >>>>>> > >>>>>> > >>>>>> > >>>>>> You cast the function to a delegate as you fetch it out of the > >>>>>> scope. > >>>>>> > >>>>>> Michael > >>>>>> > >>>>>> Patrick van der Willik wrote: > >>>>>> > >>>>>>> I'm a bit late with responding to this as I was kinda busy. I > used > >>>>>>> the code that was given Stephen and it seems to run properly > >>>>>>> without throwing exceptions. However, I created a little > >>>>>>> autoexec.py file with a simple function in it with 2 parameters. > >>>>>>> > >>>>>>> The main problem here is: How do I call the function through > the > >>>>>>> scope? I used engine.CreateScope() to create myself a new scope, > >>>>>>> but from there on, I'm basically lost(again). What I basically > want > >>>>>>> to do, is call my function 'add' with 2 parameters(say, 10 and > 15). > >>>>>>> The modules itself are loaded into a ScriptSource. > >>>>>>> > >>>>>>> Thanks, > >>>>>>> Patrick > >>>>>>> > >>>>>>> Lepisto, Stephen P wrote: > >>>>>>> > >>>>>>>> What I do when I want to work with python modules from > embedded > >>>>>>>> IronPython is set the IronPython search path with the path of > the > >>>>>>>> module to load then create and execute a small python script > that > >>>>>>>> loads the main python modules into the current scope. > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> string moduleName = Path.GetFileName(modulePath); > >>>>>>>> > >>>>>>>> string path = Path.GetDirectoryName(modulePath); > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> ICollection paths = _pythonEngine.GetSearchPaths(); > >>>>>>>> > >>>>>>>> if (!paths.Contains(path)) > >>>>>>>> > >>>>>>>> { > >>>>>>>> > >>>>>>>> paths.Add(path); > >>>>>>>> > >>>>>>>> _pythonEngine.SetSearchPaths(paths); > >>>>>>>> > >>>>>>>> } > >>>>>>>> > >>>>>>>> string modInvoke = String.Format("import {0}\nfrom {0} import > >>>>>>>> *\n", moduleName); > >>>>>>>> > >>>>>>>> ScriptSource source = > >>>>>>>> _pythonEngine.CreateScriptSourceFromString(modInvoke, > >>>>>>>> > >>>>>>>> > >>>>>>>> Microsoft.Scripting.SourceCodeKind.Statements); > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> Where modulePath is the full path to the python module or > package > >>>>>>>> to load. > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> I can then invoke methods or access attributes using the > >>>>>>>> IronPython scope. In this way, I can interact with the python > >>>>>>>> modules for as long as necessary before closing down the > >>>>>>>> scope/engine. > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> *From:* users-bounces at lists.ironpython.com > >>>>>>>> [mailto:users-bounces at lists.ironpython.com] *On Behalf Of > *Dody > >>>>>>>> Gunawinata > >>>>>>>> *Sent:* Thursday, June 11, 2009 9:09 AM > >>>>>>>> *To:* Discussion of IronPython > >>>>>>>> *Subject:* Re: [IronPython] Embedding IronPython and calling > >>>>>>>> python functions from C# > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> You can read all yours file scripts, then using StringBuilder > to > >>>>>>>> combine then and call CreateScriptSourceFromString() > >>>>>>>> > >>>>>>>> Then you can call your functions within the combined scripts > >>>>>>>> normally. Pretty much you are creating a giant source code on > the > >>>>>>>> fly. > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> On Thu, Jun 11, 2009 at 5:32 PM, Patrick van der Willik > >>>>>>>> > wrote: > >>>>>>>> > >>>>>>>> I'm currently attempting to embed the IronPython 2 runtimes > into > >>>>>>>> an existing application written in C#. However, I find the > amount > >>>>>>>> of documentation lacking on what I'm trying to do. I currently > >>>>>>>> have a proof-of-concept version which uses Lua and > LuaInterface, > >>>>>>>> but the people who have to write the scripts dislike Lua(Well, > >>>>>>>> more hate it with a passion) and would love to see this > working > >>>>>>>> with Python. > >>>>>>>> > >>>>>>>> My host application is a networked application that must > trigger > >>>>>>>> certain scripts functions on events generated by the connected > >>>>>>>> clients. The idea is that when my application starts, it will > load > >>>>>>>> the IronPython script environment, launches an 'autoexec.py' > which > >>>>>>>> will load various other scripts files and do some housekeeping. > >>>>>>>> Once this all is completed, it will start listening to > incoming > >>>>>>>> connections. However, in various scenarios, the application > has to > >>>>>>>> trigger scripted functions when data is received from a client. > >>>>>>>> Which script function is called is different per client and > per > >>>>>>>> event. I have events for connecting, logging on, disconnecting > and > >>>>>>>> a set of data specific events after receiving data. This > highly > >>>>>>>> depends on the received packets. > >>>>>>>> > >>>>>>>> My question here is: How do I embed IronPython in such a > fashion > >>>>>>>> that I can load my scripts and then trigger various functions > >>>>>>>> within that? I've seen many examples that just call > >>>>>>>> CreateScriptSourceFromString() or File each time in which just > 1 > >>>>>>>> piece of code is implemented. This is not suitable for the > needs > >>>>>>>> here because the scripted systems can become quite complex. > >>>>>>>> > >>>>>>>> With regards, > >>>>>>>> Patrick > >>>>>>>> > >>>>>>>> > >>>>>>>> _______________________________________________ > >>>>>>>> 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 > >>>>>>>> > >>>>>>>> > >>>>>>> --------------------------------------------------------------- > --------- > >>>>>>> > >>>>>>> > >>>>>>> > >>>>>>> _______________________________________________ > >>>>>>> Users mailing list > >>>>>>> Users at lists.ironpython.com > >>>>>>> http://lists.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 et at et3d.com Tue Jun 16 06:40:09 2009 From: et at et3d.com (ET3D) Date: Mon, 15 Jun 2009 21:40:09 -0700 (PDT) Subject: [IronPython] How do I SetVariable to None? In-Reply-To: <1A472770E042064698CB5ADC83A12ACD032450A1@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <24018839.post@talk.nabble.com> <4A36168D.9070706@voidspace.org.uk> <24031784.post@talk.nabble.com> <1A472770E042064698CB5ADC83A12ACD032450A1@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <24047559.post@talk.nabble.com> Thanks! Using (Object)null worked. You probably need to actually cast null to (object). I suspect you could be getting the ObjectHandle overload which is used for remoting purposes. I'm a little surprised C# doesn't report this as ambiguous but then again IronPython doesn't either and selects the ObjectHandle overload just like C#. -- View this message in context: http://www.nabble.com/How-do-I-SetVariable-to-None--tp24018839p24047559.html Sent from the IronPython mailing list archive at Nabble.com. From patrick at toolmaker.nl Tue Jun 16 11:13:33 2009 From: patrick at toolmaker.nl (Patrick van der Willik) Date: Tue, 16 Jun 2009 11:13:33 +0200 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <1A472770E042064698CB5ADC83A12ACD0324C643@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4A311578.2000604@toolmaker.nl> <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> <4A363B60.1040006@toolmaker.nl> <4A36413F.5060704@voidspace.org.uk> <4A36D4BF.9000608@toolmaker.nl> <4A36D5D3.9080302@voidspace.org.uk> <4A36D899.4020600@toolmaker.nl> <1A472770E042064698CB5ADC83A12ACD0324BFB3@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A36DDD8.4010602@toolmaker.nl> <4A36E47F.3030509@voidspace.org.uk> <4A36E955.1080904@toolmaker.nl> <1A472770E042064698CB5ADC83A12ACD0324C643@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4A37623D.9010706@toolmaker.nl> Ok, I'm confused here. I'm very new to Python aswell, so this probably doesn't help very much. As oppossed to trying to constanly import a huge set of require variables all the time, I thought it might be a good idea to introduce 1 object into the globals space which will host a variety of the functions. I did this by calling engine.Runtime.Globals.SetVariable("server", server); then loading source script, compile it and invoke it on the scope. def OnConnect(user): global server server.log.Write("Test") However, this results in the same error, where server is not defined. I feel kinda silly here, as to me is would seem rather logical that when I introduce variables into a ScriptScope and then execute a function within that scope that it would work. I understand that variables themselfs are limited to a module, which sounds logical, but it feels weird that even tho I inject a variable directly into the globals table or into the scope that I created before executing a script on it, I can't (in)directly use them from script. The other solution would be to have the server object be part of every function call to scripts, but that sounds kinda silly... Patrick Dino Viehland wrote: > You can set the variables in ScriptRuntime.Globals but then the user > will need to import them from Globals to have access to them. There's no > way to automatically expose globals to every script though. > From sanxiyn at gmail.com Tue Jun 16 17:45:17 2009 From: sanxiyn at gmail.com (Seo Sanghyeon) Date: Wed, 17 Jun 2009 00:45:17 +0900 Subject: [IronPython] os.access bug Message-ID: <5b0248170906160845y74abcdd8tb182fe0eb0f39d66@mail.gmail.com> os.access('/nonexistent', os.X_OK) raises. It should return False. -- Seo Sanghyeon From merllab at microsoft.com Tue Jun 16 17:53:57 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Tue, 16 Jun 2009 08:53:57 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <6921d71f-7bf4-4bd9-8f7f-d76c6ab157bc@tk5-exsmh-c101.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/54862. ADDED SOURCES $/IronPython/IronPython_Main/Src/IronPython.Modules/_codecs_cn.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/_multibytecodec.cs MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython.Modules/_codecs_cn.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/_multibytecodec.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/IronPython.Modules.csproj $/IronPython/IronPython_Main/Src/IronPython.Modules/codecs.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonOperationKind.cs $/IronPython/IronPython_Main/Src/IronPython/Lib/iptest/assert_util.py $/IronPython/IronPython_Main/Src/IronPython/Lib/iptest/warning_util.py $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonOperationBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/MetaPythonObject.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/MetaUserObject.Members.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonProtocol.Operations.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/MetaUserObject.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonTypeOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/StringOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/InstanceOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/List.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonContext.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Ast/PythonNameBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Compiler/Parser.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/SymbolId.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/SymbolTable.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/OperatorMapping.cs $/IronPython/IronPython_Main/Src/Tests/regressions.py $/IronPython/IronPython_Main/Src/Tests/hosting/editor_svcs/errorlistener.py $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/TypeInfo.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/ThrowingErrorSink.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/PythonType.cs $/IronPython/IronPython_Main/Src/Tests/test_stdconsole.py $/IronPython/IronPython_Main/Src/Tests/test_ipye.py $/IronPython/IronPython_Main/Src/Tests/test_codecs.py $/IronPython/IronPython_Main/Src/Tests/test_builtinfunc.py $/IronPython/IronPython_Main/Src/Tests/test_syntax.py $/IronPython/IronPython_Main/Src/Tests/test_winforms.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 947161 Date: 6/15/2009 5:30:14 PM (dinov) DLR outer ring only: Fix case insensitivity of SymbolIDs. Our current case insensitive story for SymbolIDs doesn?t really work. There are 2 problems: 1. Case insensitive IDs won?t compare equal to normal case sensitive IDs. This means you can?t create a case insensitive ID and use it for lookup in an IAttributesCollection. a. This is just updating SymbolID to do the right comparisons and hashing and getting rid of some useless APIs here. 2. When we store the IDs in the SymbolTable there is no way to disambiguate between an all upper case symbol and the ?invariant? symbol. a. Here we need a separate table to store the invariant IDs. I?ve also gotten rid of the ToUpper call and replaced it with a case invariant dictionary. Now we have a separate table for the invariant IDs and it stores the latest case-version. There?s also a bunch of cleanup ? replaced the magic numbers with 2 constants and added some missing locking on our ToString and Contains APIs. (Shelveset: SymbolIdFix;REDMOND\dinov | SNAP CheckinId: 8701) -------------------------------------------------------------------------------- Changeset Id: 946342 Date: 6/15/2009 10:42:17 AM (dinov) 4566 codecs.escape_encode returns a string instead of a tuple and the string has the wrong value Fixed our implementation to match CPython 17541 IronPython compiler throws an exception on syntax warnings Replace throwing with a report to the warnings.showwarning function. We no longer set the error code on warnings either. 1717 ironpython issues less number of "syntaxwarning"'s compared to cpython We report less warnings because we throw on the 1st warning. We no longer throw and instead actually report a warning. Also updated the error messages to match CPython. 21483 str.ljust does not properly handle width=int.MinValue If we get a negative value return the original string I?m also adding some restrictions which are missing for purposes of x-lang interop. When VB is talking to us neither of us will restrict when we both should restrict. Python needs to restrict because we generate a type test, VB needs to restrict for whether it?s handling an IDMOP or not. (Shelveset: FixSyntaxWarningsFinal;REDMOND\dinov | SNAP CheckinId: 8694) -------------------------------------------------------------------------------- Changeset Id: 946270 Date: 6/15/2009 9:55:51 AM (dinov) Fixes various issues related to dir(). This change removes the get member names call site and replaces this with just a normal non-callsite based implementation of dir. It also fixes sorting of GetAttrNames in some cases so that a few tests had to be updated to handle the changed results. 22456 Unexpected instance variables on subclass when __dir__ implemented PythonType now adds all of the members (including non-string keys) and this is avoided when we do __dir__. Then PythonOps.GetAttrNames no longer needs to add non-string keys. 22832 dir(new-class) overlooks methods inherited from old-style classes PythonType updated to handle old-classes. This causes a number of tests (specifically one string formatting and a bunch of codecs tests) to start running that previously didn?t. I?ve disabled these tests and opened bugs. I?ve also added a start of the required codecs support but ifdef?d it out keep things simple here. 11883 Calling help() on a .NET Framework class causes it to show up twice in dir() output This seems to be fixed already ? just adding a regression test 20957 dir(expando_inst) doesn't show dyn members We now manifest a __dir__ method on non-Python IDynamicMetaObjectProvider instances. Then our normal handling for __dir__ picks this up and gets the member name.s 22536 dir() fails for some generic CLR types We need to handle the case where the Type is a generic type definition which does not return a name. (Shelveset: DirFixesFinal;REDMOND\dinov | SNAP CheckinId: 8693) From dinov at microsoft.com Tue Jun 16 18:05:50 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 16 Jun 2009 16:05:50 +0000 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <4A37623D.9010706@toolmaker.nl> References: <4A311578.2000604@toolmaker.nl> <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> <4A363B60.1040006@toolmaker.nl> <4A36413F.5060704@voidspace.org.uk> <4A36D4BF.9000608@toolmaker.nl> <4A36D5D3.9080302@voidspace.org.uk> <4A36D899.4020600@toolmaker.nl> <1A472770E042064698CB5ADC83A12ACD0324BFB3@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A36DDD8.4010602@toolmaker.nl> <4A36E47F.3030509@voidspace.org.uk> <4A36E955.1080904@toolmaker.nl> <1A472770E042064698CB5ADC83A12ACD0324C643@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A37623D.9010706@toolmaker.nl> Message-ID: <1A472770E042064698CB5ADC83A12ACD03263D30@TK5EX14MBXC116.redmond.corp.microsoft.com> Instead of "global server" you want "import server". Another option here might be to put this global object into the built-in module and then it would simply be available to all scripts all the time. You can do that via engine.GetBuiltinModule (it's an extension method defined in IronPython.Hosting). Then you can inject your value in. But then it'll be seen by all scripts. From there you might consider making your one global object be backed by a thread static so that you can get per-request isolation. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Patrick van der Willik Sent: Tuesday, June 16, 2009 2:14 AM To: Discussion of IronPython Subject: Re: [IronPython] Embedding IronPython and calling python functions from C# Ok, I'm confused here. I'm very new to Python aswell, so this probably doesn't help very much. As oppossed to trying to constanly import a huge set of require variables all the time, I thought it might be a good idea to introduce 1 object into the globals space which will host a variety of the functions. I did this by calling engine.Runtime.Globals.SetVariable("server", server); then loading source script, compile it and invoke it on the scope. def OnConnect(user): global server server.log.Write("Test") However, this results in the same error, where server is not defined. I feel kinda silly here, as to me is would seem rather logical that when I introduce variables into a ScriptScope and then execute a function within that scope that it would work. I understand that variables themselfs are limited to a module, which sounds logical, but it feels weird that even tho I inject a variable directly into the globals table or into the scope that I created before executing a script on it, I can't (in)directly use them from script. The other solution would be to have the server object be part of every function call to scripts, but that sounds kinda silly... Patrick Dino Viehland wrote: > You can set the variables in ScriptRuntime.Globals but then the user > will need to import them from Globals to have access to them. There's no > way to automatically expose globals to every script though. > _______________________________________________ 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 16 19:31:39 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 16 Jun 2009 18:31:39 +0100 Subject: [IronPython] Embedding IronPython and calling python functions from C# In-Reply-To: <4A37623D.9010706@toolmaker.nl> References: <4A311578.2000604@toolmaker.nl> <8cd017b80906110908kf7acd59uedcf44adb58280e1@mail.gmail.com> <6AF28EB9F93A354894F2F3916DF6F96E0C75A907EE@orsmsx510.amr.corp.intel.com> <4A363B60.1040006@toolmaker.nl> <4A36413F.5060704@voidspace.org.uk> <4A36D4BF.9000608@toolmaker.nl> <4A36D5D3.9080302@voidspace.org.uk> <4A36D899.4020600@toolmaker.nl> <1A472770E042064698CB5ADC83A12ACD0324BFB3@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A36DDD8.4010602@toolmaker.nl> <4A36E47F.3030509@voidspace.org.uk> <4A36E955.1080904@toolmaker.nl> <1A472770E042064698CB5ADC83A12ACD0324C643@TK5EX14MBXC116.redmond.corp.microsoft.com> <4A37623D.9010706@toolmaker.nl> Message-ID: <4A37D6FB.7000400@voidspace.org.uk> Patrick van der Willik wrote: > Ok, I'm confused here. I'm very new to Python aswell, so this probably > doesn't help very much. I think this is a big part of your issue. IronPython is a faithful implementation of Python and what you are tripping over are the Python scoping rules and the way modules behave. Classes and functions in modules only have access to the names defined in their scope *or* names imported into that scope (every module has an associated ScriptScope which is the module namespace). As Dino says - the correct way to make names available to a module is for that module to import them. If you publish objects into the runtime Globals then any scope can import them. > As oppossed to trying to constanly import a huge set of require > variables all the time, I thought it might be a good idea to introduce > 1 object into the globals space which will host a variety of the > functions. There is no global space in Python. Instead put all your functions / objects into a single module published into the runtime globals. Your modules can then do: import server server.function1() server.function2() Alternatively you can do "from something import *" but this is generally seen as bad form in Python as it causes namespace pollution and makes it harder to see where the names used in your code come from. Michael > > I did this by calling engine.Runtime.Globals.SetVariable("server", > server); then loading source script, compile it and invoke it on the > scope. > def OnConnect(user): > global server > server.log.Write("Test") > > However, this results in the same error, where server is not defined. > I feel kinda silly here, as to me is would seem rather logical that > when I introduce variables into a ScriptScope and then execute a > function within that scope that it would work. I understand that > variables themselfs are limited to a module, which sounds logical, but > it feels weird that even tho I inject a variable directly into the > globals table or into the scope that I created before executing a > script on it, I can't (in)directly use them from script. > > The other solution would be to have the server object be part of every > function call to scripts, but that sounds kinda silly... > > Patrick > > Dino Viehland wrote: >> You can set the variables in ScriptRuntime.Globals but then the user >> will need to import them from Globals to have access to them. >> There's no >> way to automatically expose globals to every script though. >> > > _______________________________________________ > 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/blog From sanxiyn at gmail.com Wed Jun 17 10:55:34 2009 From: sanxiyn at gmail.com (Seo Sanghyeon) Date: Wed, 17 Jun 2009 17:55:34 +0900 Subject: [IronPython] os.strerror Message-ID: <5b0248170906170155s6560c129ycd3a66cf849c9b91@mail.gmail.com> os.strerror is not implemented. Something as simple as the following woud work: import os import errno def strerror(code): if code == errno.ENOENT: return 'No such file or directory' elif code == errno.EACCES: return 'Permission denied' else: return 'Unknown error ' + str(code) os.strerror = strerror -- Seo Sanghyeon From sanxiyn at gmail.com Wed Jun 17 12:03:42 2009 From: sanxiyn at gmail.com (Seo Sanghyeon) Date: Wed, 17 Jun 2009 19:03:42 +0900 Subject: [IronPython] __module__ of FunctionType Message-ID: <5b0248170906170303q1cf01545g9af4109f3e1542e9@mail.gmail.com> Following program prints different result between CPython and IronPython: def f(): pass print type(f).__module__ CPython: __builtin__ IronPython: This breaks codes which assume __module__ is a string. -- Seo Sanghyeon From mc at mclaveau.com Wed Jun 17 16:21:59 2009 From: mc at mclaveau.com (Michel Claveau) Date: Wed, 17 Jun 2009 16:21:59 +0200 Subject: [IronPython] Ironpython & COM vs Jscript.Net & COM Message-ID: Hi! IronPython has poor support of COM techno. In particular, IP can not use dynamic COM servers (perhaps because they do not have TLB?). Now, cPython is good to create dynamic COM servers (see Python Programming on Win32, page 219 & +). Thus, ironPython is bad, to use the COM servers made with cPython. But... Recently, I had a look on Jscript.Net (NOT managed_JScript). I found that this language uses dynamic type (as Python), and can use dynamic COM servers! (and without DLR!!!) Example: var pd = new ActiveXObject("Ponxd.Mci"); var result = pd.myfuncsinverse('AABBCC'); IronPython could use the mechanics of JScript.Net, for COM servers? It would solve many problems. @+ -- Michel Claveau (sorry for my bad English) From merllab at microsoft.com Wed Jun 17 17:54:01 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Wed, 17 Jun 2009 08:54:01 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <5181bb9e-94a1-48a7-8d8a-0a0222f39c3f@tk5-exsmh-c101.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/54926. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/DispCallableMetaObject.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Dynamic/IDispatchMetaObject.cs $/IronPython/IronPython_Main/Src/Tests/Modes/ConsoleFlags.ps1 CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 948506 Date: 6/16/2009 11:12:36 AM (dfugate) The workaround for a known PowerShell stdout/stderr redirection issue (see see http://www.leeholmes.com/blog/WorkaroundTheOSHandlesPositionIsNotWhatFileStreamExpected.aspx) doesn't affect the PowerShell 2.0 CTP which a few people are already using. (Shelveset: POWERSHELL_1_0_HACK;REDMOND\dfugate | SNAP CheckinId: 8704) From dinov at microsoft.com Wed Jun 17 17:55:42 2009 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 17 Jun 2009 15:55:42 +0000 Subject: [IronPython] os.strerror In-Reply-To: <5b0248170906170155s6560c129ycd3a66cf849c9b91@mail.gmail.com> References: <5b0248170906170155s6560c129ycd3a66cf849c9b91@mail.gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD032811CA@TK5EX14MBXC116.redmond.corp.microsoft.com> Or there's always: import nt import errno for x in dir(errno): val = getattr(errno, x) if type(val) is int: print ('case PythonErrorNumber.%s: return "' + nt.strerror(val) + '";') % x :) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Seo Sanghyeon Sent: Wednesday, June 17, 2009 1:56 AM To: Discussion of IronPython Subject: [IronPython] os.strerror os.strerror is not implemented. Something as simple as the following woud work: import os import errno def strerror(code): if code == errno.ENOENT: return 'No such file or directory' elif code == errno.EACCES: return 'Permission denied' else: return 'Unknown error ' + str(code) os.strerror = strerror -- Seo Sanghyeon _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kristian.jaksch at gmail.com Wed Jun 17 20:29:57 2009 From: kristian.jaksch at gmail.com (Kristian Jaksch) Date: Wed, 17 Jun 2009 20:29:57 +0200 Subject: [IronPython] Abort thread Ironpython Silverlight Message-ID: <1dab55500906171129r74834242i8340f886bfd5f5d8@mail.gmail.com> I have developed a Silverlight application that uses IronPython to dynamically generate and execute a script. The script is dependent on data supplied by the user and can be computationally expensive so it's run on a separate thread. I need an option for the user to abort the script in case it hangs. I have tried Thread.Abort() but it seems Silverlight doesn't allow me to. Since the script is user supplied I cannot just raise a flag and request a polite abort. I'm looking for some more brutal way. Thanks for help! -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Wed Jun 17 19:20:09 2009 From: dinov at microsoft.com (Dino Viehland) Date: Wed, 17 Jun 2009 17:20:09 +0000 Subject: [IronPython] __module__ of FunctionType In-Reply-To: <5b0248170906170303q1cf01545g9af4109f3e1542e9@mail.gmail.com> References: <5b0248170906170303q1cf01545g9af4109f3e1542e9@mail.gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD03290EF6@TK5EX14MBXC118.redmond.corp.microsoft.com> Looks like this is because type.__module__ is not a data descriptor. I believe I have a fix. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Seo Sanghyeon Sent: Wednesday, June 17, 2009 3:04 AM To: Discussion of IronPython Subject: [IronPython] __module__ of FunctionType Following program prints different result between CPython and IronPython: def f(): pass print type(f).__module__ CPython: __builtin__ IronPython: This breaks codes which assume __module__ is a string. -- Seo Sanghyeon _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jregele23 at gmail.com Thu Jun 18 01:45:31 2009 From: jregele23 at gmail.com (Justin Regele) Date: Wed, 17 Jun 2009 16:45:31 -0700 Subject: [IronPython] clarification on current state of embedding Message-ID: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> What is the status of referencing IPy libraries compiled to dlls by other CLR languages? Google turned up that as of 1.1 you had to use the embedding/hosting api's, since the dlls were not compatible with say C# assemblies. There were allusions made to this being changed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Thu Jun 18 01:48:53 2009 From: slide.o.mix at gmail.com (Slide) Date: Wed, 17 Jun 2009 16:48:53 -0700 Subject: [IronPython] clarification on current state of embedding In-Reply-To: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> Message-ID: I would think that you would always need the DLR at least because of the references that the "compiled" dlls would have. On Wed, Jun 17, 2009 at 4:45 PM, Justin Regele wrote: > What is the status of referencing IPy libraries compiled to dlls by other > CLR languages? Google turned up that as of 1.1 you had to use the > embedding/hosting api's, since the dlls were not compatible with say C# > assemblies. There were allusions made to this being changed. > > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- slide-o-blog http://slide-o-blog.blogspot.com/ From jregele23 at gmail.com Thu Jun 18 02:04:14 2009 From: jregele23 at gmail.com (Justin Regele) Date: Wed, 17 Jun 2009 17:04:14 -0700 Subject: [IronPython] clarification on current state of embedding In-Reply-To: References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> Message-ID: <8429660906171704h1dde45bem7463a983d46d4b5f@mail.gmail.com> For a moment it looked like it would work. I can instantiate an object from my module, which showed up in intellisense, but can't access any of the methods within the object. Oh well. embedding it is. On Wed, Jun 17, 2009 at 4:48 PM, Slide wrote: > I would think that you would always need the DLR at least because of > the references that the "compiled" dlls would have. > > On Wed, Jun 17, 2009 at 4:45 PM, Justin Regele wrote: > > What is the status of referencing IPy libraries compiled to dlls by other > > CLR languages? Google turned up that as of 1.1 you had to use the > > embedding/hosting api's, since the dlls were not compatible with say C# > > assemblies. There were allusions made to this being changed. > > > > > > > > > > > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > -- > slide-o-blog > http://slide-o-blog.blogspot.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 Thu Jun 18 02:06:08 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 18 Jun 2009 01:06:08 +0100 Subject: [IronPython] clarification on current state of embedding In-Reply-To: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> Message-ID: <4A3984F0.5080907@voidspace.org.uk> Justin Regele wrote: > What is the status of referencing IPy libraries compiled to dlls by > other CLR languages? Google turned up that as of 1.1 you had to use > the embedding/hosting api's, since the dlls were not compatible with > say C# assemblies. There were allusions made to this being changed. You can't access Python classes except through the hosting API. There are no (public) plans for this to change anytime soon. Michael > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > 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/blog From curt at hagenlocher.org Thu Jun 18 02:08:20 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 17 Jun 2009 17:08:20 -0700 Subject: [IronPython] clarification on current state of embedding In-Reply-To: <4A3984F0.5080907@voidspace.org.uk> References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> <4A3984F0.5080907@voidspace.org.uk> Message-ID: ...except through the hosting API *and through the new C# dynamic functionality in .NET 4.0*. On Wed, Jun 17, 2009 at 5:06 PM, Michael Foord wrote: > Justin Regele wrote: > >> What is the status of referencing IPy libraries compiled to dlls by other >> CLR languages? Google turned up that as of 1.1 you had to use the >> embedding/hosting api's, since the dlls were not compatible with say C# >> assemblies. There were allusions made to this being changed. >> > > You can't access Python classes except through the hosting API. There are > no (public) plans for this to change anytime soon. > > Michael > > >> >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> 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/blog > > > > _______________________________________________ > 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 Thu Jun 18 02:12:18 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 18 Jun 2009 01:12:18 +0100 Subject: [IronPython] clarification on current state of embedding In-Reply-To: References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> <4A3984F0.5080907@voidspace.org.uk> Message-ID: <4A398662.5030303@voidspace.org.uk> Curt Hagenlocher wrote: > ...except through the hosting API *and through the new C# dynamic > functionality in .NET 4.0*. And how do you get to the classes to use them with the new dynamic functionality if it isn't through the hosting API? What you do with them once you get them is your own business of course... Michael > > On Wed, Jun 17, 2009 at 5:06 PM, Michael Foord > > wrote: > > Justin Regele wrote: > > What is the status of referencing IPy libraries compiled to > dlls by other CLR languages? Google turned up that as of 1.1 > you had to use the embedding/hosting api's, since the dlls > were not compatible with say C# assemblies. There were > allusions made to this being changed. > > > You can't access Python classes except through the hosting API. > There are no (public) plans for this to change anytime soon. > > Michael > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > 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/blog > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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/blog From vernondcole at gmail.com Thu Jun 18 02:54:43 2009 From: vernondcole at gmail.com (Vernon Cole) Date: Wed, 17 Jun 2009 18:54:43 -0600 Subject: [IronPython] clarification on current state of embedding In-Reply-To: <4A398662.5030303@voidspace.org.uk> References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> <4A3984F0.5080907@voidspace.org.uk> <4A398662.5030303@voidspace.org.uk> Message-ID: There are so many different .NET versions -- I suppose that somewhere in msdn there is an explanation of the differences -- but I have often wondered why IronPython used 2.0 when 3.5 is available. Just idle curiosity, I don't really care, but if there are significant new features, will IronPython 2.6 use the latest .NET? -- Vernon Cole On Wed, Jun 17, 2009 at 6:12 PM, Michael Foord wrote: > Curt Hagenlocher wrote: > >> ...except through the hosting API *and through the new C# dynamic >> functionality in .NET 4.0*. >> > > And how do you get to the classes to use them with the new dynamic > functionality if it isn't through the hosting API? > > What you do with them once you get them is your own business of course... > > Michael > > >> On Wed, Jun 17, 2009 at 5:06 PM, Michael Foord > fuzzyman at voidspace.org.uk>> wrote: >> >> Justin Regele wrote: >> >> What is the status of referencing IPy libraries compiled to >> dlls by other CLR languages? Google turned up that as of 1.1 >> you had to use the embedding/hosting api's, since the dlls >> were not compatible with say C# assemblies. There were >> allusions made to this being changed. >> >> >> You can't access Python classes except through the hosting API. >> There are no (public) plans for this to change anytime soon. >> >> Michael >> >> >> >> >> >> >> >> ------------------------------------------------------------------------ >> >> >> >> _______________________________________________ >> 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/blog >> >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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/blog > > > _______________________________________________ > 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 Thu Jun 18 03:05:57 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 17 Jun 2009 18:05:57 -0700 Subject: [IronPython] clarification on current state of embedding In-Reply-To: <4A398662.5030303@voidspace.org.uk> References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> <4A3984F0.5080907@voidspace.org.uk> <4A398662.5030303@voidspace.org.uk> Message-ID: Good point! On Wed, Jun 17, 2009 at 5:12 PM, Michael Foord wrote: > Curt Hagenlocher wrote: > >> ...except through the hosting API *and through the new C# dynamic >> functionality in .NET 4.0*. >> > > And how do you get to the classes to use them with the new dynamic > functionality if it isn't through the hosting API? > > What you do with them once you get them is your own business of course... > > Michael > > >> On Wed, Jun 17, 2009 at 5:06 PM, Michael Foord > fuzzyman at voidspace.org.uk>> wrote: >> >> Justin Regele wrote: >> >> What is the status of referencing IPy libraries compiled to >> dlls by other CLR languages? Google turned up that as of 1.1 >> you had to use the embedding/hosting api's, since the dlls >> were not compatible with say C# assemblies. There were >> allusions made to this being changed. >> >> >> You can't access Python classes except through the hosting API. >> There are no (public) plans for this to change anytime soon. >> >> Michael >> >> >> >> >> >> >> >> ------------------------------------------------------------------------ >> >> >> >> _______________________________________________ >> 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/blog >> >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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/blog > > > _______________________________________________ > 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 jregele23 at gmail.com Thu Jun 18 03:51:41 2009 From: jregele23 at gmail.com (Justin Regele) Date: Wed, 17 Jun 2009 18:51:41 -0700 Subject: [IronPython] clarification on current state of embedding In-Reply-To: References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> <4A3984F0.5080907@voidspace.org.uk> <4A398662.5030303@voidspace.org.uk> Message-ID: <8429660906171851p1d749f2cy1c9734e7df86efb3@mail.gmail.com> This brings up another question I've encountered. My understanding was that IPy had problems with 3.5, and so I have been targeting 2.0. But when I try to reference the IronPython and Microsoft.Scripting assemblies, Visual Studio says I need 3.5 On Wed, Jun 17, 2009 at 6:05 PM, Curt Hagenlocher wrote: > Good point! > > > On Wed, Jun 17, 2009 at 5:12 PM, Michael Foord wrote: > >> Curt Hagenlocher wrote: >> >>> ...except through the hosting API *and through the new C# dynamic >>> functionality in .NET 4.0*. >>> >> >> And how do you get to the classes to use them with the new dynamic >> functionality if it isn't through the hosting API? >> >> What you do with them once you get them is your own business of course... >> >> Michael >> >> >>> On Wed, Jun 17, 2009 at 5:06 PM, Michael Foord < >>> fuzzyman at voidspace.org.uk > wrote: >>> >>> Justin Regele wrote: >>> >>> What is the status of referencing IPy libraries compiled to >>> dlls by other CLR languages? Google turned up that as of 1.1 >>> you had to use the embedding/hosting api's, since the dlls >>> were not compatible with say C# assemblies. There were >>> allusions made to this being changed. >>> >>> >>> You can't access Python classes except through the hosting API. >>> There are no (public) plans for this to change anytime soon. >>> >>> Michael >>> >>> >>> >>> >>> >>> >>> >>> ------------------------------------------------------------------------ >>> >>> >>> >>> _______________________________________________ >>> 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/blog >>> >>> >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.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/blog >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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 Aloysius.Jegan at Lntemsys.com Thu Jun 18 05:05:08 2009 From: Aloysius.Jegan at Lntemsys.com (Aloysius Jegan) Date: Thu, 18 Jun 2009 08:35:08 +0530 Subject: [IronPython] Information In-Reply-To: Message-ID: Hi All, This is not a SPAM. It's a one time message to all... This may be wrong place to introduce my blog. If you are interested in technical knowledge sharing and wanted to know about new software's and more, Just visit http://www.aloysiusjegan.com/blog/ If you find this blog will be useful for you, please register and share your knowledge. Thanks. Regards Aloysius Jegan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Thu Jun 18 13:49:04 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 18 Jun 2009 12:49:04 +0100 Subject: [IronPython] clarification on current state of embedding In-Reply-To: <8429660906171851p1d749f2cy1c9734e7df86efb3@mail.gmail.com> References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> <4A3984F0.5080907@voidspace.org.uk> <4A398662.5030303@voidspace.org.uk> <8429660906171851p1d749f2cy1c9734e7df86efb3@mail.gmail.com> Message-ID: <4A3A29B0.1030802@voidspace.org.uk> Justin Regele wrote: > This brings up another question I've encountered. My understanding was > that IPy had problems with 3.5, and so I have been targeting 2.0. But > when I try to reference the IronPython and Microsoft.Scripting > assemblies, Visual Studio says I need 3.5 I've created many projects in Visual Studio referencing IronPython assemblies and targeting .NET 2.0. Which means I don't know what is wrong, but it *should* work fine... :-) Michael Foord > > > > On Wed, Jun 17, 2009 at 6:05 PM, Curt Hagenlocher > > wrote: > > Good point! > > > On Wed, Jun 17, 2009 at 5:12 PM, Michael Foord > > wrote: > > Curt Hagenlocher wrote: > > ...except through the hosting API *and through the new C# > dynamic functionality in .NET 4.0*. > > > And how do you get to the classes to use them with the new > dynamic functionality if it isn't through the hosting API? > > What you do with them once you get them is your own business > of course... > > Michael > > > On Wed, Jun 17, 2009 at 5:06 PM, Michael Foord > > >> wrote: > > Justin Regele wrote: > > What is the status of referencing IPy libraries > compiled to > dlls by other CLR languages? Google turned up that > as of 1.1 > you had to use the embedding/hosting api's, since > the dlls > were not compatible with say C# assemblies. There were > allusions made to this being changed. > > > You can't access Python classes except through the > hosting API. > There are no (public) plans for this to change anytime > soon. > > Michael > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > 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/blog > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > > > > > > http://lists.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/blog > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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/blog From curt at hagenlocher.org Thu Jun 18 15:04:27 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 18 Jun 2009 06:04:27 -0700 Subject: [IronPython] Hosting, Adaptive Compilation, and Interpreted Mode In-Reply-To: References: Message-ID: In 2.6, the current state is as follows: The "Interpreted" setting has been removed and "AdaptiveCompilation" is now the default. The sole alternative to adaptive compilation is "full up front" compilation, which can be enabled by saying "-X:NoAdaptiveCompilation". On Sat, Jun 13, 2009 at 11:32 AM, Jeff Hardy wrote: > I'm a little confused as to the various ways of configuring > IronPython's compilation behaviour. From what I gather, there should > be three possible settings: fully interpreted, adaptive compilation, > and fully compiled. It seems that the "AdaptiveCompilation" and > "Interpreted" settings can control these settings, but I'm not sure > how they interact. What combinations should I be using to acheive the > three options above? And what would be the result of setting both of > them to true? > > - Jeff > _______________________________________________ > 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 Thu Jun 18 15:45:34 2009 From: jdhardy at gmail.com (Jeff Hardy) Date: Thu, 18 Jun 2009 07:45:34 -0600 Subject: [IronPython] Hosting, Adaptive Compilation, and Interpreted Mode In-Reply-To: References: Message-ID: On Thu, Jun 18, 2009 at 7:04 AM, Curt Hagenlocher wrote: > In 2.6, the current state is as follows: > > The "Interpreted" setting has been removed and "AdaptiveCompilation" is now > the default. The sole alternative to adaptive compilation is "full up front" > compilation, which can be enabled by saying "-X:NoAdaptiveCompilation". Ok, cool. That's kind of what I gathered, but I wanted to confirm. Will interpreted mode ever come back, or is it dead? - Jeff > > On Sat, Jun 13, 2009 at 11:32 AM, Jeff Hardy wrote: >> >> I'm a little confused as to the various ways of configuring >> IronPython's compilation behaviour. From what I gather, there should >> be three possible settings: fully interpreted, adaptive compilation, >> and fully compiled. It seems that the "AdaptiveCompilation" and >> "Interpreted" settings can control these settings, but I'm not sure >> how they interact. What combinations should I be using to acheive the >> three options above? And what would be the result of setting both of >> them to true? >> >> - 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 stephen.p.lepisto at intel.com Thu Jun 18 16:00:52 2009 From: stephen.p.lepisto at intel.com (Lepisto, Stephen P) Date: Thu, 18 Jun 2009 07:00:52 -0700 Subject: [IronPython] clarification on current state of embedding In-Reply-To: <4A3A29B0.1030802@voidspace.org.uk> References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> <4A3984F0.5080907@voidspace.org.uk> <4A398662.5030303@voidspace.org.uk> <8429660906171851p1d749f2cy1c9734e7df86efb3@mail.gmail.com> <4A3A29B0.1030802@voidspace.org.uk> Message-ID: <6AF28EB9F93A354894F2F3916DF6F96E0C75BB63B0@orsmsx510.amr.corp.intel.com> >From MSDN (http://msdn.microsoft.com/en-us/library/bb383796.aspx): "Differences Between .NET Framework Versions All three versions of the .NET Framework are based on version 2.0 of the CLR. The versions of the .NET Framework differ from each other in the list of assemblies that each makes available for you to reference in your projects. For example, LINQ is a new technology that is included in Visual Studio 2008. .NET Framework 3.5 is the only version of the .NET Framework that has LINQ-related assemblies. Therefore, you cannot use LINQ unless your project specifically targets .NET Framework 3.5. Similarly, Windows Presentation Foundation (WPF) is included in Windows Vista. You cannot build WPF applications unless your project targets .NET Framework 3.0 and later versions of the .NET Framework." In addition, .Net 3.0 changed the compiler to add support for lambdas in C#, although the resulting code can still run on .Net 2.0 runtime. The lambdas are converted to anonymous functions by the compiler. There may be other "syntactic sugar" changes as well. In Visual Studio, when you select the target runtime, you are primarily telling Visual Studio (and the underlying .Net compiler tools) to filter out elements from later versions of .Net. Of course, if you include a reference to a .Net 3.5 assembly, you have to make sure .Net 3.5 is installed on the target system. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Thursday, June 18, 2009 4:49 AM To: Discussion of IronPython Subject: Re: [IronPython] clarification on current state of embedding Justin Regele wrote: > This brings up another question I've encountered. My understanding was > that IPy had problems with 3.5, and so I have been targeting 2.0. But > when I try to reference the IronPython and Microsoft.Scripting > assemblies, Visual Studio says I need 3.5 I've created many projects in Visual Studio referencing IronPython assemblies and targeting .NET 2.0. Which means I don't know what is wrong, but it *should* work fine... :-) Michael Foord > > > > On Wed, Jun 17, 2009 at 6:05 PM, Curt Hagenlocher > > wrote: > > Good point! > > > On Wed, Jun 17, 2009 at 5:12 PM, Michael Foord > > wrote: > > Curt Hagenlocher wrote: > > ...except through the hosting API *and through the new C# > dynamic functionality in .NET 4.0*. > > > And how do you get to the classes to use them with the new > dynamic functionality if it isn't through the hosting API? > > What you do with them once you get them is your own business > of course... > > Michael > > > On Wed, Jun 17, 2009 at 5:06 PM, Michael Foord > > >> wrote: > > Justin Regele wrote: > > What is the status of referencing IPy libraries > compiled to > dlls by other CLR languages? Google turned up that > as of 1.1 > you had to use the embedding/hosting api's, since > the dlls > were not compatible with say C# assemblies. There were > allusions made to this being changed. > > > You can't access Python classes except through the > hosting API. > There are no (public) plans for this to change anytime > soon. > > Michael > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > 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/blog > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > > > > > > http://lists.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/blog > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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/blog _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From curt at hagenlocher.org Thu Jun 18 16:30:27 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 18 Jun 2009 07:30:27 -0700 Subject: [IronPython] Hosting, Adaptive Compilation, and Interpreted Mode In-Reply-To: References: Message-ID: Adaptive compilation is built on an interpreter that uses heuristics to decide when to compile a particular function. If there were going to be a "pure interpreted" mode, it would probably come in the form of overriding those heuristics to say "never compile". The original interpreter was a much less nice piece of code than the current one, and it definitely won't be coming back. :) On Thu, Jun 18, 2009 at 6:45 AM, Jeff Hardy wrote: > On Thu, Jun 18, 2009 at 7:04 AM, Curt Hagenlocher > wrote: > > In 2.6, the current state is as follows: > > > > The "Interpreted" setting has been removed and "AdaptiveCompilation" is > now > > the default. The sole alternative to adaptive compilation is "full up > front" > > compilation, which can be enabled by saying "-X:NoAdaptiveCompilation". > > Ok, cool. That's kind of what I gathered, but I wanted to confirm. > Will interpreted mode ever come back, or is it dead? > > - Jeff > > > > > > On Sat, Jun 13, 2009 at 11:32 AM, Jeff Hardy wrote: > >> > >> I'm a little confused as to the various ways of configuring > >> IronPython's compilation behaviour. From what I gather, there should > >> be three possible settings: fully interpreted, adaptive compilation, > >> and fully compiled. It seems that the "AdaptiveCompilation" and > >> "Interpreted" settings can control these settings, but I'm not sure > >> how they interact. What combinations should I be using to acheive the > >> three options above? And what would be the result of setting both of > >> them to true? > >> > >> - 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 > > > > > _______________________________________________ > 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 merllab at microsoft.com Thu Jun 18 17:52:18 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Thu, 18 Jun 2009 08:52:18 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/55001. ADDED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/Calls/TypeInferer.cs MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonOverloadResolver.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/Calls/DefaultOverloadResolver.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/Calls/ArgBuilder.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/Calls/CallFailureReason.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/Calls/CallFailure.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/MetaPythonFunction.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/BuiltinFunction.cs $/IronPython/IronPython_Main/Src/IronPythonTest/BindTest.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/Calls/TypeInferer.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/Calls/RestrictedArguments.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/Calls/ParamsArgBuilder.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/Calls/SimpleArgBuilder.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/Calls/OverloadResolver.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/Calls/ParameterMapping.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/Calls/MethodCandidate.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Actions/Calls/KeywordArgBuilder.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Microsoft.Scripting.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Runtime/BinderOps.cs $/IronPython/IronPython_Main/Src/Tests/test_methodbinder1.py $/IronPython/IronPython_Main/Src/Tests/test_cliclass.py $/IronPython/IronPython_Main/Src/Tests/test_methodbinder2.py $/IronPython/IronPython_Main/Src/Tests/test_statics.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 950981 Date: 6/17/2009 2:10:25 PM (dinov) Implements support for generic method type inference. Mostly a DLR outer layer change with some tweaks to IronPython and IronRuby. Python changes: We no longer need to eagerly detect when we?re calling a method w/ only generics. We also add support for inferring types for Lambda arguments based upon a Python Function?s arity. Finally there?s one fix where we make sure to create the correct kind DMO instead of just the base DynamicMetaObject type. A few tests are also updated as there are some minor changes in results when overloaded by both a generic method and a non-generic method. Finally lots of new tests are added. Ruby changes: Ruby?s MethodGroupInfo was doing MakeGenericMethod and then returning the generic method. But the types it?s passing in are all generic parameters ? so the end result is Ruby produces a method for which .IsGenericMethodDefinition is false but it contains all of the original generic method parameters. Now we return the original target so IsGenericMethodDefinition remains true. Also updated MissingBlockArgBuilder so we can know that it doesn?t really prodive any parameters. Finally the small set of tests verifying exceptions are throw are updated to expect successful inference. DLR changes: This is the bulk of the changes. Added a new TypeInferer class which performs the actual type inference. Added a new CallFailureReason for noting when we failed to perform type inference. Updated the ArgBuilder?s so we can clone them w/ a new ParameterInfo. This is used for replacing the existing ArgBuilder?s built for the generic method w/ new ArgBuilders which have been specialized to the specific generic type. Fixed a couple of spots where we were creating base DynamicMetaObject?s instead of getting them from their values. Added support for MethodCandidate?s to track additional restrictions with themselves ? this is necessary because the type inference can result in new type checks when inferring based ... (Shelveset: GenericMethodTypeInferenceFinal2;REDMOND\dinov | SNAP CheckinId: 8720) From jdhardy at gmail.com Thu Jun 18 20:20:14 2009 From: jdhardy at gmail.com (Jeff Hardy) Date: Thu, 18 Jun 2009 12:20:14 -0600 Subject: [IronPython] Hosting, Adaptive Compilation, and Interpreted Mode In-Reply-To: References: Message-ID: On Thu, Jun 18, 2009 at 8:30 AM, Curt Hagenlocher wrote: > Adaptive compilation is built on an interpreter that uses heuristics to > decide when to compile a particular function. If there were going to be a > "pure interpreted" mode, it would probably come in the form of overriding > those heuristics to say "never compile". > The original interpreter was a much less nice piece of code than the current > one, and it definitely won't be coming back. :) Interesting. I don't have a use for interpreted mode, just curious. Thanks! - Jeff From jregele23 at gmail.com Thu Jun 18 21:57:46 2009 From: jregele23 at gmail.com (Justin Regele) Date: Thu, 18 Jun 2009 12:57:46 -0700 Subject: [IronPython] clarification on current state of embedding In-Reply-To: <6AF28EB9F93A354894F2F3916DF6F96E0C75BB63B0@orsmsx510.amr.corp.intel.com> References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> <4A3984F0.5080907@voidspace.org.uk> <4A398662.5030303@voidspace.org.uk> <8429660906171851p1d749f2cy1c9734e7df86efb3@mail.gmail.com> <4A3A29B0.1030802@voidspace.org.uk> <6AF28EB9F93A354894F2F3916DF6F96E0C75BB63B0@orsmsx510.amr.corp.intel.com> Message-ID: <8429660906181257o2bdf25cdp41ef9b51aed1bc1@mail.gmail.com> This makes sense, although I am still confused as to why problems keep creeping up to me. I am on Vista, though, and so I think my problem is that while I installed 2.0, I cannot instal SP1. The server my code will run on is still on 2.0 until the new system is rolled out, which may be 6 months from now. I built all my IPy libs for 2.0, but when I added a C# project to wrap the embedded program and targetted 2.0 all the assemblies say they require 3.5. If I add them anyway, the Microsoft scripting assemblies can't be found. No such errors or warning about the IronPython assemblies, although I'm back to 'Python does not exist in the current context', even though I've got the assemblies loaded and using IronPython.Hosting. After trudging through this weirdness for a bit now, I'm realizing that the issue most likely comes from running a x64 version of Vista, while IronPython is in the x86 program files. I'm going to bulid IronPython from source for 2.0 and see if that fixes the problem. On Thu, Jun 18, 2009 at 7:00 AM, Lepisto, Stephen P < stephen.p.lepisto at intel.com> wrote: > >From MSDN (http://msdn.microsoft.com/en-us/library/bb383796.aspx): > > "Differences Between .NET Framework Versions > All three versions of the .NET Framework are based on version 2.0 of the > CLR. The versions of the .NET Framework differ from each other in the list > of assemblies that each makes available for you to reference in your > projects. For example, LINQ is a new technology that is included in Visual > Studio 2008. .NET Framework 3.5 is the only version of the .NET Framework > that has LINQ-related assemblies. Therefore, you cannot use LINQ unless your > project specifically targets .NET Framework 3.5. Similarly, Windows > Presentation Foundation (WPF) is included in Windows Vista. You cannot build > WPF applications unless your project targets .NET Framework 3.0 and later > versions of the .NET Framework." > > In addition, .Net 3.0 changed the compiler to add support for lambdas in > C#, although the resulting code can still run on .Net 2.0 runtime. The > lambdas are converted to anonymous functions by the compiler. There may be > other "syntactic sugar" changes as well. > > In Visual Studio, when you select the target runtime, you are primarily > telling Visual Studio (and the underlying .Net compiler tools) to filter out > elements from later versions of .Net. Of course, if you include a reference > to a .Net 3.5 assembly, you have to make sure .Net 3.5 is installed on the > target system. > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Thursday, June 18, 2009 4:49 AM > To: Discussion of IronPython > Subject: Re: [IronPython] clarification on current state of embedding > > Justin Regele wrote: > > This brings up another question I've encountered. My understanding was > > that IPy had problems with 3.5, and so I have been targeting 2.0. But > > when I try to reference the IronPython and Microsoft.Scripting > > assemblies, Visual Studio says I need 3.5 > > > I've created many projects in Visual Studio referencing IronPython > assemblies and targeting .NET 2.0. Which means I don't know what is > wrong, but it *should* work fine... :-) > > Michael Foord > > > > > > > > On Wed, Jun 17, 2009 at 6:05 PM, Curt Hagenlocher > > > wrote: > > > > Good point! > > > > > > On Wed, Jun 17, 2009 at 5:12 PM, Michael Foord > > > > wrote: > > > > Curt Hagenlocher wrote: > > > > ...except through the hosting API *and through the new C# > > dynamic functionality in .NET 4.0*. > > > > > > And how do you get to the classes to use them with the new > > dynamic functionality if it isn't through the hosting API? > > > > What you do with them once you get them is your own business > > of course... > > > > Michael > > > > > > On Wed, Jun 17, 2009 at 5:06 PM, Michael Foord > > > > > > >> wrote: > > > > Justin Regele wrote: > > > > What is the status of referencing IPy libraries > > compiled to > > dlls by other CLR languages? Google turned up that > > as of 1.1 > > you had to use the embedding/hosting api's, since > > the dlls > > were not compatible with say C# assemblies. There were > > allusions made to this being changed. > > > > > > You can't access Python classes except through the > > hosting API. > > There are no (public) plans for this to change anytime > > soon. > > > > Michael > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > _______________________________________________ > > 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/blog > > > > > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > > > > > > > > > > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com Users at lists.ironpython.com> > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > -- > > http://www.ironpythoninaction.com/ > > http://www.voidspace.org.uk/blog > > > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.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/blog > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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 Thu Jun 18 21:59:51 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 18 Jun 2009 20:59:51 +0100 Subject: [IronPython] clarification on current state of embedding In-Reply-To: <8429660906181257o2bdf25cdp41ef9b51aed1bc1@mail.gmail.com> References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> <4A3984F0.5080907@voidspace.org.uk> <4A398662.5030303@voidspace.org.uk> <8429660906171851p1d749f2cy1c9734e7df86efb3@mail.gmail.com> <4A3A29B0.1030802@voidspace.org.uk> <6AF28EB9F93A354894F2F3916DF6F96E0C75BB63B0@orsmsx510.amr.corp.intel.com> <8429660906181257o2bdf25cdp41ef9b51aed1bc1@mail.gmail.com> Message-ID: <4A3A9CB7.1080808@voidspace.org.uk> Justin Regele wrote: > This makes sense, although I am still confused as to why problems keep > creeping up to me. I am on Vista, though, and so I think my problem is > that while I installed 2.0, I cannot instal SP1. The server my code > will run on is still on 2.0 until the new system is rolled out, which > may be 6 months from now. > > I built all my IPy libs for 2.0, but when I added a C# project to wrap > the embedded program and targetted 2.0 all the assemblies say they > require 3.5. If I add them anyway, the Microsoft scripting assemblies > can't be found. No such errors or warning about the IronPython > assemblies, although I'm back to 'Python does not exist in the current > context', even though I've got the assemblies loaded and using > IronPython.Hosting. > > After trudging through this weirdness for a bit now, I'm realizing > that the issue most likely comes from running a x64 version of Vista, > while IronPython is in the x86 program files. IronPython is pure .NET code. It is independent of 32/64 bitness. It may be that to get .NET 2 SP1 on vista you actually need to install .NET 3.5? Seems odd though. Michael > > I'm going to bulid IronPython from source for 2.0 and see if that > fixes the problem. > > > On Thu, Jun 18, 2009 at 7:00 AM, Lepisto, Stephen P > > wrote: > > >From MSDN (http://msdn.microsoft.com/en-us/library/bb383796.aspx): > > "Differences Between .NET Framework Versions > All three versions of the .NET Framework are based on version 2.0 > of the CLR. The versions of the .NET Framework differ from each > other in the list of assemblies that each makes available for you > to reference in your projects. For example, LINQ is a new > technology that is included in Visual Studio 2008. .NET Framework > 3.5 is the only version of the .NET Framework that has > LINQ-related assemblies. Therefore, you cannot use LINQ unless > your project specifically targets .NET Framework 3.5. Similarly, > Windows Presentation Foundation (WPF) is included in Windows > Vista. You cannot build WPF applications unless your project > targets .NET Framework 3.0 and later versions of the .NET Framework." > > In addition, .Net 3.0 changed the compiler to add support for > lambdas in C#, although the resulting code can still run on .Net > 2.0 runtime. The lambdas are converted to anonymous functions by > the compiler. There may be other "syntactic sugar" changes as well. > > In Visual Studio, when you select the target runtime, you are > primarily telling Visual Studio (and the underlying .Net compiler > tools) to filter out elements from later versions of .Net. Of > course, if you include a reference to a .Net 3.5 assembly, you > have to make sure .Net 3.5 is installed on the target system. > > > -----Original Message----- > From: users-bounces at lists.ironpython.com > > [mailto:users-bounces at lists.ironpython.com > ] On Behalf Of Michael > Foord > Sent: Thursday, June 18, 2009 4:49 AM > To: Discussion of IronPython > Subject: Re: [IronPython] clarification on current state of embedding > > Justin Regele wrote: > > This brings up another question I've encountered. My > understanding was > > that IPy had problems with 3.5, and so I have been targeting > 2.0. But > > when I try to reference the IronPython and Microsoft.Scripting > > assemblies, Visual Studio says I need 3.5 > > > I've created many projects in Visual Studio referencing IronPython > assemblies and targeting .NET 2.0. Which means I don't know what is > wrong, but it *should* work fine... :-) > > Michael Foord > > > > > > > > On Wed, Jun 17, 2009 at 6:05 PM, Curt Hagenlocher > > > >> wrote: > > > > Good point! > > > > > > On Wed, Jun 17, 2009 at 5:12 PM, Michael Foord > > > >> wrote: > > > > Curt Hagenlocher wrote: > > > > ...except through the hosting API *and through the > new C# > > dynamic functionality in .NET 4.0*. > > > > > > And how do you get to the classes to use them with the new > > dynamic functionality if it isn't through the hosting API? > > > > What you do with them once you get them is your own business > > of course... > > > > Michael > > > > > > On Wed, Jun 17, 2009 at 5:06 PM, Michael Foord > > > > > > > > > >>> wrote: > > > > Justin Regele wrote: > > > > What is the status of referencing IPy libraries > > compiled to > > dlls by other CLR languages? Google turned up > that > > as of 1.1 > > you had to use the embedding/hosting api's, since > > the dlls > > were not compatible with say C# assemblies. > There were > > allusions made to this being changed. > > > > > > You can't access Python classes except through the > > hosting API. > > There are no (public) plans for this to change > anytime > > soon. > > > > Michael > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > _______________________________________________ > > 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/blog > > > > > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > > > > > > > >> > > > > > > > http://lists.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/blog > > > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > > > > > http://lists.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/blog > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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/blog From jregele23 at gmail.com Thu Jun 18 22:18:34 2009 From: jregele23 at gmail.com (Justin Regele) Date: Thu, 18 Jun 2009 13:18:34 -0700 Subject: [IronPython] clarification on current state of embedding In-Reply-To: <4A3A9CB7.1080808@voidspace.org.uk> References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> <4A3984F0.5080907@voidspace.org.uk> <4A398662.5030303@voidspace.org.uk> <8429660906171851p1d749f2cy1c9734e7df86efb3@mail.gmail.com> <4A3A29B0.1030802@voidspace.org.uk> <6AF28EB9F93A354894F2F3916DF6F96E0C75BB63B0@orsmsx510.amr.corp.intel.com> <8429660906181257o2bdf25cdp41ef9b51aed1bc1@mail.gmail.com> <4A3A9CB7.1080808@voidspace.org.uk> Message-ID: <8429660906181318m177659ccw358e6284564c7b72@mail.gmail.com> Yeah, I thought it was strange too. To be sure, I just downloaded the x64 .net 2.0 Sp1 installer again, ran it and here is the reason it errors: "This product is not supported on Vista Operating System". There you have it. I'm grabbing the x86 sp1 and going to see if that one works. On Thu, Jun 18, 2009 at 12:59 PM, Michael Foord wrote: > Justin Regele wrote: > >> This makes sense, although I am still confused as to why problems keep >> creeping up to me. I am on Vista, though, and so I think my problem is that >> while I installed 2.0, I cannot instal SP1. The server my code will run on >> is still on 2.0 until the new system is rolled out, which may be 6 months >> from now. >> >> I built all my IPy libs for 2.0, but when I added a C# project to wrap the >> embedded program and targetted 2.0 all the assemblies say they require 3.5. >> If I add them anyway, the Microsoft scripting assemblies can't be found. No >> such errors or warning about the IronPython assemblies, although I'm back to >> 'Python does not exist in the current context', even though I've got the >> assemblies loaded and using IronPython.Hosting. >> >> After trudging through this weirdness for a bit now, I'm realizing that >> the issue most likely comes from running a x64 version of Vista, while >> IronPython is in the x86 program files. >> > > IronPython is pure .NET code. It is independent of 32/64 bitness. > > It may be that to get .NET 2 SP1 on vista you actually need to install .NET > 3.5? Seems odd though. > > Michael > > >> I'm going to bulid IronPython from source for 2.0 and see if that fixes >> the problem. >> >> >> On Thu, Jun 18, 2009 at 7:00 AM, Lepisto, Stephen P < >> stephen.p.lepisto at intel.com > wrote: >> >> >From MSDN (http://msdn.microsoft.com/en-us/library/bb383796.aspx): >> >> "Differences Between .NET Framework Versions >> All three versions of the .NET Framework are based on version 2.0 >> of the CLR. The versions of the .NET Framework differ from each >> other in the list of assemblies that each makes available for you >> to reference in your projects. For example, LINQ is a new >> technology that is included in Visual Studio 2008. .NET Framework >> 3.5 is the only version of the .NET Framework that has >> LINQ-related assemblies. Therefore, you cannot use LINQ unless >> your project specifically targets .NET Framework 3.5. Similarly, >> Windows Presentation Foundation (WPF) is included in Windows >> Vista. You cannot build WPF applications unless your project >> targets .NET Framework 3.0 and later versions of the .NET Framework." >> >> In addition, .Net 3.0 changed the compiler to add support for >> lambdas in C#, although the resulting code can still run on .Net >> 2.0 runtime. The lambdas are converted to anonymous functions by >> the compiler. There may be other "syntactic sugar" changes as well. >> >> In Visual Studio, when you select the target runtime, you are >> primarily telling Visual Studio (and the underlying .Net compiler >> tools) to filter out elements from later versions of .Net. Of >> course, if you include a reference to a .Net 3.5 assembly, you >> have to make sure .Net 3.5 is installed on the target system. >> >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com >> >> [mailto:users-bounces at lists.ironpython.com >> ] On Behalf Of Michael >> Foord >> Sent: Thursday, June 18, 2009 4:49 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] clarification on current state of embedding >> >> Justin Regele wrote: >> > This brings up another question I've encountered. My >> understanding was >> > that IPy had problems with 3.5, and so I have been targeting >> 2.0. But >> > when I try to reference the IronPython and Microsoft.Scripting >> > assemblies, Visual Studio says I need 3.5 >> >> >> I've created many projects in Visual Studio referencing IronPython >> assemblies and targeting .NET 2.0. Which means I don't know what is >> wrong, but it *should* work fine... :-) >> >> Michael Foord >> > >> > >> > >> > On Wed, Jun 17, 2009 at 6:05 PM, Curt Hagenlocher >> > >> >> wrote: >> > >> > Good point! >> > >> > >> > On Wed, Jun 17, 2009 at 5:12 PM, Michael Foord >> > > >> > >> wrote: >> > >> > Curt Hagenlocher wrote: >> > >> > ...except through the hosting API *and through the >> new C# >> > dynamic functionality in .NET 4.0*. >> > >> > >> > And how do you get to the classes to use them with the new >> > dynamic functionality if it isn't through the hosting API? >> > >> > What you do with them once you get them is your own business >> > of course... >> > >> > Michael >> > >> > >> > On Wed, Jun 17, 2009 at 5:06 PM, Michael Foord >> > > >> > > > >> > > >> > > >>> wrote: >> > >> > Justin Regele wrote: >> > >> > What is the status of referencing IPy libraries >> > compiled to >> > dlls by other CLR languages? Google turned up >> that >> > as of 1.1 >> > you had to use the embedding/hosting api's, since >> > the dlls >> > were not compatible with say C# assemblies. >> There were >> > allusions made to this being changed. >> > >> > >> > You can't access Python classes except through the >> > hosting API. >> > There are no (public) plans for this to change >> anytime >> > soon. >> > >> > Michael >> > >> > >> > >> > >> > >> > >> > >> > >> ------------------------------------------------------------------------ >> > >> > >> > >> > _______________________________________________ >> > 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/blog >> > >> > >> > >> > _______________________________________________ >> > Users mailing list >> > Users at lists.ironpython.com >> >> > > > >> > > >> > > >> >> > >> > >> > >> http://lists.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/blog >> > >> > >> > _______________________________________________ >> > Users mailing list >> > Users at lists.ironpython.com >> >> > > >> > >> http://lists.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/blog >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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/blog > > > _______________________________________________ > 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 Thu Jun 18 22:22:22 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Thu, 18 Jun 2009 13:22:22 -0700 Subject: [IronPython] clarification on current state of embedding In-Reply-To: <8429660906181318m177659ccw358e6284564c7b72@mail.gmail.com> References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> <4A398662.5030303@voidspace.org.uk> <8429660906171851p1d749f2cy1c9734e7df86efb3@mail.gmail.com> <4A3A29B0.1030802@voidspace.org.uk> <6AF28EB9F93A354894F2F3916DF6F96E0C75BB63B0@orsmsx510.amr.corp.intel.com> <8429660906181257o2bdf25cdp41ef9b51aed1bc1@mail.gmail.com> <4A3A9CB7.1080808@voidspace.org.uk> <8429660906181318m177659ccw358e6284564c7b72@mail.gmail.com> Message-ID: Are you getting an error when you run ipy.exe that tells you that SP1 is needed? If not, then you already have it installed. IIRC, 2.0SP1 was pushed out through Windows Update. On Thu, Jun 18, 2009 at 1:18 PM, Justin Regele wrote: > Yeah, I thought it was strange too. To be sure, I just downloaded the x64 > .net 2.0 Sp1 installer again, ran it and here is the reason it errors: > > "This product is not supported on Vista Operating System". > > There you have it. > I'm grabbing the x86 sp1 and going to see if that one works. > > On Thu, Jun 18, 2009 at 12:59 PM, Michael Foord > wrote: > >> Justin Regele wrote: >> >>> This makes sense, although I am still confused as to why problems keep >>> creeping up to me. I am on Vista, though, and so I think my problem is that >>> while I installed 2.0, I cannot instal SP1. The server my code will run on >>> is still on 2.0 until the new system is rolled out, which may be 6 months >>> from now. >>> >>> I built all my IPy libs for 2.0, but when I added a C# project to wrap >>> the embedded program and targetted 2.0 all the assemblies say they require >>> 3.5. If I add them anyway, the Microsoft scripting assemblies can't be >>> found. No such errors or warning about the IronPython assemblies, although >>> I'm back to 'Python does not exist in the current context', even though I've >>> got the assemblies loaded and using IronPython.Hosting. >>> >>> After trudging through this weirdness for a bit now, I'm realizing that >>> the issue most likely comes from running a x64 version of Vista, while >>> IronPython is in the x86 program files. >>> >> >> IronPython is pure .NET code. It is independent of 32/64 bitness. >> >> It may be that to get .NET 2 SP1 on vista you actually need to install >> .NET 3.5? Seems odd though. >> >> Michael >> >> >>> I'm going to bulid IronPython from source for 2.0 and see if that fixes >>> the problem. >>> >>> >>> On Thu, Jun 18, 2009 at 7:00 AM, Lepisto, Stephen P < >>> stephen.p.lepisto at intel.com > wrote: >>> >>> >From MSDN (http://msdn.microsoft.com/en-us/library/bb383796.aspx): >>> >>> "Differences Between .NET Framework Versions >>> All three versions of the .NET Framework are based on version 2.0 >>> of the CLR. The versions of the .NET Framework differ from each >>> other in the list of assemblies that each makes available for you >>> to reference in your projects. For example, LINQ is a new >>> technology that is included in Visual Studio 2008. .NET Framework >>> 3.5 is the only version of the .NET Framework that has >>> LINQ-related assemblies. Therefore, you cannot use LINQ unless >>> your project specifically targets .NET Framework 3.5. Similarly, >>> Windows Presentation Foundation (WPF) is included in Windows >>> Vista. You cannot build WPF applications unless your project >>> targets .NET Framework 3.0 and later versions of the .NET Framework." >>> >>> In addition, .Net 3.0 changed the compiler to add support for >>> lambdas in C#, although the resulting code can still run on .Net >>> 2.0 runtime. The lambdas are converted to anonymous functions by >>> the compiler. There may be other "syntactic sugar" changes as well. >>> >>> In Visual Studio, when you select the target runtime, you are >>> primarily telling Visual Studio (and the underlying .Net compiler >>> tools) to filter out elements from later versions of .Net. Of >>> course, if you include a reference to a .Net 3.5 assembly, you >>> have to make sure .Net 3.5 is installed on the target system. >>> >>> >>> -----Original Message----- >>> From: users-bounces at lists.ironpython.com >>> >>> [mailto:users-bounces at lists.ironpython.com >>> ] On Behalf Of Michael >>> Foord >>> Sent: Thursday, June 18, 2009 4:49 AM >>> To: Discussion of IronPython >>> Subject: Re: [IronPython] clarification on current state of embedding >>> >>> Justin Regele wrote: >>> > This brings up another question I've encountered. My >>> understanding was >>> > that IPy had problems with 3.5, and so I have been targeting >>> 2.0. But >>> > when I try to reference the IronPython and Microsoft.Scripting >>> > assemblies, Visual Studio says I need 3.5 >>> >>> >>> I've created many projects in Visual Studio referencing IronPython >>> assemblies and targeting .NET 2.0. Which means I don't know what is >>> wrong, but it *should* work fine... :-) >>> >>> Michael Foord >>> > >>> > >>> > >>> > On Wed, Jun 17, 2009 at 6:05 PM, Curt Hagenlocher >>> > >>> >> wrote: >>> > >>> > Good point! >>> > >>> > >>> > On Wed, Jun 17, 2009 at 5:12 PM, Michael Foord >>> > >> >>> >> >> wrote: >>> > >>> > Curt Hagenlocher wrote: >>> > >>> > ...except through the hosting API *and through the >>> new C# >>> > dynamic functionality in .NET 4.0*. >>> > >>> > >>> > And how do you get to the classes to use them with the new >>> > dynamic functionality if it isn't through the hosting API? >>> > >>> > What you do with them once you get them is your own business >>> > of course... >>> > >>> > Michael >>> > >>> > >>> > On Wed, Jun 17, 2009 at 5:06 PM, Michael Foord >>> > >> >>> > >> > >>> > >> >>> > >> >>> wrote: >>> > >>> > Justin Regele wrote: >>> > >>> > What is the status of referencing IPy libraries >>> > compiled to >>> > dlls by other CLR languages? Google turned up >>> that >>> > as of 1.1 >>> > you had to use the embedding/hosting api's, since >>> > the dlls >>> > were not compatible with say C# assemblies. >>> There were >>> > allusions made to this being changed. >>> > >>> > >>> > You can't access Python classes except through the >>> > hosting API. >>> > There are no (public) plans for this to change >>> anytime >>> > soon. >>> > >>> > Michael >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> ------------------------------------------------------------------------ >>> > >>> > >>> > >>> > _______________________________________________ >>> > 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/blog >>> > >>> > >>> > >>> > _______________________________________________ >>> > Users mailing list >>> > Users at lists.ironpython.com >>> >>> > >> > >>> > >> >>> > >> >> >>> > >>> > >>> > >>> http://lists.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/blog >>> > >>> > >>> > _______________________________________________ >>> > Users mailing list >>> > Users at lists.ironpython.com >>> >>> >> > >>> > >>> http://lists.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/blog >>> >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.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/blog >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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 jregele23 at gmail.com Thu Jun 18 22:31:22 2009 From: jregele23 at gmail.com (Justin Regele) Date: Thu, 18 Jun 2009 13:31:22 -0700 Subject: [IronPython] clarification on current state of embedding In-Reply-To: References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> <4A398662.5030303@voidspace.org.uk> <8429660906171851p1d749f2cy1c9734e7df86efb3@mail.gmail.com> <4A3A29B0.1030802@voidspace.org.uk> <6AF28EB9F93A354894F2F3916DF6F96E0C75BB63B0@orsmsx510.amr.corp.intel.com> <8429660906181257o2bdf25cdp41ef9b51aed1bc1@mail.gmail.com> <4A3A9CB7.1080808@voidspace.org.uk> <8429660906181318m177659ccw358e6284564c7b72@mail.gmail.com> Message-ID: <8429660906181331v75bda818if7f46fe7a921c7a7@mail.gmail.com> No. I can run ipy.exe. I've successfully run embedded scripts, I've ported my python app to IPy in Visual Studio and worked through the needed modifications. I did need to install the 2.0 sdk at one point, since suddenly things just 'broke' on day when i turned on my computer. Probably an update did something? Anyway, I must target 2.0 for this solution, but I can't get the DLR assemblies to load unless I'm at 3.5. Can anyone foresee any reason why building IronPython from source targetted at 2.0 wouldn't solve this? On Thu, Jun 18, 2009 at 1:22 PM, Curt Hagenlocher wrote: > Are you getting an error when you run ipy.exe that tells you that SP1 is > needed? If not, then you already have it installed. IIRC, 2.0SP1 was pushed > out through Windows Update. > > On Thu, Jun 18, 2009 at 1:18 PM, Justin Regele wrote: > >> Yeah, I thought it was strange too. To be sure, I just downloaded the x64 >> .net 2.0 Sp1 installer again, ran it and here is the reason it errors: >> >> "This product is not supported on Vista Operating System". >> >> There you have it. >> I'm grabbing the x86 sp1 and going to see if that one works. >> >> On Thu, Jun 18, 2009 at 12:59 PM, Michael Foord < >> fuzzyman at voidspace.org.uk> wrote: >> >>> Justin Regele wrote: >>> >>>> This makes sense, although I am still confused as to why problems keep >>>> creeping up to me. I am on Vista, though, and so I think my problem is that >>>> while I installed 2.0, I cannot instal SP1. The server my code will run on >>>> is still on 2.0 until the new system is rolled out, which may be 6 months >>>> from now. >>>> >>>> I built all my IPy libs for 2.0, but when I added a C# project to wrap >>>> the embedded program and targetted 2.0 all the assemblies say they require >>>> 3.5. If I add them anyway, the Microsoft scripting assemblies can't be >>>> found. No such errors or warning about the IronPython assemblies, although >>>> I'm back to 'Python does not exist in the current context', even though I've >>>> got the assemblies loaded and using IronPython.Hosting. >>>> >>>> After trudging through this weirdness for a bit now, I'm realizing that >>>> the issue most likely comes from running a x64 version of Vista, while >>>> IronPython is in the x86 program files. >>>> >>> >>> IronPython is pure .NET code. It is independent of 32/64 bitness. >>> >>> It may be that to get .NET 2 SP1 on vista you actually need to install >>> .NET 3.5? Seems odd though. >>> >>> Michael >>> >>> >>>> I'm going to bulid IronPython from source for 2.0 and see if that fixes >>>> the problem. >>>> >>>> >>>> On Thu, Jun 18, 2009 at 7:00 AM, Lepisto, Stephen P < >>>> stephen.p.lepisto at intel.com > >>>> wrote: >>>> >>>> >From MSDN (http://msdn.microsoft.com/en-us/library/bb383796.aspx): >>>> >>>> "Differences Between .NET Framework Versions >>>> All three versions of the .NET Framework are based on version 2.0 >>>> of the CLR. The versions of the .NET Framework differ from each >>>> other in the list of assemblies that each makes available for you >>>> to reference in your projects. For example, LINQ is a new >>>> technology that is included in Visual Studio 2008. .NET Framework >>>> 3.5 is the only version of the .NET Framework that has >>>> LINQ-related assemblies. Therefore, you cannot use LINQ unless >>>> your project specifically targets .NET Framework 3.5. Similarly, >>>> Windows Presentation Foundation (WPF) is included in Windows >>>> Vista. You cannot build WPF applications unless your project >>>> targets .NET Framework 3.0 and later versions of the .NET Framework." >>>> >>>> In addition, .Net 3.0 changed the compiler to add support for >>>> lambdas in C#, although the resulting code can still run on .Net >>>> 2.0 runtime. The lambdas are converted to anonymous functions by >>>> the compiler. There may be other "syntactic sugar" changes as well. >>>> >>>> In Visual Studio, when you select the target runtime, you are >>>> primarily telling Visual Studio (and the underlying .Net compiler >>>> tools) to filter out elements from later versions of .Net. Of >>>> course, if you include a reference to a .Net 3.5 assembly, you >>>> have to make sure .Net 3.5 is installed on the target system. >>>> >>>> >>>> -----Original Message----- >>>> From: users-bounces at lists.ironpython.com >>>> >>>> [mailto:users-bounces at lists.ironpython.com >>>> ] On Behalf Of Michael >>>> Foord >>>> Sent: Thursday, June 18, 2009 4:49 AM >>>> To: Discussion of IronPython >>>> Subject: Re: [IronPython] clarification on current state of embedding >>>> >>>> Justin Regele wrote: >>>> > This brings up another question I've encountered. My >>>> understanding was >>>> > that IPy had problems with 3.5, and so I have been targeting >>>> 2.0. But >>>> > when I try to reference the IronPython and Microsoft.Scripting >>>> > assemblies, Visual Studio says I need 3.5 >>>> >>>> >>>> I've created many projects in Visual Studio referencing IronPython >>>> assemblies and targeting .NET 2.0. Which means I don't know what is >>>> wrong, but it *should* work fine... :-) >>>> >>>> Michael Foord >>>> > >>>> > >>>> > >>>> > On Wed, Jun 17, 2009 at 6:05 PM, Curt Hagenlocher >>>> > >>>> >> wrote: >>>> > >>>> > Good point! >>>> > >>>> > >>>> > On Wed, Jun 17, 2009 at 5:12 PM, Michael Foord >>>> > >>> >>>> >>> >> wrote: >>>> > >>>> > Curt Hagenlocher wrote: >>>> > >>>> > ...except through the hosting API *and through the >>>> new C# >>>> > dynamic functionality in .NET 4.0*. >>>> > >>>> > >>>> > And how do you get to the classes to use them with the new >>>> > dynamic functionality if it isn't through the hosting API? >>>> > >>>> > What you do with them once you get them is your own >>>> business >>>> > of course... >>>> > >>>> > Michael >>>> > >>>> > >>>> > On Wed, Jun 17, 2009 at 5:06 PM, Michael Foord >>>> > >>> >>>> > >>> > >>>> > >>> >>>> > >>> >>> wrote: >>>> > >>>> > Justin Regele wrote: >>>> > >>>> > What is the status of referencing IPy libraries >>>> > compiled to >>>> > dlls by other CLR languages? Google turned up >>>> that >>>> > as of 1.1 >>>> > you had to use the embedding/hosting api's, >>>> since >>>> > the dlls >>>> > were not compatible with say C# assemblies. >>>> There were >>>> > allusions made to this being changed. >>>> > >>>> > >>>> > You can't access Python classes except through the >>>> > hosting API. >>>> > There are no (public) plans for this to change >>>> anytime >>>> > soon. >>>> > >>>> > Michael >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> ------------------------------------------------------------------------ >>>> > >>>> > >>>> > >>>> > _______________________________________________ >>>> > 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/blog >>>> > >>>> > >>>> > >>>> > _______________________________________________ >>>> > Users mailing list >>>> > Users at lists.ironpython.com >>>> >>>> > >>> > >>>> > >>> >>>> > >>> >> >>>> > >>>> > >>>> > >>>> http://lists.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/blog >>>> > >>>> > >>>> > _______________________________________________ >>>> > Users mailing list >>>> > Users at lists.ironpython.com >>>> >>>> >>> > >>>> > >>>> http://lists.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/blog >>>> >>>> >>>> _______________________________________________ >>>> Users mailing list >>>> Users at lists.ironpython.com >>>> http://lists.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/blog >>> >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.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 jregele23 at gmail.com Thu Jun 18 22:35:51 2009 From: jregele23 at gmail.com (Justin Regele) Date: Thu, 18 Jun 2009 13:35:51 -0700 Subject: [IronPython] private functions within a module In-Reply-To: <4A36942E.7020906@voidspace.org.uk> References: <361073EA5313C84E95A847FF752AD9653D5033C69F@EA-EXMSG-C334.europe.corp.microsoft.com> <4A36942E.7020906@voidspace.org.uk> Message-ID: <8429660906181335t1b409a60rc1ad200a16a95945@mail.gmail.com> As of Python25, there is no thing as a 'private' method, although the _method() convention is what is generally used. also, staticmethod(objfunc) is used to make a method static. don't know if yo already know this. rather an annoying way of doing it. On Mon, Jun 15, 2009 at 11:34 AM, Michael Foord wrote: > Elise Langham (Elanit) wrote: > >> >> How can i define some functions within a module as private ? >> >> Do i need to make them part of a static class ? or is this this not >> possible? >> >> > The convention is to start their names with an underscore. That will tell > other developers not to call them directly. > > Michael > > Thanks, >> >> >> Elise >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> 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/blog > > > _______________________________________________ > 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 Thu Jun 18 22:38:29 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 18 Jun 2009 21:38:29 +0100 Subject: [IronPython] private functions within a module In-Reply-To: <8429660906181335t1b409a60rc1ad200a16a95945@mail.gmail.com> References: <361073EA5313C84E95A847FF752AD9653D5033C69F@EA-EXMSG-C334.europe.corp.microsoft.com> <4A36942E.7020906@voidspace.org.uk> <8429660906181335t1b409a60rc1ad200a16a95945@mail.gmail.com> Message-ID: <4A3AA5C5.8020909@voidspace.org.uk> Justin Regele wrote: > As of Python25, there is no thing as a 'private' method, although the > _method() convention is what is generally used. > > also, staticmethod(objfunc) is used to make a method static. don't > know if yo already know this. rather an annoying way of doing it. class Static(object): @staticmethod def method(): print 'this is a static method' Static.staticmethod() Not that you need them in Python - functions or class methods (@classmethod) are almost always better. Michael > > On Mon, Jun 15, 2009 at 11:34 AM, Michael Foord > > wrote: > > Elise Langham (Elanit) wrote: > > > How can i define some functions within a module as private ? > > Do i need to make them part of a static class ? or is this > this not possible? > > > The convention is to start their names with an underscore. That > will tell other developers not to call them directly. > > Michael > > Thanks, > > > Elise > > ------------------------------------------------------------------------ > > _______________________________________________ > 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/blog > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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/blog From jregele23 at gmail.com Thu Jun 18 23:07:43 2009 From: jregele23 at gmail.com (Justin Regele) Date: Thu, 18 Jun 2009 14:07:43 -0700 Subject: [IronPython] private functions within a module In-Reply-To: <4A3AA5C5.8020909@voidspace.org.uk> References: <361073EA5313C84E95A847FF752AD9653D5033C69F@EA-EXMSG-C334.europe.corp.microsoft.com> <4A36942E.7020906@voidspace.org.uk> <8429660906181335t1b409a60rc1ad200a16a95945@mail.gmail.com> <4A3AA5C5.8020909@voidspace.org.uk> Message-ID: <8429660906181407o7813284cw6a21a6268f4a0033@mail.gmail.com> hahaha. thanks michael. On Thu, Jun 18, 2009 at 1:38 PM, Michael Foord wrote: > Justin Regele wrote: > >> As of Python25, there is no thing as a 'private' method, although the >> _method() convention is what is generally used. >> >> also, staticmethod(objfunc) is used to make a method static. don't know if >> yo already know this. rather an annoying way of doing it. >> > > class Static(object): > > @staticmethod > def method(): > print 'this is a static method' > > Static.staticmethod() > > Not that you need them in Python - functions or class methods > (@classmethod) are almost always better. > > Michael > >> >> On Mon, Jun 15, 2009 at 11:34 AM, Michael Foord < >> fuzzyman at voidspace.org.uk > wrote: >> >> Elise Langham (Elanit) wrote: >> >> >> How can i define some functions within a module as private ? >> >> Do i need to make them part of a static class ? or is this >> this not possible? >> >> >> The convention is to start their names with an underscore. That >> will tell other developers not to call them directly. >> >> Michael >> >> Thanks, >> >> Elise >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> 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/blog >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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/blog > > > _______________________________________________ > 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 microsoft.com Thu Jun 18 23:01:47 2009 From: dinov at microsoft.com (Dino Viehland) Date: Thu, 18 Jun 2009 21:01:47 +0000 Subject: [IronPython] clarification on current state of embedding In-Reply-To: <8429660906181331v75bda818if7f46fe7a921c7a7@mail.gmail.com> References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> <4A398662.5030303@voidspace.org.uk> <8429660906171851p1d749f2cy1c9734e7df86efb3@mail.gmail.com> <4A3A29B0.1030802@voidspace.org.uk> <6AF28EB9F93A354894F2F3916DF6F96E0C75BB63B0@orsmsx510.amr.corp.intel.com> <8429660906181257o2bdf25cdp41ef9b51aed1bc1@mail.gmail.com> <4A3A9CB7.1080808@voidspace.org.uk> <8429660906181318m177659ccw358e6284564c7b72@mail.gmail.com> <8429660906181331v75bda818if7f46fe7a921c7a7@mail.gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD032EC0D4@TK5EX14MBXC118.redmond.corp.microsoft.com> Does everything basically work for you if you tell VS to build to target 3.5? What I expect you'll find is that you can just build and "target 3.5" and it'll all work on someone's machine w/ 2.0 installed. The important thing to watch out for is not adding references to assemblies that aren't available in 2.0 (such as System.Core.dll). But otherwise the underlying CLR and .NET framework is the same so it doesn't really matter which version you target. This is basically what we do when we build IronPython ourselves - our projects all have the tools version set to 3.5. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Justin Regele Sent: Thursday, June 18, 2009 1:31 PM To: Discussion of IronPython Subject: Re: [IronPython] clarification on current state of embedding No. I can run ipy.exe. I've successfully run embedded scripts, I've ported my python app to IPy in Visual Studio and worked through the needed modifications. I did need to install the 2.0 sdk at one point, since suddenly things just 'broke' on day when i turned on my computer. Probably an update did something? Anyway, I must target 2.0 for this solution, but I can't get the DLR assemblies to load unless I'm at 3.5. Can anyone foresee any reason why building IronPython from source targetted at 2.0 wouldn't solve this? On Thu, Jun 18, 2009 at 1:22 PM, Curt Hagenlocher > wrote: Are you getting an error when you run ipy.exe that tells you that SP1 is needed? If not, then you already have it installed. IIRC, 2.0SP1 was pushed out through Windows Update. On Thu, Jun 18, 2009 at 1:18 PM, Justin Regele > wrote: Yeah, I thought it was strange too. To be sure, I just downloaded the x64 .net 2.0 Sp1 installer again, ran it and here is the reason it errors: "This product is not supported on Vista Operating System". There you have it. I'm grabbing the x86 sp1 and going to see if that one works. On Thu, Jun 18, 2009 at 12:59 PM, Michael Foord > wrote: Justin Regele wrote: This makes sense, although I am still confused as to why problems keep creeping up to me. I am on Vista, though, and so I think my problem is that while I installed 2.0, I cannot instal SP1. The server my code will run on is still on 2.0 until the new system is rolled out, which may be 6 months from now. I built all my IPy libs for 2.0, but when I added a C# project to wrap the embedded program and targetted 2.0 all the assemblies say they require 3.5. If I add them anyway, the Microsoft scripting assemblies can't be found. No such errors or warning about the IronPython assemblies, although I'm back to 'Python does not exist in the current context', even though I've got the assemblies loaded and using IronPython.Hosting. After trudging through this weirdness for a bit now, I'm realizing that the issue most likely comes from running a x64 version of Vista, while IronPython is in the x86 program files. IronPython is pure .NET code. It is independent of 32/64 bitness. It may be that to get .NET 2 SP1 on vista you actually need to install .NET 3.5? Seems odd though. Michael I'm going to bulid IronPython from source for 2.0 and see if that fixes the problem. On Thu, Jun 18, 2009 at 7:00 AM, Lepisto, Stephen P >> wrote: >From MSDN (http://msdn.microsoft.com/en-us/library/bb383796.aspx): "Differences Between .NET Framework Versions All three versions of the .NET Framework are based on version 2.0 of the CLR. The versions of the .NET Framework differ from each other in the list of assemblies that each makes available for you to reference in your projects. For example, LINQ is a new technology that is included in Visual Studio 2008. .NET Framework 3.5 is the only version of the .NET Framework that has LINQ-related assemblies. Therefore, you cannot use LINQ unless your project specifically targets .NET Framework 3.5. Similarly, Windows Presentation Foundation (WPF) is included in Windows Vista. You cannot build WPF applications unless your project targets .NET Framework 3.0 and later versions of the .NET Framework." In addition, .Net 3.0 changed the compiler to add support for lambdas in C#, although the resulting code can still run on .Net 2.0 runtime. The lambdas are converted to anonymous functions by the compiler. There may be other "syntactic sugar" changes as well. In Visual Studio, when you select the target runtime, you are primarily telling Visual Studio (and the underlying .Net compiler tools) to filter out elements from later versions of .Net. Of course, if you include a reference to a .Net 3.5 assembly, you have to make sure .Net 3.5 is installed on the target system. -----Original Message----- From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com >] On Behalf Of Michael Foord Sent: Thursday, June 18, 2009 4:49 AM To: Discussion of IronPython Subject: Re: [IronPython] clarification on current state of embedding Justin Regele wrote: > This brings up another question I've encountered. My understanding was > that IPy had problems with 3.5, and so I have been targeting 2.0. But > when I try to reference the IronPython and Microsoft.Scripting > assemblies, Visual Studio says I need 3.5 I've created many projects in Visual Studio referencing IronPython assemblies and targeting .NET 2.0. Which means I don't know what is wrong, but it *should* work fine... :-) Michael Foord > > > > On Wed, Jun 17, 2009 at 6:05 PM, Curt Hagenlocher > > >>> wrote: > > Good point! > > > On Wed, Jun 17, 2009 at 5:12 PM, Michael Foord > > >>> wrote: > > Curt Hagenlocher wrote: > > ...except through the hosting API *and through the new C# > dynamic functionality in .NET 4.0*. > > > And how do you get to the classes to use them with the new > dynamic functionality if it isn't through the hosting API? > > What you do with them once you get them is your own business > of course... > > Michael > > > On Wed, Jun 17, 2009 at 5:06 PM, Michael Foord > > > >> > > > >>>> wrote: > > Justin Regele wrote: > > What is the status of referencing IPy libraries > compiled to > dlls by other CLR languages? Google turned up that > as of 1.1 > you had to use the embedding/hosting api's, since > the dlls > were not compatible with say C# assemblies. There were > allusions made to this being changed. > > > You can't access Python classes except through the > hosting API. > There are no (public) plans for this to change anytime > soon. > > Michael > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > 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/blog > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > > >> > > > >>> > > > http://lists.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/blog > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > >> > http://lists.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/blog _______________________________________________ Users mailing list Users at lists.ironpython.com > http://lists.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/blog _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.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 dfugate at microsoft.com Fri Jun 19 00:16:41 2009 From: dfugate at microsoft.com (Dave Fugate) Date: Thu, 18 Jun 2009 15:16:41 -0700 Subject: [IronPython] clarification on current state of embedding In-Reply-To: <8429660906181318m177659ccw358e6284564c7b72@mail.gmail.com> References: <8429660906171645i12c45c3crb95937282d72af98@mail.gmail.com> <4A3984F0.5080907@voidspace.org.uk> <4A398662.5030303@voidspace.org.uk> <8429660906171851p1d749f2cy1c9734e7df86efb3@mail.gmail.com> <4A3A29B0.1030802@voidspace.org.uk> <6AF28EB9F93A354894F2F3916DF6F96E0C75BB63B0@orsmsx510.amr.corp.intel.com> <8429660906181257o2bdf25cdp41ef9b51aed1bc1@mail.gmail.com> <4A3A9CB7.1080808@voidspace.org.uk> <8429660906181318m177659ccw358e6284564c7b72@mail.gmail.com> Message-ID: .NET 2.0 was never released for Vista (which came with .NET 3.0). This is why you're unable to install .NET 2.0 SP1 on Vista. Furthermore, there was never a .NET 3.0 SP1 release for Vista...only .NET 3.5 which includes the .NET 2.0 SP1 changes and you can download this from here - http://www.microsoft.com/downloads/details.aspx?familyid=333325FD-AE52-4E35-B531-508D977D32A6&displaylang=en. The minimum .NET version for Vista/Server 2008 is .NET 3.5 to run IronPython 2.0 (or 2.6 for that matter). Dave From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Justin Regele Sent: Thursday, June 18, 2009 1:19 PM To: Discussion of IronPython Subject: Re: [IronPython] clarification on current state of embedding Yeah, I thought it was strange too. To be sure, I just downloaded the x64 .net 2.0 Sp1 installer again, ran it and here is the reason it errors: "This product is not supported on Vista Operating System". There you have it. I'm grabbing the x86 sp1 and going to see if that one works. On Thu, Jun 18, 2009 at 12:59 PM, Michael Foord > wrote: Justin Regele wrote: This makes sense, although I am still confused as to why problems keep creeping up to me. I am on Vista, though, and so I think my problem is that while I installed 2.0, I cannot instal SP1. The server my code will run on is still on 2.0 until the new system is rolled out, which may be 6 months from now. I built all my IPy libs for 2.0, but when I added a C# project to wrap the embedded program and targetted 2.0 all the assemblies say they require 3.5. If I add them anyway, the Microsoft scripting assemblies can't be found. No such errors or warning about the IronPython assemblies, although I'm back to 'Python does not exist in the current context', even though I've got the assemblies loaded and using IronPython.Hosting. After trudging through this weirdness for a bit now, I'm realizing that the issue most likely comes from running a x64 version of Vista, while IronPython is in the x86 program files. IronPython is pure .NET code. It is independent of 32/64 bitness. It may be that to get .NET 2 SP1 on vista you actually need to install .NET 3.5? Seems odd though. Michael I'm going to bulid IronPython from source for 2.0 and see if that fixes the problem. On Thu, Jun 18, 2009 at 7:00 AM, Lepisto, Stephen P >> wrote: >From MSDN (http://msdn.microsoft.com/en-us/library/bb383796.aspx): "Differences Between .NET Framework Versions All three versions of the .NET Framework are based on version 2.0 of the CLR. The versions of the .NET Framework differ from each other in the list of assemblies that each makes available for you to reference in your projects. For example, LINQ is a new technology that is included in Visual Studio 2008. .NET Framework 3.5 is the only version of the .NET Framework that has LINQ-related assemblies. Therefore, you cannot use LINQ unless your project specifically targets .NET Framework 3.5. Similarly, Windows Presentation Foundation (WPF) is included in Windows Vista. You cannot build WPF applications unless your project targets .NET Framework 3.0 and later versions of the .NET Framework." In addition, .Net 3.0 changed the compiler to add support for lambdas in C#, although the resulting code can still run on .Net 2.0 runtime. The lambdas are converted to anonymous functions by the compiler. There may be other "syntactic sugar" changes as well. In Visual Studio, when you select the target runtime, you are primarily telling Visual Studio (and the underlying .Net compiler tools) to filter out elements from later versions of .Net. Of course, if you include a reference to a .Net 3.5 assembly, you have to make sure .Net 3.5 is installed on the target system. -----Original Message----- From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com >] On Behalf Of Michael Foord Sent: Thursday, June 18, 2009 4:49 AM To: Discussion of IronPython Subject: Re: [IronPython] clarification on current state of embedding Justin Regele wrote: > This brings up another question I've encountered. My understanding was > that IPy had problems with 3.5, and so I have been targeting 2.0. But > when I try to reference the IronPython and Microsoft.Scripting > assemblies, Visual Studio says I need 3.5 I've created many projects in Visual Studio referencing IronPython assemblies and targeting .NET 2.0. Which means I don't know what is wrong, but it *should* work fine... :-) Michael Foord > > > > On Wed, Jun 17, 2009 at 6:05 PM, Curt Hagenlocher > > >>> wrote: > > Good point! > > > On Wed, Jun 17, 2009 at 5:12 PM, Michael Foord > > >>> wrote: > > Curt Hagenlocher wrote: > > ...except through the hosting API *and through the new C# > dynamic functionality in .NET 4.0*. > > > And how do you get to the classes to use them with the new > dynamic functionality if it isn't through the hosting API? > > What you do with them once you get them is your own business > of course... > > Michael > > > On Wed, Jun 17, 2009 at 5:06 PM, Michael Foord > > > >> > > > >>>> wrote: > > Justin Regele wrote: > > What is the status of referencing IPy libraries > compiled to > dlls by other CLR languages? Google turned up that > as of 1.1 > you had to use the embedding/hosting api's, since > the dlls > were not compatible with say C# assemblies. There were > allusions made to this being changed. > > > You can't access Python classes except through the > hosting API. > There are no (public) plans for this to change anytime > soon. > > Michael > > > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > 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/blog > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > > >> > > > >>> > > > http://lists.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/blog > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > >> > http://lists.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/blog _______________________________________________ Users mailing list Users at lists.ironpython.com > http://lists.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/blog _______________________________________________ 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 Fri Jun 19 00:35:27 2009 From: Shri.Borde at microsoft.com (Shri Borde) Date: Thu, 18 Jun 2009 15:35:27 -0700 Subject: [IronPython] Ironpython & COM vs Jscript.Net & COM In-Reply-To: References: Message-ID: <710DF26F214D2B4BB94287123FFE980A2E209111EF@NA-EXMSG-C104.redmond.corp.microsoft.com> IronPython 2.0 supports dynamic COM servers. See http://blogs.msdn.com/shrib/archive/2008/07/30/idispatch-support-on-in-ironpython-beta-4.aspx -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michel Claveau Sent: Wednesday, June 17, 2009 7:22 AM To: users at lists.ironpython.com Subject: [IronPython] Ironpython & COM vs Jscript.Net & COM Hi! IronPython has poor support of COM techno. In particular, IP can not use dynamic COM servers (perhaps because they do not have TLB?). Now, cPython is good to create dynamic COM servers (see Python Programming on Win32, page 219 & +). Thus, ironPython is bad, to use the COM servers made with cPython. But... Recently, I had a look on Jscript.Net (NOT managed_JScript). I found that this language uses dynamic type (as Python), and can use dynamic COM servers! (and without DLR!!!) Example: var pd = new ActiveXObject("Ponxd.Mci"); var result = pd.myfuncsinverse('AABBCC'); IronPython could use the mechanics of JScript.Net, for COM servers? It would solve many problems. @+ -- Michel Claveau (sorry for my bad English) _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From sanxiyn at gmail.com Fri Jun 19 08:37:29 2009 From: sanxiyn at gmail.com (Seo Sanghyeon) Date: Fri, 19 Jun 2009 15:37:29 +0900 Subject: [IronPython] Twisted on IronPython Message-ID: <5b0248170906182337l549e4166gff25edb60c105e6a@mail.gmail.com> I have started porting Twisted to IronPython. Progress is to be tracked on this Trac ticket: http://twistedmatrix.com/trac/ticket/3882 Buildbot is up: http://buildbot.twistedmatrix.com/builders/ubuntu32-ironpython Just in case you don't know, Twisted is an event-driven networking engine written in Python licensed under MIT license, which aims to destroy the American currency system. See following links for more details. http://twistedmatrix.com/ http://isometric.sixsided.org/_/twisted_plutonium/ -- Seo Sanghyeon From thibaut.barrere at gmail.com Fri Jun 19 09:37:14 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Fri, 19 Jun 2009 09:37:14 +0200 Subject: [IronPython] Importing .py files embedded as resources (from Silverlight) Message-ID: <4a68b8cf0906190037n7e974dd6u5fa662d495ac2dde@mail.gmail.com> Hello, this is my first post here, so hi! I'm currently porting some IronPython library I'd like to use from a C# or IronRuby Silverlight app. For that purpose, I'm creating a Silverlight C# library which embeds all the required .py files and try to compile/execute them at runtime. Is there a built-in way of telling the IronPython engine that some resources are embedded in the dll ? Maybe some hooks to detect imports and return the stream of content for a given .py file ? The IronPython library has multiple subfolders on several levels, for increased fun. Should I iterate over all the available files and execute them in the same scope ? Thanks for any insight when dealing with that kind of scenario, cheers, -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Fri Jun 19 12:55:02 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Fri, 19 Jun 2009 10:55:02 +0000 Subject: [IronPython] Importing .py files embedded as resources (from Silverlight) In-Reply-To: <4a68b8cf0906190037n7e974dd6u5fa662d495ac2dde@mail.gmail.com> References: <4a68b8cf0906190037n7e974dd6u5fa662d495ac2dde@mail.gmail.com> Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC18AE8ED8@tk5ex14mbxc106.redmond.corp.microsoft.com> No special support; you'll have to iterate over all the files as resources, get their contents, and do the following: var scope = scriptEngine.CreateScope(); scriptEngine.CreateScriptSourceFromString(code).Execute(scope); Though, why not just put the python files in the XAP? Then importing will just work, since the engine knows how to look in the XAP. If you're really hellbent on having them as resources, you could built a custom version of Microsoft.Scripting.Silverlight.BrowserPAL to look for files as embedded resources. ~js ________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] on behalf of Thibaut Barr?re [thibaut.barrere at gmail.com] Sent: Friday, June 19, 2009 12:37 AM To: users at lists.ironpython.com Subject: [IronPython] Importing .py files embedded as resources (from Silverlight) Hello, this is my first post here, so hi! I'm currently porting some IronPython library I'd like to use from a C# or IronRuby Silverlight app. For that purpose, I'm creating a Silverlight C# library which embeds all the required .py files and try to compile/execute them at runtime. Is there a built-in way of telling the IronPython engine that some resources are embedded in the dll ? Maybe some hooks to detect imports and return the stream of content for a given .py file ? The IronPython library has multiple subfolders on several levels, for increased fun. Should I iterate over all the available files and execute them in the same scope ? Thanks for any insight when dealing with that kind of scenario, cheers, -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From thibaut.barrere at gmail.com Fri Jun 19 13:02:36 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Fri, 19 Jun 2009 13:02:36 +0200 Subject: [IronPython] Importing .py files embedded as resources (from Silverlight) In-Reply-To: <0047ECBFA2E0DF4A834AA369282A5AFC18AE8ED8@tk5ex14mbxc106.redmond.corp.microsoft.com> References: <4a68b8cf0906190037n7e974dd6u5fa662d495ac2dde@mail.gmail.com> <0047ECBFA2E0DF4A834AA369282A5AFC18AE8ED8@tk5ex14mbxc106.redmond.corp.microsoft.com> Message-ID: <4a68b8cf0906190402m469d6652yddf0040ed23ad89@mail.gmail.com> Hi Jimmy, > No special support; you'll have to iterate over all the files as resources, > get their contents, and do the following: > > var scope = scriptEngine.CreateScope(); > scriptEngine.CreateScriptSourceFromString(code).Execute(scope); > > Though, why not just put the python files in the XAP? Then importing will > just work, since the engine knows how to look in the XAP. If you're really > hellbent on having them as resources, you could built a custom version of > Microsoft.Scripting.Silverlight.BrowserPAL to look for files as embedded > resources. > I just had a chat with Ivan and he suggested the same idea. For some reason I thought that it would be hard to mix .py and .rb directly, but the dlrconsole sample does that, it seems. So I'm going to follow that advice and put the .py files into the XAP, and let the engine do the job. I still have one question then: if the main app file is a Ruby one, how can I call the Python function from there ? -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Fri Jun 19 13:09:58 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Fri, 19 Jun 2009 11:09:58 +0000 Subject: [IronPython] Importing .py files embedded as resources (from Silverlight) Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC18AE8F6D@tk5ex14mbxc106.redmond.corp.microsoft.com> You can execute Python code from Ruby in 2 ways: 1. Use the Hosting API from Ruby. I have a "python.rb" lying around that I usually use which demonstrates what to do: http://gist.github.com/132558 (this one is for Silverlight, line 10 will have to be slightly changed for the Desktop). 2. Use the DLR language interop. Read Tomas' blogpost about it: http://blog.tomasm.net/2009/04/15/python-says-hello-to-ruby/ ~js From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Thibaut Barr?re Sent: Friday, June 19, 2009 4:03 AM To: Discussion of IronPython Subject: Re: [IronPython] Importing .py files embedded as resources (from Silverlight) Hi Jimmy, No special support; you'll have to iterate over all the files as resources, get their contents, and do the following: var scope = scriptEngine.CreateScope(); scriptEngine.CreateScriptSourceFromString(code).Execute(scope); Though, why not just put the python files in the XAP? Then importing will just work, since the engine knows how to look in the XAP. If you're really hellbent on having them as resources, you could built a custom version of Microsoft.Scripting.Silverlight.BrowserPAL to look for files as embedded resources. I just had a chat with Ivan and he suggested the same idea. For some reason I thought that it would be hard to mix .py and .rb directly, but the dlrconsole sample does that, it seems. So I'm going to follow that advice and put the .py files into the XAP, and let the engine do the job. I still have one question then: if the main app file is a Ruby one, how can I call the Python function from there ? -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From merllab at microsoft.com Fri Jun 19 17:53:06 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Fri, 19 Jun 2009 08:53:06 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/55104. ADDED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/CollectionUtils.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/CompilerServices $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/CompilerServices/DebugLambdaInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/CompilerServices/IDebugCompilerSupport.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugContext.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugContext.GeneratorLoopProc.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugFrame.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebuggableLambdaBuilder.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugGenerator.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugInfoRewriter.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugMode.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugSourceFile.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugSourceSpan.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugThread.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DefaultRuntimeVariablesImpl $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DefaultRuntimeVariablesImpl/DebugRuntimeVariables.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DefaultRuntimeVariablesImpl/DefaultDebugThread.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DefaultRuntimeVariablesImpl/DefaultDebugThreadFactory.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DelegateHelpers.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/ForceToGeneratorLoopException.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/FunctionInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/IDebugCallback.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/InvokeTargets.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/LambdaWalker.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/Microsoft.Scripting.Debugging.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/Microsoft.Scripting.Debugging.Generated.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/Microsoft.Scripting.Debugging.txt $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/RuntimeOps.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/RuntimeVariablesSupport $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/RuntimeVariablesSupport/IDebugRuntimeVariables.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/RuntimeVariablesSupport/IDebugThreadFactory.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/ScopedRuntimeVariables.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/ThreadLocal.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/TraceEventKind.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/TracePipeline $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/TracePipeline/ITraceCallback.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/TracePipeline/ITracePipeline.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/TracePipeline/TracePipeline.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/VariableInfo.cs MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/AssemblyInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/CollectionUtils.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/CompilerServices/DebugLambdaInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/CompilerServices/IDebugCompilerSupport.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugContext.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugContext.GeneratorLoopProc.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugFrame.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebuggableLambdaBuilder.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugGenerator.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugInfoRewriter.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugMode.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugSourceFile.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugSourceSpan.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DebugThread.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DefaultRuntimeVariablesImpl/DebugRuntimeVariables.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DefaultRuntimeVariablesImpl/DefaultDebugThread.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DefaultRuntimeVariablesImpl/DefaultDebugThreadFactory.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/DelegateHelpers.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/ForceToGeneratorLoopException.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/LambdaCompiler.Logical.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Stubs.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/ConstantCheck.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs $/IronPython/IronPython_Main/Src/IronPython/IronPython.csproj $/IronPython/IronPython_Main/Src/IronPython.sln $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/FunctionInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/IDebugCallback.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/InvokeTargets.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/LambdaWalker.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/Microsoft.Scripting.Debugging.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/Microsoft.Scripting.Debugging.Generated.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/Microsoft.Scripting.Debugging.txt $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/RuntimeOps.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/RuntimeVariablesSupport/IDebugRuntimeVariables.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/RuntimeVariablesSupport/IDebugThreadFactory.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/ScopedRuntimeVariables.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/ThreadLocal.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/TraceEventKind.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/TracePipeline/ITraceCallback.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/TracePipeline/ITracePipeline.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/TracePipeline/TracePipeline.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Debugging/VariableInfo.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Generation/ILGen.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Utils/TypeUtils.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Interpreter/LightCompiler.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Interpreter/Instruction.cs $/IronPython/IronPython_Main/Src/Tests/test_cliclass.py $/IronPython/IronPython_Main/Src/Tests/test_excinfo.py $/IronPython/IronPython_Main/Src/Tests/test_interactive.py $/IronPython/IronPython_Main/Src/Tests/test_file.py $/IronPython/IronPython_Main/Src/Tests/test_cPickle.py $/IronPython/IronPython_Main/Src/Tests/test_with.py $/IronPython/IronPython_Main/Src/Tests/versions/python26.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 953764 Date: 6/18/2009 7:04:29 PM (dinov) Adds the in-proc debugging support that Igor as been working on. This adds a new DLL to the IronPython MSI and to the IronPython and DLR CodePlex releases. This is just adding their source code and updating our build and packaging infrastructure to include their new DLL. The only changes to their code were some #ifdef?s to support Silverlight builds and some updates to the .csproj files to support our numerous builds. This code is owned by them and has been reviewed by their team so I?m not looking for a code review for the new DLL. Once this is in I?ll be updating Igor?s prototype for sys.settrace support for IronPython and adding that. (Shelveset: DlrDebuggingSupport;REDMOND\dinov | SNAP CheckinId: 8745) -------------------------------------------------------------------------------- Changeset Id: 953557 Date: 6/18/2009 4:59:35 PM (dfugate) - versions.python26: PEP 3110 has been implemented - versions.python26: added test for PEP 3112. Not fixed - test_abc.py: IP can run more of test_isinstance_class than CPy can? - versions.python26: http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=19546 has been implemented, but not correctly - see http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=23143 (Shelveset: CP63;REDMOND\dfugate | SNAP CheckinId: m9510) -------------------------------------------------------------------------------- Changeset Id: 952577 Date: 6/18/2009 9:02:18 AM (dfugate) - http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=19534. Feature correctly implemented and tests added - test_interactive.py was disabled when run with the CPython 2.6 stdlib => this test hasn't been running in the Main SNAP Q for some time! Fixed - http://ironpython.codeplex.com/WorkItem/View.aspx?WorkItemId=23132. New print function bug - enabled CPython's test_print.py in SNAP (Shelveset: CP62;REDMOND\dfugate | SNAP CheckinId: 8728) From sanxiyn at gmail.com Fri Jun 19 18:37:43 2009 From: sanxiyn at gmail.com (Seo Sanghyeon) Date: Sat, 20 Jun 2009 01:37:43 +0900 Subject: [IronPython] IronPython 2.6 CodePlex Source Update In-Reply-To: References: Message-ID: <5b0248170906190937u15df7563w4b4e328af2be1e22@mail.gmail.com> 2009/6/20 : > Once this is in I?ll be updating Igor?s prototype for sys.settrace support for IronPython and adding that. This is exciting. -- Seo Sanghyeon From thibaut.barrere at gmail.com Fri Jun 19 22:53:15 2009 From: thibaut.barrere at gmail.com (=?ISO-8859-1?Q?Thibaut_Barr=E8re?=) Date: Fri, 19 Jun 2009 22:53:15 +0200 Subject: [IronPython] Importing .py files embedded as resources (from Silverlight) In-Reply-To: <0047ECBFA2E0DF4A834AA369282A5AFC18AE8F6D@tk5ex14mbxc106.redmond.corp.microsoft.com> References: <0047ECBFA2E0DF4A834AA369282A5AFC18AE8F6D@tk5ex14mbxc106.redmond.corp.microsoft.com> Message-ID: <4a68b8cf0906191353l34611629lda899b2fa95d44b8@mail.gmail.com> > > Use the Hosting API from Ruby. I have a ?python.rb? lying around > that I usually use which demonstrates what to do: > http://gist.github.com/132558 (this one is for Silverlight, line 10 will > have to be slightly changed for the Desktop). > I used that and after a bit of tweaking I got what I need. Thanks! -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: From empirebuilder at gmail.com Sat Jun 20 11:24:36 2009 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Sat, 20 Jun 2009 12:24:36 +0300 Subject: [IronPython] DLR based Javascript Implementation Message-ID: <8cd017b80906200224l182750fey57ee1c9d660892f@mail.gmail.com> http://www.remobjects.com/roscript.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Sat Jun 20 16:03:09 2009 From: slide.o.mix at gmail.com (Slide) Date: Sat, 20 Jun 2009 07:03:09 -0700 Subject: [IronPython] DLR based Javascript Implementation In-Reply-To: <8cd017b80906200224l182750fey57ee1c9d660892f@mail.gmail.com> References: <8cd017b80906200224l182750fey57ee1c9d660892f@mail.gmail.com> Message-ID: Someone posted this one before, I just can't seem to find the compiler to compile the roscript :-) I believe it is the Oxygene compiler I need, but I can't find a good download location. On Sat, Jun 20, 2009 at 2:24 AM, Dody Gunawinata wrote: > http://www.remobjects.com/roscript.aspx > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- slide-o-blog http://slide-o-blog.blogspot.com/ From empirebuilder at gmail.com Sun Jun 21 10:38:12 2009 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Sun, 21 Jun 2009 11:38:12 +0300 Subject: [IronPython] DLR based Javascript Implementation In-Reply-To: References: <8cd017b80906200224l182750fey57ee1c9d660892f@mail.gmail.com> Message-ID: <8cd017b80906210138v39fd493dte2329d9518e5192a@mail.gmail.com> I'm asking the dev to publish a build. I'll update once they have one. Dody G. On Sat, Jun 20, 2009 at 5:03 PM, Slide wrote: > Someone posted this one before, I just can't seem to find the compiler > to compile the roscript :-) I believe it is the Oxygene compiler I > need, but I can't find a good download location. > > On Sat, Jun 20, 2009 at 2:24 AM, Dody Gunawinata > wrote: > > http://www.remobjects.com/roscript.aspx > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > -- > slide-o-blog > http://slide-o-blog.blogspot.com/ > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From empirebuilder at gmail.com Sun Jun 21 11:16:35 2009 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Sun, 21 Jun 2009 12:16:35 +0300 Subject: [IronPython] DLR based Javascript Implementation In-Reply-To: <8cd017b80906210138v39fd493dte2329d9518e5192a@mail.gmail.com> References: <8cd017b80906200224l182750fey57ee1c9d660892f@mail.gmail.com> <8cd017b80906210138v39fd493dte2329d9518e5192a@mail.gmail.com> Message-ID: <8cd017b80906210216t1d70bbd4xf187e3596c539e13@mail.gmail.com> The build is up. This is the email from the one of the dev. " Of course. I've uploaded a build, with compatible DLR dlls to the http://code.remobjects.com/p/roscript/downloads/ page. Note that the Delphi Prism compiler itself can be freely downloaded (command line edition), should you want to change/recompile the code yourself. http://downloads.embarcadero.com/free/delphi_prism" On Sun, Jun 21, 2009 at 11:38 AM, Dody Gunawinata wrote: > I'm asking the dev to publish a build. I'll update once they have one. > Dody G. > > On Sat, Jun 20, 2009 at 5:03 PM, Slide wrote: > >> Someone posted this one before, I just can't seem to find the compiler >> to compile the roscript :-) I believe it is the Oxygene compiler I >> need, but I can't find a good download location. >> >> On Sat, Jun 20, 2009 at 2:24 AM, Dody Gunawinata >> wrote: >> > http://www.remobjects.com/roscript.aspx >> > >> > _______________________________________________ >> > Users mailing list >> > Users at lists.ironpython.com >> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > >> > >> >> >> >> -- >> slide-o-blog >> http://slide-o-blog.blogspot.com/ >> > > > > -- > nomadlife.org > > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.segal at bigpond.com Mon Jun 22 15:34:44 2009 From: simon.segal at bigpond.com (Simon Segal) Date: Mon, 22 Jun 2009 23:34:44 +1000 Subject: [IronPython] passing arguments to c# params Message-ID: <001e01c9f33e$340ba4b0$9c22ee10$@segal@bigpond.com> Hi I have a C# method that takes a params as an argument like this: public void methodname(params IEvent[] messages){....} When calling this method from IronPyton I get the following error: methodname takes at least 2147483647 arguments (1 given) I have tried calling the method with a single IEvent and with an array eg. methodname(msg, msg) Publish() takes at least 2147483647 arguments (2 given) I should also mention that it's an overloaded method. Thanks, Simon Segal Email: simon.segal at bigpond.com Web Site: http://www.simonsegal.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From merllab at microsoft.com Mon Jun 22 17:53:19 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Mon, 22 Jun 2009 08:53:19 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <790db4dd-7f91-4d76-b649-f4ccafc87cfc@tk5-exsmh-c102.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/55281. ADDED SOURCES $/IronPython/IronPython_Main/Src/IronPython.Modules/_bytesio.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/_fileio.cs MODIFIED SOURCES $/IronPython/IronPython_Main/Src/IronPython.Modules/_bytesio.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/_fileio.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/_collections.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/array.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/BytesConversionAttribute.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonOverloadResolver.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/ByteOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/ByteArray.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Bytes.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonOperationBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonProtocol.Operations.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonProtocol.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/MetaUserObject.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/ConversionBinder.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/List.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Builtin.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Enumerate.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/socket.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/IronPython.Modules.csproj $/IronPython/IronPython_Main/Src/IronPython.Modules/codecs.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/IListOfByteOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonTypeOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonTuple.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/IntOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/StringOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/InstanceOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonFile.cs $/IronPython/IronPython_Main/Src/Tests/test_bytes.py $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/TypeInfo.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/XRange.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Set.cs $/IronPython/IronPython_Main/Src/Tests/test_dict.py $/IronPython/IronPython_Main/Src/Tests/versions/python26.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 955031 Date: 6/19/2009 1:41:22 PM (dfugate) - test_builtin.py - enabled regression for passing through SystemExit/KeyboardInterrupt exceptions from hasattr - test_descr.py - Merlin 315746 has been partially fixed - python26.py - CodePlex 19555 not really fixed (Shelveset: CP64;REDMOND\dfugate | SNAP CheckinId: 8750) From merllab at microsoft.com Tue Jun 23 17:53:06 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Tue, 23 Jun 2009 08:53:06 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <235b8996-6b5c-484b-ae8a-6fb26e24a9ec@tk5-exsmh-c102.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/55405. ADDED SOURCES $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/XapHttpHandler.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/agdlr.css $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/agdlr.js $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/Extension.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/Repl.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/Window.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/_codecs.cs $/IronPython/IronPython_Main/Src/IronPythonConsoleAny $/IronPython/IronPython_Main/Src/IronPythonConsoleAny/IronPythonConsoleAny.csproj $/IronPython/IronPython_Main/Src/IronPythonWindowAny $/IronPython/IronPython_Main/Src/IronPythonWindowAny/IronPythonWindowAny.csproj DELETED SOURCES $/IronPython/IronPython_Main/Src/IronPython.Modules/codecs.cs MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/XapHttpHandler.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/agdlr.css $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/agdlr.js $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/Extension.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/Repl.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/Window.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/_codecs.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Zip.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/Configuration.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/Package.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/App.config $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/Microsoft.Scripting.Silverlight.csproj $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/ErrorFormatter.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/XapBuilder.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/DynamicApplication.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/SilverlightVersion.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Chiron.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/BrowserPAL.cs $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Chiron.csproj $/IronPython/IronPython_Main/Src/IronPython.Modules/_collections.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/array.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/thread.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/nt.cs $/IronPython/IronPython_Main/Src/IronPython.Modules/IronPython.Modules.csproj $/IronPython/IronPython_Main/Src/IronPython.sln $/IronPython/IronPython_Main/Src/IronPythonConsoleAny/IronPythonConsoleAny.csproj $/IronPython/IronPython_Main/Src/IronPython/Runtime/NullImporter.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonProtocol.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Exceptions/PythonExceptions.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/PythonType.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonTypeOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonAsciiEncoding.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/PythonOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/StringOps.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/LiteralParser.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/Slice.cs $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonContext.cs $/IronPython/IronPython_Main/Src/IronPythonWindow/IronPythonWindow.csproj $/IronPython/IronPython_Main/Src/IronPythonTest/InheritTest.cs $/IronPython/IronPython_Main/Src/IronPythonConsole/IronPythonConsole.csproj $/IronPython/IronPython_Main/Src/IronPythonWindowAny/IronPythonWindowAny.csproj $/IronPython/IronPython_Main/Src/Tests/test_imp.py $/IronPython/IronPython_Main/Src/Tests/test_generator.py $/IronPython/IronPython_Main/Src/Tests/test_codecs.py $/IronPython/IronPython_Main/Src/Tests/test_cliclass.py $/IronPython/IronPython_Main/Src/Tests/test_class.py $/IronPython/IronPython_Main/Src/Tests/test_array.py $/IronPython/IronPython_Main/Src/Tests/test_nt.py $/IronPython/IronPython_Main/Src/Tests/test_slice.py $/IronPython/IronPython_Main/Src/Tests/test_python25.py $/IronPython/IronPython_Main/Src/Tests/test_interactive.py $/IronPython/IronPython_Main/Src/Tests/test_thread.py $/IronPython/IronPython_Main/Src/Tests/versions/python26.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 957381 Date: 6/22/2009 10:54:19 AM (dfugate) More CPython 2.6 feature work testing. (Shelveset: CP65;REDMOND\dfugate | SNAP CheckinId: m9534) -------------------------------------------------------------------------------- Changeset Id: 957377 Date: 6/22/2009 10:53:19 AM (dinov) 22744 1 High _codecs.charmap_decode('') should return a tuple 22740 1 High Return value of _codecs.charmap_encode should be a tuple 22746 1 High Exceptions in threads are sent to stdout instead of stderror 10646 2 Low startswith/endswith methods of string do not throw TypeError w/ bad parameters 22733 1 High nt.waitpid broken 22732 1 Low "nt.waitpid(bad, params)" should throw OSError, not ValueError 22723 2 Medium IsFamily and IsFamilyOrAssembly error 18637 2 Medium Source code encoding is not work correctly 20908 1 Medium Stack overflow when piclking slice objects 20909 1 Medium IPy crashes with StackOverflowException rather than raising RuntimeError 19215 1 Medium array.array('u', u"...") broken 19216 1 Medium array.array('I', "...") broken 19217 1 Medium array.array('l', "...") broken 18939 1 Medium A deque item that mutates the deque in its __eq__ ought to throw an IndexError IronPython\2.6 19705 1 Medium CLR Dictionary iterator bug 22742 1 Medium _codecs.escape_decode should support two parameters 22743 1 Medium _codecs.escape_decode("\\\a") broken 22471 Invalid mapping dict parameter passed to _codecs.charmap_encode(..., mapping_dict) should throw UnicodeEncodeError 22738 _codecs.charmap_encode takes 1-3 parameters (not exactly 3) Fixing __str__ on EnvironmentError ? it needs to format the exception and put in the [Errno #] text. type.__module__ a data descriptor so that type(someFunction).__module__ works correctly (Shelveset: 26Beta2Bugs2Final;REDMOND\dinov | SNAP CheckinId: m9534) -------------------------------------------------------------------------------- Changeset Id: 957310 Date: 6/22/2009 10:08:19 AM (dinov) Changes ipy.exe/ipyw.exe to be 32-bit only applications. Adds a new ipy64.exe/ipyw64.exe which is a platform neutral assembly. Updates the MSI so that both versions are installed on a 64-bit machine and only ipy.exe is installed on a 32-bit machine. (Shelveset: 3264ipyFinal;REDMOND\dinov | SNAP CheckinId: 8763) From dinov at microsoft.com Tue Jun 23 22:21:10 2009 From: dinov at microsoft.com (Dino Viehland) Date: Tue, 23 Jun 2009 20:21:10 +0000 Subject: [IronPython] __module__ of FunctionType In-Reply-To: <5b0248170906170303q1cf01545g9af4109f3e1542e9@mail.gmail.com> References: <5b0248170906170303q1cf01545g9af4109f3e1542e9@mail.gmail.com> Message-ID: <1A472770E042064698CB5ADC83A12ACD033A026D@TK5EX14MBXC116.redmond.corp.microsoft.com> This is now fixed in the latest sources (and strerror is now implemented as well). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Seo Sanghyeon Sent: Wednesday, June 17, 2009 3:04 AM To: Discussion of IronPython Subject: [IronPython] __module__ of FunctionType Following program prints different result between CPython and IronPython: def f(): pass print type(f).__module__ CPython: __builtin__ IronPython: This breaks codes which assume __module__ is a string. -- Seo Sanghyeon _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Tue Jun 23 23:02:33 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 23 Jun 2009 21:02:33 +0000 Subject: [IronPython] IronPython 2.6 CodePlex Source Update In-Reply-To: <235b8996-6b5c-484b-ae8a-6fb26e24a9ec@tk5-exsmh-c102.redmond.corp.microsoft.com> References: <235b8996-6b5c-484b-ae8a-6fb26e24a9ec@tk5-exsmh-c102.redmond.corp.microsoft.com> Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC18AF3C9C@tk5ex14mbxc106.redmond.corp.microsoft.com> All these Silverlight changes don't have a checkin comment associated with them (since I forgot to flag the commit for codeplex), so here's it is: Microsoft.Scripting.Silverlight - In-browser Python/Ruby REPL support with initParams console=true. o Adds Microsoft.Scripting.Silverlight.Repl type. Renders the REPL using HTML. REPL runs in the same scope as the start-script by default, therefore has the same language as the start-script. o Can be instantiated by code as well; see samples/repl. o This should be its own assembly in the future to mitigate any ?security? concerns from users getting access to the REPL. Production apps can remove the assembly. - Allow importing/requiring on a background thread: o Removed UI thread check in FileExists -- Thanks Dan Eloff! o Fixed ErrorReporter bug when _sourceFileName is not a file on disk (e.g. ) -- Thanks Dan Eloff! - Not using try/catch for this anymore (jomes review feedback) - Allows hosts of the DLR load a self-contained Python or Ruby library (n a XAP file) and ensures requires/imports will work: o Enables easy setup of a Ruby testing framework to test C#: - http://blog.jimmy.schementi.com/2009/03/testing-c-silverlight-apps-with.html o Package.GetFile* methods now take an optional StreamResourceInfo argument, representing the XAP file to look for the file in. BrowserPAL also has a XapFile property now for telling it which XAP file to look in. - Primitive SL3 Extension support o Hacky at the moment due to a Silverlight 3 bug (which is fixed in more recent internal builds). Need to hardcode extension URLs. This will be fixed in the future. Chiron - Zip version fix (sdlsdk CodePlex Bug# 11803) - Use standard libraries in Silverlight: o Add "/path" option to Chiron for a ";"-separated list of folders to get included into the XAP - Auto-XAP support for IIS: o Add XapHttpHander to Chiron, so it can be used to auto-XAP directories for IIS or Cassini (thanks Harry Pierson!) o Example in Utils/xap-http-handler - Launch Chiron by right-clicking on a folder: chiron-here utility Tests - Run in one Silverlight application: - 52 specifications (81 requirements), 0 failures, 0 errors o Port Python tests 01, args, auto_addref, error_handle, execfile, and issubclass, from existing TestSuites o Unit tests for console, dynamic_application, extension_types, package, and window - Includes Eggs; makes Bacon (a Ruby spec framework) work in Silverlight. Can be used to test a Python/Ruby app, or a C#/VB app (see testing link above). - Not running in SNAP yet. Samples - Cleans up all samples - Adds Photoviewer o http://blog.jimmy.schementi.com/2008/08/walk-through-silverlight-flickr-client.html - Updates to dlrconsole to fix Ruby and make dragging clock demo work: o http://blog.jimmy.schementi.com/2008/08/dragging-elements-in-silverlight-with.html - Adds REPL - Piano, Tetris, and Surface work again Misc: - reflect new template layout for gopackage MSI generation - Microsoft.Scripting.Helpers.csproj now builds correctly in Silverlight - JScript removed from Silverlight.sln There are some Moonlight fixes that I forgot to include here, so those will be coming in next. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of merllab at microsoft.com > Sent: Tuesday, June 23, 2009 8:53 AM > To: users at lists.ironpython.com > Subject: [IronPython] IronPython 2.6 CodePlex Source Update > > This is an automated email letting you know that sources have recently been > pushed out. You can download these newer sources directly from > http://ironpython.codeplex.com/SourceControl/changeset/view/55405. > > ADDED SOURCES > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/XapHttpHandl > er.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/agdlr.css > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/agdlr.js > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Extension.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Repl.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Window.cs > $/IronPython/IronPython_Main/Src/IronPython.Modules/_codecs.cs > $/IronPython/IronPython_Main/Src/IronPythonConsoleAny > > $/IronPython/IronPython_Main/Src/IronPythonConsoleAny/IronPythonCon > soleAny.csproj > $/IronPython/IronPython_Main/Src/IronPythonWindowAny > > $/IronPython/IronPython_Main/Src/IronPythonWindowAny/IronPythonWin > dowAny.csproj > > DELETED SOURCES > $/IronPython/IronPython_Main/Src/IronPython.Modules/codecs.cs > > MODIFIED SOURCES > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/XapHttpHandl > er.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/agdlr.css > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/agdlr.js > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Extension.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Repl.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Window.cs > $/IronPython/IronPython_Main/Src/IronPython.Modules/_codecs.cs > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Zip.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Configuration.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Package.cs > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/App.config > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Microsoft.Scripting.Silverlight.csproj > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/ErrorFormatter.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/XapBuilder.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/DynamicApplication.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/SilverlightVersion.cs > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Chiron.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/BrowserPAL.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Chiron.csproj > > $/IronPython/IronPython_Main/Src/IronPython.Modules/_collections.cs > $/IronPython/IronPython_Main/Src/IronPython.Modules/array.cs > $/IronPython/IronPython_Main/Src/IronPython.Modules/thread.cs > $/IronPython/IronPython_Main/Src/IronPython.Modules/nt.cs > > $/IronPython/IronPython_Main/Src/IronPython.Modules/IronPython.Modu > les.csproj > $/IronPython/IronPython_Main/Src/IronPython.sln > > $/IronPython/IronPython_Main/Src/IronPythonConsoleAny/IronPythonCon > soleAny.csproj > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/NullImporter.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonPr > otocol.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Exceptions/Pytho > nExceptions.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/PythonTyp > e.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/Pytho > nTypeOps.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonAsciiEncodi > ng.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/Pytho > nOps.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/String > Ops.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/LiteralParser.cs > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Slice.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonContext.cs > > $/IronPython/IronPython_Main/Src/IronPythonWindow/IronPythonWindo > w.csproj > $/IronPython/IronPython_Main/Src/IronPythonTest/InheritTest.cs > > $/IronPython/IronPython_Main/Src/IronPythonConsole/IronPythonConsole > .csproj > > $/IronPython/IronPython_Main/Src/IronPythonWindowAny/IronPythonWin > dowAny.csproj > $/IronPython/IronPython_Main/Src/Tests/test_imp.py > $/IronPython/IronPython_Main/Src/Tests/test_generator.py > $/IronPython/IronPython_Main/Src/Tests/test_codecs.py > $/IronPython/IronPython_Main/Src/Tests/test_cliclass.py > $/IronPython/IronPython_Main/Src/Tests/test_class.py > $/IronPython/IronPython_Main/Src/Tests/test_array.py > $/IronPython/IronPython_Main/Src/Tests/test_nt.py > $/IronPython/IronPython_Main/Src/Tests/test_slice.py > $/IronPython/IronPython_Main/Src/Tests/test_python25.py > $/IronPython/IronPython_Main/Src/Tests/test_interactive.py > $/IronPython/IronPython_Main/Src/Tests/test_thread.py > $/IronPython/IronPython_Main/Src/Tests/versions/python26.py > > CHECKIN COMMENTS > -------------------------------------------------------------------------------- > Changeset Id: 957381 > Date: 6/22/2009 10:54:19 AM > > (dfugate) More CPython 2.6 feature work testing. > > > (Shelveset: CP65;REDMOND\dfugate | SNAP CheckinId: m9534) > -------------------------------------------------------------------------------- > Changeset Id: 957377 > Date: 6/22/2009 10:53:19 AM > > (dinov) 22744 1 High _codecs.charmap_decode('') should return a > tuple > 22740 1 High Return value of _codecs.charmap_encode should be > a tuple > 22746 1 High Exceptions in threads are sent to stdout instead of > stderror > 10646 2 Low startswith/endswith methods of string do not throw > TypeError w/ bad parameters > 22733 1 High nt.waitpid broken > 22732 1 Low "nt.waitpid(bad, params)" should throw OSError, not > ValueError > 22723 2 Medium IsFamily and IsFamilyOrAssembly error > 18637 2 Medium Source code encoding is not work correctly > 20908 1 Medium Stack overflow when piclking slice objects > 20909 1 Medium IPy crashes with StackOverflowException > rather than raising RuntimeError > 19215 1 Medium array.array('u', u"...") broken > 19216 1 Medium array.array('I', "...") broken > 19217 1 Medium array.array('l', "...") broken > 18939 1 Medium A deque item that mutates the deque in its > __eq__ ought to throw an IndexError IronPython\2.6 > 19705 1 Medium CLR Dictionary iterator bug > 22742 1 Medium _codecs.escape_decode should support two > parameters > 22743 1 Medium _codecs.escape_decode("\\\a") broken > 22471 Invalid mapping dict parameter passed to > _codecs.charmap_encode(..., mapping_dict) should throw > UnicodeEncodeError > 22738 _codecs.charmap_encode takes 1-3 parameters (not exactly 3) > > > Fixing __str__ on EnvironmentError ? it needs to format the exception and > put in the [Errno #] text. > type.__module__ a data descriptor so that > type(someFunction).__module__ works correctly > > > > (Shelveset: 26Beta2Bugs2Final;REDMOND\dinov | SNAP CheckinId: m9534) > -------------------------------------------------------------------------------- > Changeset Id: 957310 > Date: 6/22/2009 10:08:19 AM > > (dinov) Changes ipy.exe/ipyw.exe to be 32-bit only applications. Adds a new > ipy64.exe/ipyw64.exe which is a platform neutral assembly. Updates the > MSI so that both versions are installed on a 64-bit machine and only ipy.exe is > installed on a 32-bit machine. > > > > (Shelveset: 3264ipyFinal;REDMOND\dinov | SNAP CheckinId: 8763) > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ivan at flanders.co.nz Tue Jun 23 23:32:00 2009 From: ivan at flanders.co.nz (Ivan Porto Carrero) Date: Tue, 23 Jun 2009 23:32:00 +0200 Subject: [IronPython] IronPython 2.6 CodePlex Source Update In-Reply-To: <0047ECBFA2E0DF4A834AA369282A5AFC18AF3C9C@tk5ex14mbxc106.redmond.corp.microsoft.com> References: <235b8996-6b5c-484b-ae8a-6fb26e24a9ec@tk5-exsmh-c102.redmond.corp.microsoft.com> <0047ECBFA2E0DF4A834AA369282A5AFC18AF3C9C@tk5ex14mbxc106.redmond.corp.microsoft.com> Message-ID: these aren't in the ironruby source tree yet are they? --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Tue, Jun 23, 2009 at 11:02 PM, Jimmy Schementi < Jimmy.Schementi at microsoft.com> wrote: > All these Silverlight changes don't have a checkin comment associated with > them (since I forgot to > flag the commit for codeplex), so here's it is: > > Microsoft.Scripting.Silverlight > - In-browser Python/Ruby REPL support with initParams console=true. > o Adds Microsoft.Scripting.Silverlight.Repl type. Renders the REPL > using HTML. REPL runs in the > same scope as the start-script by default, therefore has the same > language as the start-script. > o Can be instantiated by code as well; see samples/repl. > o This should be its own assembly in the future to mitigate any > ?security? concerns from users > getting access to the REPL. Production apps can remove the assembly. > - Allow importing/requiring on a background thread: > o Removed UI thread check in FileExists -- Thanks Dan Eloff! > o Fixed ErrorReporter bug when _sourceFileName is not a file on disk > (e.g. ) -- Thanks Dan Eloff! > - Not using try/catch for this anymore (jomes review feedback) > - Allows hosts of the DLR load a self-contained Python or Ruby library (n > a XAP file) and ensures > requires/imports will work: > o Enables easy setup of a Ruby testing framework to test C#: > - > http://blog.jimmy.schementi.com/2009/03/testing-c-silverlight-apps-with.html > o Package.GetFile* methods now take an optional StreamResourceInfo > argument, representing > the XAP file to look for the file in. BrowserPAL also has a XapFile > property now for telling it which > XAP file to look in. > - Primitive SL3 Extension support > o Hacky at the moment due to a Silverlight 3 bug (which is fixed in > more recent internal builds). > Need to hardcode extension URLs. This will be fixed in the future. > Chiron > - Zip version fix (sdlsdk CodePlex Bug# 11803) > - Use standard libraries in Silverlight: > o Add "/path" option to Chiron for a ";"-separated list of folders to > get included into the XAP > - Auto-XAP support for IIS: > o Add XapHttpHander to Chiron, so it can be used to auto-XAP > directories for IIS or Cassini (thanks Harry Pierson!) > o Example in Utils/xap-http-handler > - Launch Chiron by right-clicking on a folder: chiron-here utility > > Tests > - Run in one Silverlight application: > - 52 specifications (81 requirements), 0 failures, 0 errors > o Port Python tests 01, args, auto_addref, error_handle, execfile, and > issubclass, from existing TestSuites > o Unit tests for console, dynamic_application, extension_types, package, > and window > - Includes Eggs; makes Bacon (a Ruby spec framework) work in Silverlight. > Can be used to test a Python/Ruby app, > or a C#/VB app (see testing link above). > - Not running in SNAP yet. > > Samples > - Cleans up all samples > - Adds Photoviewer > o > http://blog.jimmy.schementi.com/2008/08/walk-through-silverlight-flickr-client.html > - Updates to dlrconsole to fix Ruby and make dragging clock demo work: > o > http://blog.jimmy.schementi.com/2008/08/dragging-elements-in-silverlight-with.html > - Adds REPL > - Piano, Tetris, and Surface work again > > Misc: > - reflect new template layout for gopackage MSI generation > - Microsoft.Scripting.Helpers.csproj now builds correctly in Silverlight > - JScript removed from Silverlight.sln > > There are some Moonlight fixes that I forgot to include here, so those will > be coming in next. > > > -----Original Message----- > > From: users-bounces at lists.ironpython.com [mailto:users- > > bounces at lists.ironpython.com] On Behalf Of merllab at microsoft.com > > Sent: Tuesday, June 23, 2009 8:53 AM > > To: users at lists.ironpython.com > > Subject: [IronPython] IronPython 2.6 CodePlex Source Update > > > > This is an automated email letting you know that sources have recently > been > > pushed out. You can download these newer sources directly from > > http://ironpython.codeplex.com/SourceControl/changeset/view/55405. > > > > ADDED SOURCES > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/XapHttpHandl > > er.cs > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/agdlr.css > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/agdlr.js > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/Extension.cs > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/Repl.cs > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/Window.cs > > $/IronPython/IronPython_Main/Src/IronPython.Modules/_codecs.cs > > $/IronPython/IronPython_Main/Src/IronPythonConsoleAny > > > > $/IronPython/IronPython_Main/Src/IronPythonConsoleAny/IronPythonCon > > soleAny.csproj > > $/IronPython/IronPython_Main/Src/IronPythonWindowAny > > > > $/IronPython/IronPython_Main/Src/IronPythonWindowAny/IronPythonWin > > dowAny.csproj > > > > DELETED SOURCES > > $/IronPython/IronPython_Main/Src/IronPython.Modules/codecs.cs > > > > MODIFIED SOURCES > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/XapHttpHandl > > er.cs > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/agdlr.css > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/agdlr.js > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/Extension.cs > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/Repl.cs > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/Window.cs > > $/IronPython/IronPython_Main/Src/IronPython.Modules/_codecs.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Zip.cs > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/Configuration.cs > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/Package.cs > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/App.config > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/Microsoft.Scripting.Silverlight.csproj > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/ErrorFormatter.cs > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/XapBuilder.cs > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/DynamicApplication.cs > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/SilverlightVersion.cs > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Chiron.cs > > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > > verlight/BrowserPAL.cs > > > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Chiron.csproj > > > > $/IronPython/IronPython_Main/Src/IronPython.Modules/_collections.cs > > $/IronPython/IronPython_Main/Src/IronPython.Modules/array.cs > > $/IronPython/IronPython_Main/Src/IronPython.Modules/thread.cs > > $/IronPython/IronPython_Main/Src/IronPython.Modules/nt.cs > > > > $/IronPython/IronPython_Main/Src/IronPython.Modules/IronPython.Modu > > les.csproj > > $/IronPython/IronPython_Main/Src/IronPython.sln > > > > $/IronPython/IronPython_Main/Src/IronPythonConsoleAny/IronPythonCon > > soleAny.csproj > > > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/NullImporter.cs > > > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonPr > > otocol.cs > > > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Exceptions/Pytho > > nExceptions.cs > > > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/PythonTyp > > e.cs > > > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/Pytho > > nTypeOps.cs > > > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonAsciiEncodi > > ng.cs > > > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/Pytho > > nOps.cs > > > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/String > > Ops.cs > > > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/LiteralParser.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Slice.cs > > > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonContext.cs > > > > $/IronPython/IronPython_Main/Src/IronPythonWindow/IronPythonWindo > > w.csproj > > $/IronPython/IronPython_Main/Src/IronPythonTest/InheritTest.cs > > > > $/IronPython/IronPython_Main/Src/IronPythonConsole/IronPythonConsole > > .csproj > > > > $/IronPython/IronPython_Main/Src/IronPythonWindowAny/IronPythonWin > > dowAny.csproj > > $/IronPython/IronPython_Main/Src/Tests/test_imp.py > > $/IronPython/IronPython_Main/Src/Tests/test_generator.py > > $/IronPython/IronPython_Main/Src/Tests/test_codecs.py > > $/IronPython/IronPython_Main/Src/Tests/test_cliclass.py > > $/IronPython/IronPython_Main/Src/Tests/test_class.py > > $/IronPython/IronPython_Main/Src/Tests/test_array.py > > $/IronPython/IronPython_Main/Src/Tests/test_nt.py > > $/IronPython/IronPython_Main/Src/Tests/test_slice.py > > $/IronPython/IronPython_Main/Src/Tests/test_python25.py > > $/IronPython/IronPython_Main/Src/Tests/test_interactive.py > > $/IronPython/IronPython_Main/Src/Tests/test_thread.py > > $/IronPython/IronPython_Main/Src/Tests/versions/python26.py > > > > CHECKIN COMMENTS > > > -------------------------------------------------------------------------------- > > Changeset Id: 957381 > > Date: 6/22/2009 10:54:19 AM > > > > (dfugate) More CPython 2.6 feature work testing. > > > > > > (Shelveset: CP65;REDMOND\dfugate | SNAP CheckinId: m9534) > > > -------------------------------------------------------------------------------- > > Changeset Id: 957377 > > Date: 6/22/2009 10:53:19 AM > > > > (dinov) 22744 1 High _codecs.charmap_decode('') > should return a > > tuple > > 22740 1 High Return value of _codecs.charmap_encode > should be > > a tuple > > 22746 1 High Exceptions in threads are sent to > stdout instead of > > stderror > > 10646 2 Low startswith/endswith methods of string > do not throw > > TypeError w/ bad parameters > > 22733 1 High nt.waitpid broken > > 22732 1 Low "nt.waitpid(bad, params)" should throw > OSError, not > > ValueError > > 22723 2 Medium IsFamily and > IsFamilyOrAssembly error > > 18637 2 Medium Source code encoding is not > work correctly > > 20908 1 Medium Stack overflow when piclking > slice objects > > 20909 1 Medium IPy crashes with > StackOverflowException > > rather than raising RuntimeError > > 19215 1 Medium array.array('u', u"...") > broken > > 19216 1 Medium array.array('I', "...") > broken > > 19217 1 Medium array.array('l', "...") > broken > > 18939 1 Medium A deque item that mutates > the deque in its > > __eq__ ought to throw an IndexError IronPython\2.6 > > 19705 1 Medium CLR Dictionary iterator bug > > 22742 1 Medium _codecs.escape_decode should > support two > > parameters > > 22743 1 Medium > _codecs.escape_decode("\\\a") broken > > 22471 Invalid mapping dict parameter passed to > > _codecs.charmap_encode(..., mapping_dict) should throw > > UnicodeEncodeError > > 22738 _codecs.charmap_encode takes 1-3 parameters (not exactly 3) > > > > > > Fixing __str__ on EnvironmentError ? it needs to format the exception and > > put in the [Errno #] text. > > type.__module__ a data descriptor so that > > type(someFunction).__module__ works correctly > > > > > > > > (Shelveset: 26Beta2Bugs2Final;REDMOND\dinov | SNAP CheckinId: m9534) > > > -------------------------------------------------------------------------------- > > Changeset Id: 957310 > > Date: 6/22/2009 10:08:19 AM > > > > (dinov) Changes ipy.exe/ipyw.exe to be 32-bit only applications. Adds a > new > > ipy64.exe/ipyw64.exe which is a platform neutral assembly. Updates the > > MSI so that both versions are installed on a 64-bit machine and only > ipy.exe is > > installed on a 32-bit machine. > > > > > > > > (Shelveset: 3264ipyFinal;REDMOND\dinov | SNAP CheckinId: 8763) > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.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 Tue Jun 23 23:49:20 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 23 Jun 2009 21:49:20 +0000 Subject: [IronPython] IronPython 2.6 CodePlex Source Update In-Reply-To: References: <235b8996-6b5c-484b-ae8a-6fb26e24a9ec@tk5-exsmh-c102.redmond.corp.microsoft.com> <0047ECBFA2E0DF4A834AA369282A5AFC18AF3C9C@tk5ex14mbxc106.redmond.corp.microsoft.com> Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC18AF3E50@tk5ex14mbxc106.redmond.corp.microsoft.com> Nope not yet. They'll show up in the next commit. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ivan Porto Carrero Sent: Tuesday, June 23, 2009 2:32 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.6 CodePlex Source Update these aren't in the ironruby source tree yet are they? --- Met vriendelijke groeten - Best regards - Salutations Ivan Porto Carrero Blog: http://flanders.co.nz Twitter: http://twitter.com/casualjim Author of IronRuby in Action (http://manning.com/carrero) On Tue, Jun 23, 2009 at 11:02 PM, Jimmy Schementi > wrote: All these Silverlight changes don't have a checkin comment associated with them (since I forgot to flag the commit for codeplex), so here's it is: Microsoft.Scripting.Silverlight - In-browser Python/Ruby REPL support with initParams console=true. o Adds Microsoft.Scripting.Silverlight.Repl type. Renders the REPL using HTML. REPL runs in the same scope as the start-script by default, therefore has the same language as the start-script. o Can be instantiated by code as well; see samples/repl. o This should be its own assembly in the future to mitigate any ?security? concerns from users getting access to the REPL. Production apps can remove the assembly. - Allow importing/requiring on a background thread: o Removed UI thread check in FileExists -- Thanks Dan Eloff! o Fixed ErrorReporter bug when _sourceFileName is not a file on disk (e.g. ) -- Thanks Dan Eloff! - Not using try/catch for this anymore (jomes review feedback) - Allows hosts of the DLR load a self-contained Python or Ruby library (n a XAP file) and ensures requires/imports will work: o Enables easy setup of a Ruby testing framework to test C#: - http://blog.jimmy.schementi.com/2009/03/testing-c-silverlight-apps-with.html o Package.GetFile* methods now take an optional StreamResourceInfo argument, representing the XAP file to look for the file in. BrowserPAL also has a XapFile property now for telling it which XAP file to look in. - Primitive SL3 Extension support o Hacky at the moment due to a Silverlight 3 bug (which is fixed in more recent internal builds). Need to hardcode extension URLs. This will be fixed in the future. Chiron - Zip version fix (sdlsdk CodePlex Bug# 11803) - Use standard libraries in Silverlight: o Add "/path" option to Chiron for a ";"-separated list of folders to get included into the XAP - Auto-XAP support for IIS: o Add XapHttpHander to Chiron, so it can be used to auto-XAP directories for IIS or Cassini (thanks Harry Pierson!) o Example in Utils/xap-http-handler - Launch Chiron by right-clicking on a folder: chiron-here utility Tests - Run in one Silverlight application: - 52 specifications (81 requirements), 0 failures, 0 errors o Port Python tests 01, args, auto_addref, error_handle, execfile, and issubclass, from existing TestSuites o Unit tests for console, dynamic_application, extension_types, package, and window - Includes Eggs; makes Bacon (a Ruby spec framework) work in Silverlight. Can be used to test a Python/Ruby app, or a C#/VB app (see testing link above). - Not running in SNAP yet. Samples - Cleans up all samples - Adds Photoviewer o http://blog.jimmy.schementi.com/2008/08/walk-through-silverlight-flickr-client.html - Updates to dlrconsole to fix Ruby and make dragging clock demo work: o http://blog.jimmy.schementi.com/2008/08/dragging-elements-in-silverlight-with.html - Adds REPL - Piano, Tetris, and Surface work again Misc: - reflect new template layout for gopackage MSI generation - Microsoft.Scripting.Helpers.csproj now builds correctly in Silverlight - JScript removed from Silverlight.sln There are some Moonlight fixes that I forgot to include here, so those will be coming in next. > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of merllab at microsoft.com > Sent: Tuesday, June 23, 2009 8:53 AM > To: users at lists.ironpython.com > Subject: [IronPython] IronPython 2.6 CodePlex Source Update > > This is an automated email letting you know that sources have recently been > pushed out. You can download these newer sources directly from > http://ironpython.codeplex.com/SourceControl/changeset/view/55405. > > ADDED SOURCES > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/XapHttpHandl > er.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/agdlr.css > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/agdlr.js > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Extension.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Repl.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Window.cs > $/IronPython/IronPython_Main/Src/IronPython.Modules/_codecs.cs > $/IronPython/IronPython_Main/Src/IronPythonConsoleAny > > $/IronPython/IronPython_Main/Src/IronPythonConsoleAny/IronPythonCon > soleAny.csproj > $/IronPython/IronPython_Main/Src/IronPythonWindowAny > > $/IronPython/IronPython_Main/Src/IronPythonWindowAny/IronPythonWin > dowAny.csproj > > DELETED SOURCES > $/IronPython/IronPython_Main/Src/IronPython.Modules/codecs.cs > > MODIFIED SOURCES > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/XapHttpHandl > er.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/agdlr.css > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/agdlr.js > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Extension.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Repl.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Window.cs > $/IronPython/IronPython_Main/Src/IronPython.Modules/_codecs.cs > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Zip.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Configuration.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Package.cs > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/App.config > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/Microsoft.Scripting.Silverlight.csproj > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/ErrorFormatter.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/XapBuilder.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/DynamicApplication.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/SilverlightVersion.cs > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Chiron.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Sil > verlight/BrowserPAL.cs > > $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Chiron/Chiron.csproj > > $/IronPython/IronPython_Main/Src/IronPython.Modules/_collections.cs > $/IronPython/IronPython_Main/Src/IronPython.Modules/array.cs > $/IronPython/IronPython_Main/Src/IronPython.Modules/thread.cs > $/IronPython/IronPython_Main/Src/IronPython.Modules/nt.cs > > $/IronPython/IronPython_Main/Src/IronPython.Modules/IronPython.Modu > les.csproj > $/IronPython/IronPython_Main/Src/IronPython.sln > > $/IronPython/IronPython_Main/Src/IronPythonConsoleAny/IronPythonCon > soleAny.csproj > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/NullImporter.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Binding/PythonPr > otocol.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Exceptions/Pytho > nExceptions.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Types/PythonTyp > e.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/Pytho > nTypeOps.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonAsciiEncodi > ng.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/Pytho > nOps.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Operations/String > Ops.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/LiteralParser.cs > $/IronPython/IronPython_Main/Src/IronPython/Runtime/Slice.cs > > $/IronPython/IronPython_Main/Src/IronPython/Runtime/PythonContext.cs > > $/IronPython/IronPython_Main/Src/IronPythonWindow/IronPythonWindo > w.csproj > $/IronPython/IronPython_Main/Src/IronPythonTest/InheritTest.cs > > $/IronPython/IronPython_Main/Src/IronPythonConsole/IronPythonConsole > .csproj > > $/IronPython/IronPython_Main/Src/IronPythonWindowAny/IronPythonWin > dowAny.csproj > $/IronPython/IronPython_Main/Src/Tests/test_imp.py > $/IronPython/IronPython_Main/Src/Tests/test_generator.py > $/IronPython/IronPython_Main/Src/Tests/test_codecs.py > $/IronPython/IronPython_Main/Src/Tests/test_cliclass.py > $/IronPython/IronPython_Main/Src/Tests/test_class.py > $/IronPython/IronPython_Main/Src/Tests/test_array.py > $/IronPython/IronPython_Main/Src/Tests/test_nt.py > $/IronPython/IronPython_Main/Src/Tests/test_slice.py > $/IronPython/IronPython_Main/Src/Tests/test_python25.py > $/IronPython/IronPython_Main/Src/Tests/test_interactive.py > $/IronPython/IronPython_Main/Src/Tests/test_thread.py > $/IronPython/IronPython_Main/Src/Tests/versions/python26.py > > CHECKIN COMMENTS > -------------------------------------------------------------------------------- > Changeset Id: 957381 > Date: 6/22/2009 10:54:19 AM > > (dfugate) More CPython 2.6 feature work testing. > > > (Shelveset: CP65;REDMOND\dfugate | SNAP CheckinId: m9534) > -------------------------------------------------------------------------------- > Changeset Id: 957377 > Date: 6/22/2009 10:53:19 AM > > (dinov) 22744 1 High _codecs.charmap_decode('') should return a > tuple > 22740 1 High Return value of _codecs.charmap_encode should be > a tuple > 22746 1 High Exceptions in threads are sent to stdout instead of > stderror > 10646 2 Low startswith/endswith methods of string do not throw > TypeError w/ bad parameters > 22733 1 High nt.waitpid broken > 22732 1 Low "nt.waitpid(bad, params)" should throw OSError, not > ValueError > 22723 2 Medium IsFamily and IsFamilyOrAssembly error > 18637 2 Medium Source code encoding is not work correctly > 20908 1 Medium Stack overflow when piclking slice objects > 20909 1 Medium IPy crashes with StackOverflowException > rather than raising RuntimeError > 19215 1 Medium array.array('u', u"...") broken > 19216 1 Medium array.array('I', "...") broken > 19217 1 Medium array.array('l', "...") broken > 18939 1 Medium A deque item that mutates the deque in its > __eq__ ought to throw an IndexError IronPython\2.6 > 19705 1 Medium CLR Dictionary iterator bug > 22742 1 Medium _codecs.escape_decode should support two > parameters > 22743 1 Medium _codecs.escape_decode("\\\a") broken > 22471 Invalid mapping dict parameter passed to > _codecs.charmap_encode(..., mapping_dict) should throw > UnicodeEncodeError > 22738 _codecs.charmap_encode takes 1-3 parameters (not exactly 3) > > > Fixing __str__ on EnvironmentError ? it needs to format the exception and > put in the [Errno #] text. > type.__module__ a data descriptor so that > type(someFunction).__module__ works correctly > > > > (Shelveset: 26Beta2Bugs2Final;REDMOND\dinov | SNAP CheckinId: m9534) > -------------------------------------------------------------------------------- > Changeset Id: 957310 > Date: 6/22/2009 10:08:19 AM > > (dinov) Changes ipy.exe/ipyw.exe to be 32-bit only applications. Adds a new > ipy64.exe/ipyw64.exe which is a platform neutral assembly. Updates the > MSI so that both versions are installed on a 64-bit machine and only ipy.exe is > installed on a 32-bit machine. > > > > (Shelveset: 3264ipyFinal;REDMOND\dinov | SNAP CheckinId: 8763) > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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 billchi at microsoft.com Wed Jun 24 01:08:48 2009 From: billchi at microsoft.com (Bill Chiles) Date: Tue, 23 Jun 2009 23:08:48 +0000 Subject: [IronPython] Updates to Sympl Sample Message-ID: I've updated the Sympl language sample to show how to support the DLR Hosting APIs. Since the base sample works with only the bits we plan to put into CLR 4.0, and we expect to show some other examples with Sympl that use APIs shipping on Codeplex only, I have split the sources into two C# versions. Most of the new code is in ...\languages\sympl\csharp-cponly\dlrhosting.cs, but there were also a few light changes to sympl.cs and runtime.cs. We're pushing the sources to codeplex today on the Source Code tab. I've also updated the Sympl and hosting documents on Codeplex. To avoid over-promising :-), the sample shows basic DLR Hosting API support for: * Hosts supporting multiple languages for scripting. * Running Sympl code in DLR hosting scopes. * Fetching DLR host globals or object models from Sympl. * Offer extension services from the Sympl DLR engine. The sample does not show some other DLR Hosting functionality such as: * Support for configuration options for the Sympl engine. * ObjectOperations with Sympl semantics. * Tokenizer service or other tooling support Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: From merllab at microsoft.com Wed Jun 24 17:54:05 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Wed, 24 Jun 2009 08:54:05 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <121d965e-1d3f-4a7a-8742-ab229a377246@tk5-exsmh-c102.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/55456. DELETED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/AutoRuleTemplate.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/TreeComparer.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/CallSiteRule.cs MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/CallSiteOps.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/CallSiteBinder.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/CallSite.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Microsoft.Scripting.Core.csproj $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/RuleCache.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/ExpressionVisitor.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/ExpressionQuoter.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Utils/ContractUtils.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Interpreter/LightLambdaClosureVisitor.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Generation/ToDiskRewriter.cs $/IronPython/IronPython_Main/Src/Scripts/generate_dynsites.py $/IronPython/IronPython_Main/Src/Tests/test_interactive.py $/IronPython/IronPython_Main/Src/Tests/versions/python26.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 959146 Date: 6/23/2009 9:57:29 AM (dfugate) - enabled most of test_import within CPy's test_builtin.py - added regression for exception slicing warnings to test_interactive.py python26.py: - added regression around nt.environ.clear() really nuking all environment variables. Filed CodePlex 23205 as a result - added regression around socket.error inheritance (Shelveset: CP66;REDMOND\dfugate | SNAP CheckinId: 8774) From adamb at silverkeytech.com Thu Jun 25 02:21:57 2009 From: adamb at silverkeytech.com (Adam Brand) Date: Wed, 24 Jun 2009 17:21:57 -0700 Subject: [IronPython] Random Number Generation Message-ID: <05ab01c9f52a$f38aa0f0$da9fe2d0$@com> I feel newbish writing this, but I?m having problems generating random numbers in IronPython. I tried ?import random? but that doesn?t seem to work (module not found). I tried creating a System.Random but when I run var_utmn = randgen.Next(1000000000,9999999999) I get a buffer overflow. Any ideas? The random number needs to be above those two numbers indicated above. Thanks, Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Thu Jun 25 02:37:54 2009 From: sanxiyn at gmail.com (Seo Sanghyeon) Date: Thu, 25 Jun 2009 09:37:54 +0900 Subject: [IronPython] Random Number Generation In-Reply-To: <05ab01c9f52a$f38aa0f0$da9fe2d0$@com> References: <05ab01c9f52a$f38aa0f0$da9fe2d0$@com> Message-ID: <5b0248170906241737g5572f282h5f557f047792ef35@mail.gmail.com> 2009/6/25 Adam Brand : > I tried ?import random? but that doesn?t seem to work (module not found). Works for me. Do you have Python standard library in sys.path? -- Seo Sanghyeon From patrick at toolmaker.nl Thu Jun 25 03:52:20 2009 From: patrick at toolmaker.nl (Patrick van der Willik) Date: Thu, 25 Jun 2009 03:52:20 +0200 Subject: [IronPython] Sandbox AppDomains and 'Object has been disconnected or does not exist at the server' exceptions Message-ID: <4A42D854.102@toolmaker.nl> I isolated my IPy instance into a seperate AppDomain with some serious restrictions on which assemblies are allowed to be loaded. In the current setup it's impossible to open sockets or read files from disk, which is exactly what I'm trying to accomplish. However, when my server is idle for a few minutes(or more simple, when I put my laptop into hibernation and resume it later that day), the connection with the appdomain seems to time out. When calling a function it'll throw an exception with the following message: "Object '/0bb4e678_d665_4698_ae30_cdaf28351e72/0jpmcrorxe_qkvj6fml9kboj_3.rem' has been disconnected or does not exist at the server." I'm not really sure how I need to solve this one. Research showed that it probably has to do with Remoting. Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From ddicato at microsoft.com Thu Jun 25 06:31:11 2009 From: ddicato at microsoft.com (David DiCato) Date: Thu, 25 Jun 2009 04:31:11 +0000 Subject: [IronPython] Random Number Generation In-Reply-To: <05ab01c9f52a$f38aa0f0$da9fe2d0$@com> References: <05ab01c9f52a$f38aa0f0$da9fe2d0$@com> Message-ID: Seo is correct; in order to import random, you need the CPython standard library in sys.path. There are 3 ways to do this: 1. Run IronPython from the standard library directory (the working directory is in sys.path by default) 2. Append the standard lib directory to sys.path for invocation of IronPython, e.g.: import sys sys.path.append(r'c:\Program Files\IronPython 2.6\Lib') 3. (Recommended) Set the environment variable IRONPYTHONPATH to point to the standard lib directory System.Random is implemented in terms of .NET integers, which are 32-bit. When your script passed 9999999999, IronPython tried to represent it in 32 bits, causing an arithmetic overflow. In a pinch, you can use slightly more complicated logic to suit your needs, e.g.: var_utmn = randgen.Next(100000000,1000000000) * 10 + randgen.Next(9) But using the CPython library is much cleaner :). A final word of advice: Both standard libraries' random number generators use the convention that the first argument is inclusive and the second is exclusive. This means that your code will generate random numbers from 1000000000 to 9999999998, which may or may not be what you want. Good luck, - David From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Adam Brand Sent: Wednesday, June 24, 2009 5:22 PM To: Discussion of IronPython Subject: [IronPython] Random Number Generation I feel newbish writing this, but I'm having problems generating random numbers in IronPython. I tried "import random" but that doesn't seem to work (module not found). I tried creating a System.Random but when I run var_utmn = randgen.Next(1000000000,9999999999) I get a buffer overflow. Any ideas? The random number needs to be above those two numbers indicated above. Thanks, Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From adamb at silverkeytech.com Thu Jun 25 21:15:58 2009 From: adamb at silverkeytech.com (Adam Brand) Date: Thu, 25 Jun 2009 12:15:58 -0700 Subject: [IronPython] Random Number Generation In-Reply-To: References: <05ab01c9f52a$f38aa0f0$da9fe2d0$@com> Message-ID: <00b701c9f5c9$5f1d09e0$1d571da0$@com> Awesome, thanks that worked. I was using IronPython for ASP.net and did not have a pointer to the standard library. One last question though if anyone knows?is there a way to do this sys.path.append from Global.asax? I know there is a python equivalent global.py, but we right now have a bunch of code in global.asax and would need to rewrite that in python if not. Or can they co-exist? Thanks, Adam Adam Brand SilverKey Technologies *From:* users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] *On Behalf Of *David DiCato *Sent:* Wednesday, June 24, 2009 9:31 PM *To:* Discussion of IronPython *Subject:* Re: [IronPython] Random Number Generation Seo is correct; in order to import random, you need the CPython standard library in sys.path. There are 3 ways to do this: 1. Run IronPython from the standard library directory (the working directory is in sys.path by default) 2. Append the standard lib directory to sys.path for invocation of IronPython, e.g.: import sys sys.path.append(r?c:\Program Files\IronPython 2.6\Lib?) 3. (Recommended) Set the environment variable IRONPYTHONPATH to point to the standard lib directory System.Random is implemented in terms of .NET integers, which are 32-bit. When your script passed 9999999999, IronPython tried to represent it in 32 bits, causing an arithmetic overflow. In a pinch, you can use slightly more complicated logic to suit your needs, e.g.: var_utmn = randgen.Next(100000000,1000000000) * 10 + randgen.Next(9) But using the CPython library is much cleaner J. A final word of advice: Both standard libraries? random number generators use the convention that the first argument is inclusive and the second is exclusive. This means that your code will generate random numbers from 1000000000 to 9999999998, which may or may not be what you want. Good luck, - David *From:* users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] *On Behalf Of *Adam Brand *Sent:* Wednesday, June 24, 2009 5:22 PM *To:* Discussion of IronPython *Subject:* [IronPython] Random Number Generation I feel newbish writing this, but I?m having problems generating random numbers in IronPython. I tried ?import random? but that doesn?t seem to work (module not found). I tried creating a System.Random but when I run var_utmn = randgen.Next(1000000000,9999999999) I get a buffer overflow. Any ideas? The random number needs to be above those two numbers indicated above. Thanks, Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.p.lepisto at intel.com Thu Jun 25 22:20:29 2009 From: stephen.p.lepisto at intel.com (Lepisto, Stephen P) Date: Thu, 25 Jun 2009 13:20:29 -0700 Subject: [IronPython] Random Number Generation In-Reply-To: <00b701c9f5c9$5f1d09e0$1d571da0$@com> References: <05ab01c9f52a$f38aa0f0$da9fe2d0$@com> <00b701c9f5c9$5f1d09e0$1d571da0$@com> Message-ID: <6AF28EB9F93A354894F2F3916DF6F96E0C75CCD160@orsmsx510.amr.corp.intel.com> If global.asax can set an environment variable, you can set (or append to) IRONPYTHONPATH to the path if interest. When IronPython starts up, it takes the paths in IRONPYTHONPATH and adds them to the sys.path list. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Adam Brand Sent: Thursday, June 25, 2009 12:16 PM To: Discussion of IronPython Subject: Re: [IronPython] Random Number Generation Awesome, thanks that worked. I was using IronPython for ASP.net and did not have a pointer to the standard library. One last question though if anyone knows...is there a way to do this sys.path.append from Global.asax? I know there is a python equivalent global.py, but we right now have a bunch of code in global.asax and would need to rewrite that in python if not. Or can they co-exist? Thanks, Adam Adam Brand SilverKey Technologies From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of David DiCato Sent: Wednesday, June 24, 2009 9:31 PM To: Discussion of IronPython Subject: Re: [IronPython] Random Number Generation Seo is correct; in order to import random, you need the CPython standard library in sys.path. There are 3 ways to do this: 1. Run IronPython from the standard library directory (the working directory is in sys.path by default) 2. Append the standard lib directory to sys.path for invocation of IronPython, e.g.: import sys sys.path.append(r'c:\Program Files\IronPython 2.6\Lib') 3. (Recommended) Set the environment variable IRONPYTHONPATH to point to the standard lib directory System.Random is implemented in terms of .NET integers, which are 32-bit. When your script passed 9999999999, IronPython tried to represent it in 32 bits, causing an arithmetic overflow. In a pinch, you can use slightly more complicated logic to suit your needs, e.g.: var_utmn = randgen.Next(100000000,1000000000) * 10 + randgen.Next(9) But using the CPython library is much cleaner :). A final word of advice: Both standard libraries' random number generators use the convention that the first argument is inclusive and the second is exclusive. This means that your code will generate random numbers from 1000000000 to 9999999998, which may or may not be what you want. Good luck, - David From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Adam Brand Sent: Wednesday, June 24, 2009 5:22 PM To: Discussion of IronPython Subject: [IronPython] Random Number Generation I feel newbish writing this, but I'm having problems generating random numbers in IronPython. I tried "import random" but that doesn't seem to work (module not found). I tried creating a System.Random but when I run var_utmn = randgen.Next(1000000000,9999999999) I get a buffer overflow. Any ideas? The random number needs to be above those two numbers indicated above. Thanks, Adam -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.echavarriagregory at umiami.edu Fri Jun 26 16:54:03 2009 From: m.echavarriagregory at umiami.edu (Echavarria Gregory, Maria Angelica) Date: Fri, 26 Jun 2009 10:54:03 -0400 Subject: [IronPython] Documentation Message-ID: <2E95F75EDC25D54999387A1E2E6EF62739585603BB@MBX02.cgcent.miami.edu> Good Morning Group, I've been programming in Python (PythonWin32, ActiveState, Enthought...) for a year now. I have a new task of creating a stand alone application for Windows. I have my .py code already, now I'm looking for an easy to program (best if automatic programming) GUI. I found Glade, then Autoglade but sadly only for Ubuntu-devian, now I found IronPython Studio, but haven't found any Tutorial or users manual, an example, nothing!! Could you please give me advise on: * What to use for my GUI - very automatic please * Documentation of IronPython, preferably Studio... anything would help, even examples. It's about time and my lack of GUI programming knowledge... * If this book IronPython in Action or the new Pro IronPython gives any help in my case... Thanks so much, Angelica. M. Angelica Echavarria-Gregory, M.Sc., E.I. Ph.D Candidate University of Miami Phone 305 284-3611 From fuzzyman at voidspace.org.uk Fri Jun 26 17:12:03 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 26 Jun 2009 16:12:03 +0100 Subject: [IronPython] Documentation In-Reply-To: <2E95F75EDC25D54999387A1E2E6EF62739585603BB@MBX02.cgcent.miami.edu> References: <2E95F75EDC25D54999387A1E2E6EF62739585603BB@MBX02.cgcent.miami.edu> Message-ID: <4A44E543.7020109@voidspace.org.uk> Echavarria Gregory, Maria Angelica wrote: > Good Morning Group, > > I've been programming in Python (PythonWin32, ActiveState, Enthought...) for a year now. I have a new task of creating a stand alone application for Windows. I have my .py code already, now I'm looking for an easy to program (best if automatic programming) GUI. > > I found Glade, then Autoglade but sadly only for Ubuntu-devian, now I found IronPython Studio, but haven't found any Tutorial or users manual, an example, nothing!! Could you please give me advise on: > > * > What to use for my GUI - very automatic please > * > Documentation of IronPython, preferably Studio... anything would help, even examples. It's about time and my lack of GUI programming knowledge... > Personally I would avoid IronPython Studio - it is very brittle and was created as an 'example' of extending visual studio, not for production use. For a Windows Forms designer I use Visual Studio (Express) and compile the generated GUI into a class library which I import from IronPython. This technique, along with building Windows Forms applications in general is covered in IronPython in Action. For an IronPython IDE (without designer) I would recommend Wing, Netbeans, or SharpDevelop. http://ironpython-urls.blogspot.com/2009/05/using-ironpython-with-wing-and-netbeans.html Actually SharpDevelop has very good IronPython support including a Windows Forms designer and IronPython debugger. http://ironpython-urls.blogspot.com/2009/06/sharpdevelop-exploring-and-debugging.html http://ironpython-urls.blogspot.com/2009/05/ironpython-in-sharpdevelop-31-and.html > * > If this book IronPython in Action or the new Pro IronPython gives any help in my case... > Either would be very good, both would be better. :-) Michael > Thanks so much, > > Angelica. > > > > M. Angelica Echavarria-Gregory, M.Sc., E.I. > Ph.D Candidate > University of Miami > Phone 305 284-3611 > _______________________________________________ > 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/blog From merllab at microsoft.com Fri Jun 26 17:52:42 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Fri, 26 Jun 2009 08:52:42 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/55549. MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/Shell/Remote/RemoteCommandDispatcher.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/ExceptionOperations.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/ScriptHost.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/ScriptScope.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/Hosting/TokenCategorizer.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting/SourceFileContentProvider.cs From brian.curtin at gmail.com Fri Jun 26 18:38:15 2009 From: brian.curtin at gmail.com (Brian Curtin) Date: Fri, 26 Jun 2009 11:38:15 -0500 Subject: [IronPython] Documentation In-Reply-To: <2E95F75EDC25D54999387A1E2E6EF62739585603BB@MBX02.cgcent.miami.edu> References: <2E95F75EDC25D54999387A1E2E6EF62739585603BB@MBX02.cgcent.miami.edu> Message-ID: On Fri, Jun 26, 2009 at 09:54, Echavarria Gregory, Maria Angelica < m.echavarriagregory at umiami.edu> wrote: > What to use for my GUI - very automatic please > > > M. Angelica Echavarria-Gregory, M.Sc., E.I. > Ph.D Candidate > University of Miami > Phone 305 284-3611 Although this is not "very automatic"...if you have Visual Studio, you can just create your GUI in the designer, then copy the code from YourForm.designer.cs into a YourForm.py file. Replace "this" with "self", get rid of any existence of "new", convert any true or false values to True or False, remove the semicolons (not required though), etc. A few find-and-replaces turns C# code into working Python code :) Michael's suggestion of creating a class library may be more up your alley. His book does a great job of covering some GUI topics you may be interested in. Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at microsoft.com Fri Jun 26 19:21:44 2009 From: dinov at microsoft.com (Dino Viehland) Date: Fri, 26 Jun 2009 17:21:44 +0000 Subject: [IronPython] Sandbox AppDomains and 'Object has been disconnected or does not exist at the server' exceptions In-Reply-To: <4A42D854.102@toolmaker.nl> References: <4A42D854.102@toolmaker.nl> Message-ID: <1A472770E042064698CB5ADC83A12ACD033C2B73@TK5EX14MBXC116.redmond.corp.microsoft.com> Tomas has checked in a fix for this. Basically what's going on is that w/ remoting you have a lease which keeps the remote objects alive. If that lease expires (by default it's 5 or 15 minutes or something) then the object becomes unreachable. The fix was to opt-out of the leasing system. Long term we need a better story around the lease but it'll prevent this from happening for the time being. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Patrick van der Willik Sent: Wednesday, June 24, 2009 6:52 PM To: Discussion of IronPython Subject: [IronPython] Sandbox AppDomains and 'Object has been disconnected or does not exist at the server' exceptions I isolated my IPy instance into a seperate AppDomain with some serious restrictions on which assemblies are allowed to be loaded. In the current setup it's impossible to open sockets or read files from disk, which is exactly what I'm trying to accomplish. However, when my server is idle for a few minutes(or more simple, when I put my laptop into hibernation and resume it later that day), the connection with the appdomain seems to time out. When calling a function it'll throw an exception with the following message: "Object '/0bb4e678_d665_4698_ae30_cdaf28351e72/0jpmcrorxe_qkvj6fml9kboj_3.rem' has been disconnected or does not exist at the server." I'm not really sure how I need to solve this one. Research showed that it probably has to do with Remoting. Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: From duanek at chorus.net Fri Jun 26 20:28:58 2009 From: duanek at chorus.net (Duane Kaufman) Date: Fri, 26 Jun 2009 14:28:58 -0400 Subject: [IronPython] Issues with IronPython UI Automation Message-ID: <20090626142858.jqbbsid9pg08okok-qhnarx@webmail.spamcop.net> Hi, I am new to the group, and trying to educate myself on using IronPython for UI Automation. I found a code snippet (in C#) to pattern some Python after on the web: (from http://refact.blogspot.com/2009/03/ui-automation-library.html), which is supposed to check to see that a keypress of the "1" button makes a "1" appear in the calculator display. I am running into a problem where I can't find the Edit control programmatically. // .. Launch Calc Process Process[] processes = Process.GetProcessesByName("calc"); AutomationElement _mainWindow= AutomationElement.FromHandle(processes[0].MainWindowHandle); AutomationElement lButton =_mainWindow.FindFirst( TreeScope.Children, new PropertyCondition(AutomationElement.NameProperty, "1")); ((InvokePattern)(lButton .GetCurrentPattern(InvokePattern.Pattern))).Invoke(); AutomationElement lScreen = _mainWindow.FindFirst( TreeScope.Children, new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Edit)); string lDisplayText = (string)lScreen.GetCurrentPropertyValue(ValuePattern.ValueProperty); Assert.Equals("1",lDisplayText); processes [0].Close(); My Python code to attempt something similar: import clr clr.AddReference('UIAutomationClient') clr.AddReference('UIAutomationTypes') from System.Windows.Automation import * # unlike C# example, make sure Windows Calculator is running before running this script tops = AutomationElement.RootElement.FindAll(TreeScope.Children, Condition.TrueCondition) for elem in tops: #print "Window %s is available" % elem.GetCurrentPropertyValue(AutomationElement.NameProperty) if elem.GetCurrentPropertyValue(AutomationElement.NameProperty) == 'Calculator': print "Calculator found! Total of %d UI elements" % len(elem.FindAll(TreeScope.Children, Condition.TrueCondition)) NameCondition = PropertyCondition(AutomationElement.NameProperty, "1") lButton = elem.FindFirst(TreeScope.Children, NameCondition) print lButton EditCondition = PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Edit) lScreen = elem.FindFirst(TreeScope.Children, EditCondition) print lScreen The output looks like: Calculator found! Total of 74 UI elements None which seems to indicate that the Edit control was not found, but I can find it using a tool like UISpy. Why can't I search for the Edit control in this window and find it? Thanks in advance, Duane From jregele23 at gmail.com Fri Jun 26 21:20:45 2009 From: jregele23 at gmail.com (Justin Regele) Date: Fri, 26 Jun 2009 12:20:45 -0700 Subject: [IronPython] Documentation In-Reply-To: References: <2E95F75EDC25D54999387A1E2E6EF62739585603BB@MBX02.cgcent.miami.edu> Message-ID: <8429660906261220q74a20435j2474532274f51532@mail.gmail.com> Yes, get Michael's book. I was also really lost until I got it. I'm using IronPython Studio, but I'm not making any gui's, and I need to embed it in C# code, so that works for me. Like Michael said, it is very brittle. You must disable autocompletion otherwise it will destroy your python code, or at least make perfectly legitimate spacings uncompilable. On Fri, Jun 26, 2009 at 9:38 AM, Brian Curtin wrote: > On Fri, Jun 26, 2009 at 09:54, Echavarria Gregory, Maria Angelica < > m.echavarriagregory at umiami.edu> wrote: > >> What to use for my GUI - very automatic please >> >> >> M. Angelica Echavarria-Gregory, M.Sc., E.I. >> Ph.D Candidate >> University of Miami >> Phone 305 284-3611 >> > > Although this is not "very automatic"...if you have Visual Studio, you can > just create your GUI in the designer, then copy the code from > YourForm.designer.cs into a YourForm.py file. Replace "this" with "self", > get rid of any existence of "new", convert any true or false values to True > or False, remove the semicolons (not required though), etc. A few > find-and-replaces turns C# code into working Python code :) > > Michael's suggestion of creating a class library may be more up your alley. > His book does a great job of covering some GUI topics you may be interested > in. > > Brian > > _______________________________________________ > 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.echavarriagregory at umiami.edu Fri Jun 26 21:31:44 2009 From: m.echavarriagregory at umiami.edu (Echavarria Gregory, Maria Angelica) Date: Fri, 26 Jun 2009 15:31:44 -0400 Subject: [IronPython] Documentation Message-ID: <2E95F75EDC25D54999387A1E2E6EF62739585603BC@MBX02.cgcent.miami.edu> > For a Windows Forms designer I use Visual Studio (Express) and compile > the generated GUI into a class library which I import from IronPython. > This technique, along with building Windows Forms applications in > general is covered in IronPython in Action. Thanks Michael and Brian, I will follow all your advice, two more questions would be: 1. Do the Python packages that I used to produce my code (Numpy, Scipy, Sympy, pylab, matplotlib, Mayavi2) would load and execute using IronPython as you recommend? I read in a blog by Michael that libraries of regular Python do not work... please advice this need. and > Replace "this" with "self", > get rid of any existence of "new", convert any true or false values to True > or False, remove the semicolons (not required though), etc. A few f> ind-and-replaces turns C# code into working Python code :) 2). Not highly important since I can look up in the web (don't think I'm lazy, it's a matter of time) but: if there is on your wiki or maybe in the issues, a complete list of equivalences between C# and Python when coding GUIs... I haven't touched C (turbo C++) in 10 years... to do the replacement Brian talks about. Thanks for your very quick reply, Angelica. From fuzzyman at voidspace.org.uk Fri Jun 26 21:49:45 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 26 Jun 2009 20:49:45 +0100 Subject: [IronPython] Documentation In-Reply-To: <2E95F75EDC25D54999387A1E2E6EF62739585603BC@MBX02.cgcent.miami.edu> References: <2E95F75EDC25D54999387A1E2E6EF62739585603BC@MBX02.cgcent.miami.edu> Message-ID: <4A452659.8010306@voidspace.org.uk> Echavarria Gregory, Maria Angelica wrote: >> For a Windows Forms designer I use Visual Studio (Express) and compile >> the generated GUI into a class library which I import from IronPython. >> This technique, along with building Windows Forms applications in >> general is covered in IronPython in Action. >> > > Thanks Michael and Brian, I will follow all your advice, two more questions would be: > > 1. Do the Python packages that I used to produce my code (Numpy, Scipy, Sympy, pylab, matplotlib, Mayavi2) would load and execute using IronPython as you recommend? I read in a blog by Michael that libraries of regular Python do not work... please advice this need. > *Most* pure-Python libraries work fine with IronPython. Libraries which are written in C (or depend on modules written in C) - which unfortunately includes numpy, Scipy and all the ones you mention - don't work with IronPython as it doesn't have the Python C API they use. *However*, there is a project called Ironclad (created by Resolver Systems) that provides the C API. It doesn't have 100% coverage yet - but significant proportions of numpy, scipy etc do work. http://www.resolversystems.com/documentation/index.php/Ironclad.html > and > > >> Replace "this" with "self", >> get rid of any existence of "new", convert any true or false values to True >> or False, remove the semicolons (not required though), etc. A few >> > f> ind-and-replaces turns C# code into working Python code :) > > 2). Not highly important since I can look up in the web (don't think I'm lazy, it's a matter of time) but: if there is on your wiki or maybe in the issues, a complete list of equivalences between C# and Python when coding GUIs... I haven't touched C (turbo C++) in 10 years... to do the replacement Brian talks about. > > No one has written a comprehensive conversion chart I don't think - but it would be an interesting project. C# is not really very similar to C except superficially. Michael > Thanks for your very quick reply, > Angelica. > _______________________________________________ > 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/blog From patrick at toolmaker.nl Sat Jun 27 01:36:23 2009 From: patrick at toolmaker.nl (Patrick van der Willik) Date: Sat, 27 Jun 2009 01:36:23 +0200 Subject: [IronPython] Sandbox AppDomains and 'Object has been disconnected or does not exist at the server' exceptions In-Reply-To: <1A472770E042064698CB5ADC83A12ACD033C2B73@TK5EX14MBXC116.redmond.corp.microsoft.com> References: <4A42D854.102@toolmaker.nl> <1A472770E042064698CB5ADC83A12ACD033C2B73@TK5EX14MBXC116.redmond.corp.microsoft.com> Message-ID: <4A455B77.6060500@toolmaker.nl> It took me a few hours of reading documentation, but I figured out a fix for myself earlier today but never had the chance to send the mail around with my own fix. My own fix means overloading InitializeLifetimeService() on all MarshalByRefObjects and have it return null. This will work perfectly for class variables which are passed cross appdomain. I have several classes which were passed cross appdomain and are kept around for as long as the applications runs. Your explanation is in this matter correct. Remoting keeps GC references around for 5 minutes by default. After 5 minutes of no method calls on the object, the GC thinks the object is no longer used and disposes of it. The whole reason for this is because object pinging would case a massive amount of traffic and depending on objects to report their destruction isn't reliable. Basically, the solution is to add this to all classes that are passed over AppDomain boundaries: public override object InitializeLifetimeService() { return null; } Patrick van der Willik Dino Viehland wrote: > > Tomas has checked in a fix for this. Basically what's going on is > that w/ remoting you have a lease which keeps the remote objects > alive. If that lease expires (by default it's 5 or 15 minutes or > something) then the object becomes unreachable. The fix was to > opt-out of the leasing system. Long term we need a better story > around the lease but it'll prevent this from happening for the time being. > > > > *From:* users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] *On Behalf Of *Patrick van > der Willik > *Sent:* Wednesday, June 24, 2009 6:52 PM > *To:* Discussion of IronPython > *Subject:* [IronPython] Sandbox AppDomains and 'Object has been > disconnected or does not exist at the server' exceptions > > > > I isolated my IPy instance into a seperate AppDomain with some serious > restrictions on which assemblies are allowed to be loaded. In the > current setup it's impossible to open sockets or read files from disk, > which is exactly what I'm trying to accomplish. > > However, when my server is idle for a few minutes(or more simple, when > I put my laptop into hibernation and resume it later that day), the > connection with the appdomain seems to time out. When calling a > function it'll throw an exception with the following message: > "Object > '/0bb4e678_d665_4698_ae30_cdaf28351e72/0jpmcrorxe_qkvj6fml9kboj_3.rem' > has been disconnected or does not exist at the server." > > I'm not really sure how I need to solve this one. Research showed that > it probably has to do with Remoting. > > Patrick > > ------------------------------------------------------------------------ > > _______________________________________________ > 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 adhi.ramanathan at orangescape.com Sat Jun 27 06:33:09 2009 From: adhi.ramanathan at orangescape.com (adhi.r) Date: Fri, 26 Jun 2009 21:33:09 -0700 (PDT) Subject: [IronPython] How to pass python list values as variable length arguments Message-ID: <24169732.post@talk.nabble.com> Hi, Can anyone tell me how to pass python list values as a variable length of arguments to another function. I'm working in Silverlight-IronPython, I want to pass a list of values from IronPython to javascript, but I'm not able to iterate the list/dict object of IronPython in Javascript. So as a workaround I'm trying to pass variable length args to javascript. Can any one tell me the solution? Adhi -- View this message in context: http://www.nabble.com/How-to-pass-python-list-values-as-variable-length-arguments-tp24169732p24169732.html Sent from the IronPython mailing list archive at Nabble.com. From adhi.ramanathan at orangescape.com Sat Jun 27 09:09:17 2009 From: adhi.ramanathan at orangescape.com (adhi.r) Date: Sat, 27 Jun 2009 00:09:17 -0700 (PDT) Subject: [IronPython] Silverlight onload is not getting called Message-ID: <24230948.post@talk.nabble.com> Hi, I'm using silverlight with ironpython with huge amount of modules, the problem is some times the onload method of Silverlight is not getting called hence the silverlight UI components are not getting displayed. I'm using IsolatedStorage, and when I clear the storage and do refresh its working. Can anyone help for this problem. Adhi -- View this message in context: http://www.nabble.com/Silverlight-onload-is-not-getting-called-tp24230948p24230948.html Sent from the IronPython mailing list archive at Nabble.com. From drury_robert_h at sbcglobal.net Sat Jun 27 17:25:08 2009 From: drury_robert_h at sbcglobal.net (drury_robert_h) Date: Sat, 27 Jun 2009 11:25:08 -0400 Subject: [IronPython] Documentation In-Reply-To: <2E95F75EDC25D54999387A1E2E6EF62739585603BC@MBX02.cgcent.miami.edu> References: <2E95F75EDC25D54999387A1E2E6EF62739585603BC@MBX02.cgcent.miami.edu> Message-ID: <048401c9f73b$74454e40$5ccfeac0$@net> There is a program on the net called cs2py, that will convert the gui code produced by VS to python code for you. While this not a complicated process, and can be done with search & replace in any good editor, it's less likely to miss something. Bob Drury -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Echavarria Gregory, Maria Angelica Sent: Friday, June 26, 2009 3:32 PM To: users at lists.ironpython.com Subject: Re: [IronPython] Documentation > For a Windows Forms designer I use Visual Studio (Express) and compile > the generated GUI into a class library which I import from IronPython. > This technique, along with building Windows Forms applications in > general is covered in IronPython in Action. Thanks Michael and Brian, I will follow all your advice, two more questions would be: 1. Do the Python packages that I used to produce my code (Numpy, Scipy, Sympy, pylab, matplotlib, Mayavi2) would load and execute using IronPython as you recommend? I read in a blog by Michael that libraries of regular Python do not work... please advice this need. and > Replace "this" with "self", > get rid of any existence of "new", convert any true or false values to True > or False, remove the semicolons (not required though), etc. A few f> ind-and-replaces turns C# code into working Python code :) 2). Not highly important since I can look up in the web (don't think I'm lazy, it's a matter of time) but: if there is on your wiki or maybe in the issues, a complete list of equivalences between C# and Python when coding GUIs... I haven't touched C (turbo C++) in 10 years... to do the replacement Brian talks about. Thanks for your very quick reply, Angelica. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From mc at mclaveau.com Sun Jun 28 10:36:17 2009 From: mc at mclaveau.com (Michel Claveau) Date: Sun, 28 Jun 2009 10:36:17 +0200 Subject: [IronPython] Ironpython & COM vs Jscript.Net & COM Message-ID: <5145D829BA6E47C59BFA76256A85692B@MCI1330> Hi, Shri! > IronPython 2.0 supports dynamic COM servers. See > http://blogs.msdn.com/shrib/archive/2008/07/30/idispatch-support-on-in-ironpython-beta-4.aspx Your blog is interesting. But, your trick don't run with my COM servers (who have no TLB). These give : pythoncom error: CPyFactory::CreateInstance failed to create instance. (80004005) Traceback (most recent call last): File "", line 1, in File "mscorlib", line unknown, in CreateInstance EnvironmentError: La cr?ation d'une instance du composant COM avec le CLSID {EC501258-201C-449C-BE20-837A316EA382} ? partir de IClassFactory a ?chou? en raison de l'erreur suivante : 80004005. For info, the COM server run OK on some customers' hundreds, with use from Autoit, Excel(VBA), JScript, Python, etc. Exemple (in Python): pd = win32com.client.Dispatch('Ponxd.Mci') pd.pversion() Other info : Makepy (PythonWin/Pywin32) don't work with these COM servers (still because no TLB...) I remind that, on dynamic COM servers, functions/methods/properties can no exist at opening, and can be created/changed after opening. @-salutations -- Michel Claveau From mc at mclaveau.com Sun Jun 28 11:13:30 2009 From: mc at mclaveau.com (Michel Claveau) Date: Sun, 28 Jun 2009 11:13:30 +0200 Subject: [IronPython] Ironpython & COM vs Jscript.Net & COM Message-ID: <08DC9C47E7F547B2BFBCF561824E1269@MCI1330> Re! I downloaded IronPython 2.6 b1. And my scripts run OK with this version. (remind : call/use dynamic COM servers). Sorry for trouble, because my prior messages. @-salutations -- Michel Claveau From Jimmy.Schementi at microsoft.com Mon Jun 29 07:51:30 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 29 Jun 2009 05:51:30 +0000 Subject: [IronPython] Silverlight onload is not getting called In-Reply-To: <24230948.post@talk.nabble.com> References: <24230948.post@talk.nabble.com> Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC18AFA5FA@tk5ex14mbxc106.redmond.corp.microsoft.com> Silverlight doesn't have a "onload" method, that's only in JavaScript, "window.onload". All IronPython code is run on Silverlight's System.Window.Application.Startup event, so you won't see that fired in IronPython since it has already occurred. However, you can hook the "Loaded" event on UserControl to see when all the controls are loaded. Isolated Storage shouldn't have anything to do with loading the app, unless there's an exception being raised when you're accessing Isolated Storage. Make sure your HTML page sets "initParams" to "reportErrors=errorLocation" to see any exceptions that you don't catch. Feel free to post the code which causes this error so I can track down the exact error. ~js > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of adhi.r > Sent: Saturday, June 27, 2009 12:09 AM > To: users at lists.ironpython.com > Subject: [IronPython] Silverlight onload is not getting called > > > Hi, > I'm using silverlight with ironpython with huge amount of modules, the > problem is some times the onload method of Silverlight is not getting called > hence the silverlight UI components are not getting displayed. I'm using > IsolatedStorage, and when I clear the storage and do refresh its working. > Can anyone help for this problem. > > Adhi > -- > View this message in context: http://www.nabble.com/Silverlight-onload-is- > not-getting-called-tp24230948p24230948.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 Jimmy.Schementi at microsoft.com Mon Jun 29 09:57:46 2009 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Mon, 29 Jun 2009 07:57:46 +0000 Subject: [IronPython] Simple example of using unittest in Silverlight Message-ID: <0047ECBFA2E0DF4A834AA369282A5AFC18AFA9CF@tk5ex14mbxc106.redmond.corp.microsoft.com> Here's a simple example of using unittest in Silverlight: http://blog.jimmy.schementi.com/2009/06/simple-python-testing-in-silverlight.html Michael, can you use this for your EuroPycon talk, or would you like something a bit more complex? I can do testing C# with IronPython, but only if you think it'll be useful in your talk and for the audience. ~Jimmy -------------- next part -------------- An HTML attachment was scrubbed... URL: From sabdelrazak at symbyo.com Mon Jun 29 18:05:33 2009 From: sabdelrazak at symbyo.com (Sarah Abdel Razak) Date: Mon, 29 Jun 2009 09:05:33 -0700 Subject: [IronPython] Running SPSS application from IronPython Message-ID: Hi All, I was using python and SPSS Python integration plug-in to access SPSS application and execute spss syntax commands. I was wondering if that can be achieved using IronPython as well. I try to import the spss module and added the python25/lib/site-packages to the IronPython path. But I got an exception that the module is not found. I would appreciate any advice. -- Sarah Abdelrazak -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Jun 29 19:11:34 2009 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 29 Jun 2009 18:11:34 +0100 Subject: [IronPython] Running SPSS application from IronPython In-Reply-To: References: Message-ID: <4A7B019E-69F5-4E07-A7CA-ED9579E24C86@voidspace.org.uk> Well - prima-facie an ImportError saying the module can't be found means that the path containing the package/module isn't in sys.path when you do the import (although it's *possible*) there is another problem. Try adding the path from the interactive interpreter and trying the import. Michael -- http://www.ironpythoninaction.com On 29 Jun 2009, at 17:05, Sarah Abdel Razak wrote: > Hi All, > > I was using python and SPSS Python integration plug-in to > access SPSS application and execute spss syntax commands. > I was wondering if that can be achieved using IronPython as well. > I try to import the spss module and added the python25/lib/site- > packages to the IronPython path. But I got an exception that the > module is not found. > I would appreciate any advice. > -- > Sarah Abdelrazak > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From sabdelrazak at symbyo.com Mon Jun 29 19:22:57 2009 From: sabdelrazak at symbyo.com (Sarah Abdel Razak) Date: Mon, 29 Jun 2009 10:22:57 -0700 Subject: [IronPython] Running SPSS application from IronPython In-Reply-To: <4A7B019E-69F5-4E07-A7CA-ED9579E24C86@voidspace.org.uk> References: <4A7B019E-69F5-4E07-A7CA-ED9579E24C86@voidspace.org.uk> Message-ID: Thanks for your reply I just knew that spss Python plugin has to be built for specific Python implementations. Unfortunately it does not support IronPython. Regards -- Sarah Abdelrazak On Mon, Jun 29, 2009 at 10:11 AM, Michael Foord wrote: > Well - prima-facie an ImportError saying the module can't be found means > that the path containing the package/module isn't in sys.path when you do > the import (although it's *possible*) there is another problem. > > Try adding the path from the interactive interpreter and trying the import. > > Michael > > > -- > http://www.ironpythoninaction.com > > > On 29 Jun 2009, at 17:05, Sarah Abdel Razak > wrote: > > Hi All, >> >> I was using python and SPSS Python integration plug-in to access >> SPSS application and execute spss syntax commands. >> I was wondering if that can be achieved using IronPython as well. >> I try to import the spss module and added the python25/lib/site-packages >> to the IronPython path. But I got an exception that the module is not found. >> I would appreciate any advice. >> -- >> Sarah Abdelrazak >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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 brian.curtin at gmail.com Mon Jun 29 19:40:43 2009 From: brian.curtin at gmail.com (Brian Curtin) Date: Mon, 29 Jun 2009 12:40:43 -0500 Subject: [IronPython] Running SPSS application from IronPython In-Reply-To: References: <4A7B019E-69F5-4E07-A7CA-ED9579E24C86@voidspace.org.uk> Message-ID: On Mon, Jun 29, 2009 at 12:22, Sarah Abdel Razak wrote: > Thanks for your reply I just knew that spss Python plugin has to be built > for specific Python implementations. > Unfortunately it does not support IronPython. > > Regards > -- > Sarah Abdelrazak > Even though they don't support it, it will probably still work. Is this SPSS module a C-extension or does it involve C-extensions? Have you tried what Michael suggested? -------------- next part -------------- An HTML attachment was scrubbed... URL: From sabdelrazak at symbyo.com Mon Jun 29 20:00:06 2009 From: sabdelrazak at symbyo.com (Sarah Abdel Razak) Date: Mon, 29 Jun 2009 11:00:06 -0700 Subject: [IronPython] Running SPSS application from IronPython In-Reply-To: References: <4A7B019E-69F5-4E07-A7CA-ED9579E24C86@voidspace.org.uk> Message-ID: No spss module is not a C-extension , I believe that part of it is implemented using java. At the begining of my module I add the following lines : import sys sys.path.extend([ r'c:\Python25\Lib', r'c:\Python25\Lib\site-packages', ]) sys.path.append(r'c:\Python25\Lib') sys.path.append(r'C:\Python25\Lib\site-packages') import spss ----> this line that throws the exception. I'm running the module from IronPython Studio. Regards -- Sarah Abdelrazak On Mon, Jun 29, 2009 at 10:40 AM, Brian Curtin wrote: > On Mon, Jun 29, 2009 at 12:22, Sarah Abdel Razak wrote: > >> Thanks for your reply I just knew that spss Python plugin has to be built >> for specific Python implementations. >> Unfortunately it does not support IronPython. >> >> Regards >> -- >> Sarah Abdelrazak >> > > Even though they don't support it, it will probably still work. Is this > SPSS module a C-extension or does it involve C-extensions? Have you tried > what Michael suggested? > > _______________________________________________ > 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 Marty.Nelson at symyx.com Mon Jun 29 22:55:20 2009 From: Marty.Nelson at symyx.com (Marty Nelson) Date: Mon, 29 Jun 2009 13:55:20 -0700 Subject: [IronPython] FW: IronPython question Message-ID: <515335F32AA04440B3DE6FEA1993E9AD045D91F1@srv-be-101.Symyx-IC.symyx.com> Using the Iron Python libraries for extensibility in a C# app, what do we need to do to make the Python module loadable? Quick question: I am trying to use a built-in Python module (not .NET) in a SN script, and I am not sure how to reference it. I tried: import urllib and I am getting: Symyx.Framework.Scripting.ScriptExecutionException: Exception executing script 'test.toolbarItem1'. No module named urllib ---> IronPython.Runtime.Exceptions.ImportException: No module named urllib Is it possible to use Python built-in modules? ======= 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 stephen.p.lepisto at intel.com Mon Jun 29 23:02:19 2009 From: stephen.p.lepisto at intel.com (Lepisto, Stephen P) Date: Mon, 29 Jun 2009 14:02:19 -0700 Subject: [IronPython] IronPython question In-Reply-To: <515335F32AA04440B3DE6FEA1993E9AD045D91F1@srv-be-101.Symyx-IC.symyx.com> References: <515335F32AA04440B3DE6FEA1993E9AD045D91F1@srv-be-101.Symyx-IC.symyx.com> Message-ID: <6AF28EB9F93A354894F2F3916DF6F96E0C75D4431F@orsmsx510.amr.corp.intel.com> You have to have a version of CPython installed such as v2.5 (for IronPython 2.0) or v2.6 (for IronPython 2.6). >From IronPython: import sys sys.path.append(r'\c:\python25\lib') # adjust to whatever version of CPython you have installed. import urllib From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Marty Nelson Sent: Monday, June 29, 2009 1:55 PM To: Discussion of IronPython Subject: [IronPython] FW: IronPython question Using the Iron Python libraries for extensibility in a C# app, what do we need to do to make the Python module loadable? Quick question: I am trying to use a built-in Python module (not .NET) in a SN script, and I am not sure how to reference it. I tried: import urllib and I am getting: Symyx.Framework.Scripting.ScriptExecutionException: Exception executing script 'test.toolbarItem1'. No module named urllib ---> IronPython.Runtime.Exceptions.ImportException: No module named urllib Is it possible to use Python built-in modules? ======= 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 curt at hagenlocher.org Mon Jun 29 23:14:53 2009 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 29 Jun 2009 14:14:53 -0700 Subject: [IronPython] IronPython question In-Reply-To: <6AF28EB9F93A354894F2F3916DF6F96E0C75D4431F@orsmsx510.amr.corp.intel.com> References: <515335F32AA04440B3DE6FEA1993E9AD045D91F1@srv-be-101.Symyx-IC.symyx.com> <6AF28EB9F93A354894F2F3916DF6F96E0C75D4431F@orsmsx510.amr.corp.intel.com> Message-ID: >From hosting, you can call ScriptEngine.SetSearchPaths to achieve a similar effect. On Mon, Jun 29, 2009 at 2:02 PM, Lepisto, Stephen P < stephen.p.lepisto at intel.com> wrote: > You have to have a version of CPython installed such as v2.5 (for > IronPython 2.0) or v2.6 (for IronPython 2.6). > > > > From IronPython: > > > > import sys > > sys.path.append(r?\c:\python25\lib?) # adjust to whatever version of > CPython you have installed. > > import urllib > > > > > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Marty Nelson > *Sent:* Monday, June 29, 2009 1:55 PM > *To:* Discussion of IronPython > *Subject:* [IronPython] FW: IronPython question > > > > Using the Iron Python libraries for extensibility in a C# app, what do we > need to do to make the Python module loadable? > > > > > > Quick question: I am trying to use a built-in Python module (not .NET) in > a SN script, and I am not sure how to reference it. I tried: > > > > import urllib > > > > and I am getting: > > > > Symyx.Framework.Scripting.ScriptExecutionException: Exception executing > script 'test.toolbarItem1'. No module named urllib ---> > IronPython.Runtime.Exceptions.ImportException: No module named urllib > > > > > > Is it possible to use Python built-in modules? > > ======= > 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 gzlist at googlemail.com Tue Jun 30 00:29:23 2009 From: gzlist at googlemail.com (Martin (gzlist)) Date: Mon, 29 Jun 2009 23:29:23 +0100 Subject: [IronPython] Bazaar on IronPython Message-ID: For anyone who is interested, I have done a little work getting the DVCS bazaar working on IronPython 2.0 and 2.6 - please see this message and attached patch: I've yet to have a chance to go through the codeplex bugtracker and match up the issues I ran across against existing tickets or file new ones, but I do intend to get to that. Also, thanks to Jeff Hardy for his zlib emulation library. He has already released a new version incorporating the testcases I sent, with the issues fixed. I think the module, or something along the same lines, should be included in the base release. Martin From dinov at microsoft.com Tue Jun 30 01:44:46 2009 From: dinov at microsoft.com (Dino Viehland) Date: Mon, 29 Jun 2009 23:44:46 +0000 Subject: [IronPython] Bazaar on IronPython In-Reply-To: References: Message-ID: <1A472770E042064698CB5ADC83A12ACD033E93DD@TK5EX14MBXC116.redmond.corp.microsoft.com> Good work, it's very cool to see this - if you see an existing bug or open a new please make sure to mention that it effects Bazaar and we'll treat it with a higher priority. In general that goes for any large body of existing Python code. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin (gzlist) Sent: Monday, June 29, 2009 3:29 PM To: users at lists.ironpython.com Subject: [IronPython] Bazaar on IronPython For anyone who is interested, I have done a little work getting the DVCS bazaar working on IronPython 2.0 and 2.6 - please see this message and attached patch: I've yet to have a chance to go through the codeplex bugtracker and match up the issues I ran across against existing tickets or file new ones, but I do intend to get to that. Also, thanks to Jeff Hardy for his zlib emulation library. He has already released a new version incorporating the testcases I sent, with the issues fixed. I think the module, or something along the same lines, should be included in the base release. Martin _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From adhi.ramanathan at orangescape.com Tue Jun 30 08:48:22 2009 From: adhi.ramanathan at orangescape.com (adhi.r) Date: Mon, 29 Jun 2009 23:48:22 -0700 (PDT) Subject: [IronPython] Silverlight onload is not getting called In-Reply-To: <0047ECBFA2E0DF4A834AA369282A5AFC18AFA5FA@tk5ex14mbxc106.redmond.corp.microsoft.com> References: <24230948.post@talk.nabble.com> <0047ECBFA2E0DF4A834AA369282A5AFC18AFA5FA@tk5ex14mbxc106.redmond.corp.microsoft.com> Message-ID: <24266952.post@talk.nabble.com> Hi Jimmy, thanks for your reply. Actually I meant onload event of Silverlight control only. In the onload method I'm calling a init() function which will get the Silverlight control which I'll use it to call the managed code through C# interface. I agree that Isolated Storage shouldn't have anything to do with loading the app, (I'm not getting any errors, I've set the initParams) but if I deleted the application storage and do the refresh with out any other changes, the onload() function is getting called. Also during that problem the UI elements of Silverlight also not getting displayed and if I call the init() function explicitly the Silverlight control is getting assigned and I'm able to call the managed code. But still the UI elements are not displaying. Here is my code related to the problem <div id='errorLocation' style="font-size: small;color: Gray;"></div> <div id="progressbar" class="progressbar"> <object id = "SilverLight" data="data:application/x-silverlight," type="application/x-silverlight-2" width="300px" height="22px"> <param name="source" value="orangescape.xap"/> <param name="splashscreensource" value="SplashScreen.xaml"/> <param name="onSourceDownloadProgressChanged" value="onSourceDownloadProgressChanged" /> <param name="onSourceDownloadComplete" value="onSourceDownloadComplete" /> <param name="onload" value="onLoad"/> <param name="background" value="transparent" /> <param name="onerror" value="onSilverlightError"/> <param name="initParams" value="reportErrors=errorLocation"/> <param name="windowless" value="true"/> </object> </div> So if I call the init explicitly except UI the control objects are working fine. adhi Jimmy Schementi wrote: > > Silverlight doesn't have a "onload" method, that's only in JavaScript, > "window.onload". All IronPython code is run on Silverlight's > System.Window.Application.Startup event, so you won't see that fired in > IronPython since it has already occurred. However, you can hook the > "Loaded" event on UserControl to see when all the controls are loaded. > > Isolated Storage shouldn't have anything to do with loading the app, > unless there's an exception being raised when you're accessing Isolated > Storage. Make sure your HTML page sets "initParams" to > "reportErrors=errorLocation" to see any exceptions that you don't catch. > > Feel free to post the code which causes this error so I can track down the > exact error. > > ~js > >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users- >> bounces at lists.ironpython.com] On Behalf Of adhi.r >> Sent: Saturday, June 27, 2009 12:09 AM >> To: users at lists.ironpython.com >> Subject: [IronPython] Silverlight onload is not getting called >> >> >> Hi, >> I'm using silverlight with ironpython with huge amount of modules, the >> problem is some times the onload method of Silverlight is not getting >> called >> hence the silverlight UI components are not getting displayed. I'm using >> IsolatedStorage, and when I clear the storage and do refresh its working. >> Can anyone help for this problem. >> >> Adhi >> -- >> View this message in context: >> http://www.nabble.com/Silverlight-onload-is- >> not-getting-called-tp24230948p24230948.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 > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- View this message in context: http://www.nabble.com/Silverlight-onload-is-not-getting-called-tp24230948p24266952.html Sent from the IronPython mailing list archive at Nabble.com. From merllab at microsoft.com Tue Jun 30 17:52:45 2009 From: merllab at microsoft.com (merllab at microsoft.com) Date: Tue, 30 Jun 2009 08:52:45 -0700 Subject: [IronPython] IronPython 2.6 CodePlex Source Update Message-ID: <647c185a-8811-4427-b044-e351edf5230c@tk5-exsmh-c102.redmond.corp.microsoft.com> This is an automated email letting you know that sources have recently been pushed out. You can download these newer sources directly from http://ironpython.codeplex.com/SourceControl/changeset/view/55753. ADDED SOURCES $/IronPython/IronPython_Main/Src/Tests/interop/net/type/test_clrtype.py MODIFIED SOURCES $/IronPython/IronPython_Main/Src/Hosts/SilverLight/Microsoft.Scripting.Silverlight/Repl.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/ExpandoObject.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Actions/CallSite.cs $/IronPython/IronPython_Main/Config/Unsigned/App.config $/IronPython/IronPython_Main/Config/Signed/App.config $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Utils/TypeExtensions.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/TypeUtils.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Compiler/DelegateHelpers.Generated.cs $/IronPython/IronPython_Main/Src/Runtime/Microsoft.Scripting.Core/Ast/LambdaExpression.cs $/IronPython/IronPython_Main/Src/Tests/interop/net/type/test_clrtype.py $/IronPython/IronPython_Main/Src/Tests/test_cliclass.py CHECKIN COMMENTS -------------------------------------------------------------------------------- Changeset Id: 968415 Date: 6/29/2009 1:31:18 PM (dfugate) Moved __clrtype__ related test cases out of test_cliclass.py and into interop.net.type.test_clrtype. (Shelveset: CLRTYPE1;REDMOND\dfugate | SNAP CheckinId: 8812)