From sanxiyn at gmail.com Wed Feb 1 02:59:41 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Wed, 1 Feb 2006 10:59:41 +0900 Subject: [IronPython] fake socket for IronPython (incomplete) Message-ID: <5b0248170601311759n19a7ac46x@mail.gmail.com> I coded fake Python socket module for IronPython. Here it is (65 lines): http://sparcs.kaist.ac.kr/~tinuviel/devel/fepy/socket.py It's incomplete, but it does run minimal example programs from Python Library Reference, so I decided to share it anyway. http://docs.python.org/lib/socket-example.html Try echo_server.py and echo_client.py from this directory: http://sparcs.kaist.ac.kr/~tinuviel/devel/fepy/example/ Any suggestions? Seo Sanghyeon From giles.thomas at resolversystems.com Wed Feb 1 20:10:09 2006 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Wed, 01 Feb 2006 19:10:09 +0000 Subject: [IronPython] Issues with methods as event handlers? Message-ID: <43E10791.6020209@resolversystems.com> Hi all, When we use bound methods as Windows Forms event handlers, we can't detach them. Functions work OK. To see the problem, run up the attached button_method.py using IronPythonConsole; if you click on the "Trigger" button, you'll see a log message in the console saying that the trigger method has been called. Click on the "Remove" button to remove the event handler, and then click on the "Trigger" button again - you'll still get the log message. So the event handler was not detached correctly. By contrast, if you do the same thing using button_function.py, you will see that once you have clicked on "Remove", the "Trigger" button's handler will be correctly detached, so further clicks on that button will not generate log messages. We've tested against beta 2, beta 1, and 0.9.5 (which latter doesn't display the button labels but otherwise behaves as described above). Hope this helps someone :-) Cheers, Giles -- Giles Thomas Resolver Systems giles.thomas at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: button_method.py URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: button_function.py URL: From giles.thomas at resolversystems.com Wed Feb 1 20:19:51 2006 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Wed, 01 Feb 2006 19:19:51 +0000 Subject: [IronPython] Issues with methods as event handlers? In-Reply-To: <43E10791.6020209@resolversystems.com> References: <43E10791.6020209@resolversystems.com> Message-ID: <43E109D7.8090002@resolversystems.com> Hi all, I attach an example of a workaround for the problem. Cheers, Giles -- Giles Thomas Resolver Systems giles.thomas at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ Giles Thomas wrote: > Hi all, > > When we use bound methods as Windows Forms event handlers, we can't > detach them. Functions work OK. > > To see the problem, run up the attached button_method.py using > IronPythonConsole; if you click on the "Trigger" button, you'll see a > log message in the console saying that the trigger method has been > called. Click on the "Remove" button to remove the event handler, and > then click on the "Trigger" button again - you'll still get the log > message. So the event handler was not detached correctly. > > By contrast, if you do the same thing using button_function.py, you will > see that once you have clicked on "Remove", the "Trigger" button's > handler will be correctly detached, so further clicks on that button > will not generate log messages. > > We've tested against beta 2, beta 1, and 0.9.5 (which latter doesn't > display the button labels but otherwise behaves as described above). > > Hope this helps someone :-) > > > Cheers, > > Giles -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: button_pseudo_method.py URL: From sanxiyn at gmail.com Thu Feb 2 07:53:34 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 2 Feb 2006 15:53:34 +0900 Subject: [IronPython] struct module and sys.byteorder Message-ID: <5b0248170602012253r7308eb88k@mail.gmail.com> struct module is currently missing. In the mean time there's pure Python one at: http://codespeak.net/svn/pypy/dist/pypy/lib/struct.py But importing it raises AttributeError because sys.byteorder is missing in IronPython. Here's a workaround to put in site.py: import System import sys if System.Net.IPAddress.NetworkToHostOrder(1) == 1: sys.byteorder = 'big' else: sys.byteorder = 'little' Hope this help, Seo Sanghyeon From sanxiyn at gmail.com Thu Feb 2 11:04:23 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 2 Feb 2006 19:04:23 +0900 Subject: [IronPython] Creating Python file from .NET stream? Message-ID: <5b0248170602020204n52d854eep@mail.gmail.com> Is it possible to create Python file from .NET stream? IronPython/Runtime/PythonFile.cs seems to have code to do this, but I couldn't find a way to call this from Python side. Seo Sanghyeon From adnand.dragoti at chello.at Thu Feb 2 17:54:45 2006 From: adnand.dragoti at chello.at (adnand dragoti) Date: Thu, 02 Feb 2006 17:54:45 +0100 Subject: [IronPython] Accessing the Engine's module Message-ID: <43E23955.2040702@chello.at> Hi, is there any way to access the PythonEngine's module and frame (they are declared private) ? Thanks in advance Nandi From dinov at exchange.microsoft.com Thu Feb 2 18:19:18 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 2 Feb 2006 09:19:18 -0800 Subject: [IronPython] Issues with methods as event handlers? In-Reply-To: <43E10791.6020209@resolversystems.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E015D338A@df-foxhound-msg.exchange.corp.microsoft.com> Another option that should work is: class ClickListener: def trigger(self, source, args): print "..." a = ClickListener() b = a.trigger triggerButton.Click += b triggerButton.Click -= b What you're experiencing is the fact that trigger is actually just a callable object. When you do a.trigger you get a new bound method object that is different from the bound method object you get back when you do the -=. We should see if there's a way for us to fix this to match expecations so I'll go ahead and make sure we get the bug filed. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Giles Thomas Sent: Wednesday, February 01, 2006 11:10 AM To: Discussion of IronPython Subject: [IronPython] Issues with methods as event handlers? Hi all, When we use bound methods as Windows Forms event handlers, we can't detach them. Functions work OK. To see the problem, run up the attached button_method.py using IronPythonConsole; if you click on the "Trigger" button, you'll see a log message in the console saying that the trigger method has been called. Click on the "Remove" button to remove the event handler, and then click on the "Trigger" button again - you'll still get the log message. So the event handler was not detached correctly. By contrast, if you do the same thing using button_function.py, you will see that once you have clicked on "Remove", the "Trigger" button's handler will be correctly detached, so further clicks on that button will not generate log messages. We've tested against beta 2, beta 1, and 0.9.5 (which latter doesn't display the button labels but otherwise behaves as described above). Hope this helps someone :-) Cheers, Giles -- Giles Thomas Resolver Systems giles.thomas at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ From giles.thomas at resolversystems.com Fri Feb 3 11:52:40 2006 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Fri, 03 Feb 2006 10:52:40 +0000 Subject: [IronPython] Issues with methods as event handlers? In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E015D338A@df-foxhound-msg.exchange.corp.microsoft.com> References: <4039D552ADAB094BB1EA670F3E96214E015D338A@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <43E335F8.8010904@resolversystems.com> Dino, That makes sense, thanks for the clarification. Regards, Giles -- Giles Thomas Resolver Systems giles.thomas at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ Dino Viehland wrote: > Another option that should work is: > > class ClickListener: > def trigger(self, source, args): > print "..." > > a = ClickListener() > b = a.trigger > > triggerButton.Click += b > > triggerButton.Click -= b > > > What you're experiencing is the fact that trigger is actually just a callable object. When you do a.trigger you get a new bound method object that is different from the bound method object you get back when you do the -=. > > We should see if there's a way for us to fix this to match expecations so I'll go ahead and make sure we get the bug filed. > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Giles Thomas > Sent: Wednesday, February 01, 2006 11:10 AM > To: Discussion of IronPython > Subject: [IronPython] Issues with methods as event handlers? > > Hi all, > > When we use bound methods as Windows Forms event handlers, we can't > detach them. Functions work OK. > > To see the problem, run up the attached button_method.py using > IronPythonConsole; if you click on the "Trigger" button, you'll see a > log message in the console saying that the trigger method has been > called. Click on the "Remove" button to remove the event handler, and > then click on the "Trigger" button again - you'll still get the log > message. So the event handler was not detached correctly. > > By contrast, if you do the same thing using button_function.py, you will > see that once you have clicked on "Remove", the "Trigger" button's > handler will be correctly detached, so further clicks on that button > will not generate log messages. > > We've tested against beta 2, beta 1, and 0.9.5 (which latter doesn't > display the button labels but otherwise behaves as described above). > > Hope this helps someone :-) > > > Cheers, > > Giles From paparipote at hotmail.com Fri Feb 3 17:43:38 2006 From: paparipote at hotmail.com (Paparipote .) Date: Fri, 03 Feb 2006 12:43:38 -0400 Subject: [IronPython] Values of sys.argv do not show when .exe IP program is executed. Message-ID: Hello: I have the next code in a file named test.py: import sys for i in sys.argv: print i when running the next command: ironpythonconsole test.py one two three four It gets: test.py one two three four I could see that IP generates .exe files; it is a good thing. All programs I made until now work well when I invoke the .exe ones. In the case of test.exe, however, the parameters are not shown when I execute in this way: $ Test one two three four $ What is wrong? Best regards. _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ From dinov at exchange.microsoft.com Fri Feb 3 17:49:57 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 3 Feb 2006 08:49:57 -0800 Subject: [IronPython] Values of sys.argv do not show when .exe IP program is executed. In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E015D3BC1@df-foxhound-msg.exchange.corp.microsoft.com> It's just an oversight - We're not setting sys.argv in PythonEngine.ExecuteCompiled, so we just need to do: engine.sys.argv = List.Make(Environment.GetCommandLineArgs()); then you should get the arguments. Thanks for the report - I'll get a bug opened on it for beta 3. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote . Sent: Friday, February 03, 2006 8:44 AM To: users at lists.ironpython.com Subject: [IronPython] Values of sys.argv do not show when .exe IP program is executed. Hello: I have the next code in a file named test.py: import sys for i in sys.argv: print i when running the next command: ironpythonconsole test.py one two three four It gets: test.py one two three four I could see that IP generates .exe files; it is a good thing. All programs I made until now work well when I invoke the .exe ones. In the case of test.exe, however, the parameters are not shown when I execute in this way: $ Test one two three four $ What is wrong? Best regards. _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Fri Feb 3 23:30:39 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 3 Feb 2006 14:30:39 -0800 Subject: [IronPython] Slicing an array In-Reply-To: <5b0248170601310231y2be06b4aq@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0167212F@df-foxhound-msg.exchange.corp.microsoft.com> Jim, Martin and I discussed this today and we're looking at providing some array creation functionality via the clr module. This will be different from jarray in that you'll be able to use the raw CLR arrays w/o a wrapper. We would then make slicing work on arrays by making them appear as though they were sliceable - no wrapper object necessary. I'll reply again when we have a better estimate of when this will show up. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Tuesday, January 31, 2006 2:32 AM To: users at lists.ironpython.com Subject: [IronPython] Slicing an array E:\IronPython-1.0-Beta2>ip IronPython 1.0.2216 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import System >>> buffer = System.Array.CreateInstance(System.Byte, 10) >>> buffer[:5] Traceback (most recent call last): File , line 0, in input##2 NotImplementedError: The method or operation is not implemented. >>> Is this planned to be implemented? If so, when? Will IronPython have something like http://www.jython.org/docs/jarray.html ? Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From sanxiyn at gmail.com Sat Feb 4 02:56:06 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sat, 4 Feb 2006 10:56:06 +0900 Subject: [IronPython] fake socket for IronPython (incomplete) In-Reply-To: <5b0248170601311759n19a7ac46x@mail.gmail.com> References: <5b0248170601311759n19a7ac46x@mail.gmail.com> Message-ID: <5b0248170602031756p4d371179j@mail.gmail.com> 2006/2/1, Sanghyeon Seo : > I coded fake Python socket module for IronPython. Here it is (65 lines): > http://sparcs.kaist.ac.kr/~tinuviel/devel/fepy/socket.py I now moved this. Sorry for inconvinience. http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/ Also added DNS functions from System.Net.Dns and getsockname/getpeername method on socket object. Seo Sanghyeon From Martin.Maly at microsoft.com Sat Feb 4 20:07:07 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sat, 4 Feb 2006 11:07:07 -0800 Subject: [IronPython] Values of sys.argv do not show when .exe IP program is executed. In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E015D3BC1@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F50153784B@df-foxhound-msg.exchange.corp.microsoft.com> Given the stage of development IronPython is in, IronPython does generate the exes and pdbs as it compiles Python scripts. However, the right way to generate the exes from Python scripts for the long-term is the IronPython.Hosting.PythonCompiler class so I would encourage you to use that as a means to compile scripts to exes. As you try this, you'll notice that the sys.argv doesn't get handled correctly that way either. It's because the by-product compiled exes share the same code path, so by fixing one, we fix both. However, even so, using the PythonCompiler is preferred, especially since the by-product generated exes may actually go away at some point, or they may be generated only in some cases (debugging, caching of pre-compiled scripts ...). Another advantage is that the PythonCompiler allows compiling multiple Python scripts into one exe so you actually get better results. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Friday, February 03, 2006 8:50 AM To: Discussion of IronPython Subject: Re: [IronPython] Values of sys.argv do not show when .exe IP program is executed. It's just an oversight - We're not setting sys.argv in PythonEngine.ExecuteCompiled, so we just need to do: engine.sys.argv = List.Make(Environment.GetCommandLineArgs()); then you should get the arguments. Thanks for the report - I'll get a bug opened on it for beta 3. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote . Sent: Friday, February 03, 2006 8:44 AM To: users at lists.ironpython.com Subject: [IronPython] Values of sys.argv do not show when .exe IP program is executed. Hello: I have the next code in a file named test.py: import sys for i in sys.argv: print i when running the next command: ironpythonconsole test.py one two three four It gets: test.py one two three four I could see that IP generates .exe files; it is a good thing. All programs I made until now work well when I invoke the .exe ones. In the case of test.exe, however, the parameters are not shown when I execute in this way: $ Test one two three four $ What is wrong? Best regards. _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Sat Feb 4 20:19:52 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sat, 4 Feb 2006 11:19:52 -0800 Subject: [IronPython] Creating Python file from .NET stream? In-Reply-To: <5b0248170602020204n52d854eep@mail.gmail.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501537850@df-foxhound-msg.exchange.corp.microsoft.com> At this point, I fear, you are right that there is no easy way to call the constructor that accepts Stream, even though we do have it in the code (the Make methods with __new__ attribute take precedence). However, I think this is a great suggestion and we'll look into it. Thanks! Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Thursday, February 02, 2006 2:04 AM To: Discussion of IronPython Subject: [IronPython] Creating Python file from .NET stream? Is it possible to create Python file from .NET stream? IronPython/Runtime/PythonFile.cs seems to have code to do this, but I couldn't find a way to call this from Python side. Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Sat Feb 4 20:25:20 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sat, 4 Feb 2006 11:25:20 -0800 Subject: [IronPython] Accessing the Engine's module In-Reply-To: <43E23955.2040702@chello.at> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501537853@df-foxhound-msg.exchange.corp.microsoft.com> No, unfortunately. But I am curious to know what you would need from Python Engine that you don't get without accessing the frame and module directly. Our motivation is to come up with solid interface on the PythonEngine so any feedback on its possible deficiencies is absolutely welcome. Thanks! Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of adnand dragoti Sent: Thursday, February 02, 2006 8:55 AM To: Discussion of IronPython Subject: [IronPython] Accessing the Engine's module Hi, is there any way to access the PythonEngine's module and frame (they are declared private) ? Thanks in advance Nandi _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From ivan.chollet at lynanda.com Sat Feb 4 22:38:43 2006 From: ivan.chollet at lynanda.com (ivan chollet) Date: Sat, 4 Feb 2006 22:38:43 +0100 Subject: [IronPython] IDE In-Reply-To: <002401c6250c$93879790$6400a8c0@darkhorse> Message-ID: <20060204213840.3F6591818D@smtp6-g19.free.fr> OK, sorry for being late. (I can only work on IronPython IDE in the week end) Actually, I set up a Subversion repository for the source code. The address is http://lynanda.com/svn/IronPython-IDE/ . This way you can have the latest sources. There is a small web site where I explain a few things. The address is http://lynanda.com/ironpython-ide/index.php/Main_Page I expect to set everything up (a decent collaborative workspace in particular) this Sunday (Paris time.) For those who want to have write access to the repository, give me your email address and I'll provide you with a login/password. Best Regards to all, Ivan _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Daniel Nguyen Sent: dimanche 29 janvier 2006 20:45 To: 'Discussion of IronPython' Subject: Re: [IronPython] IDE Hi Ivan, My skill may seem as questionable to some developers, but I'd like to help develop this IDE. So, if you don't mind for someone like me to pitch in, please let me know what I need to do to get start. Thanks, Daniel -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of ivan chollet Sent: Saturday, January 28, 2006 7:39 AM To: 'Discussion of IronPython' Subject: [IronPython] IDE Hi fellows Python scripters, As I had nice feedback for the IPython IDE, I'm proud to announce you that I've put the source code on my webpage. I share it under a no-license scheme or the sqlite-like license if you prefer. You can find it at http://www.lynanda.com/Members/ichollet/ivan-chollet-s-blog-pages/ironpython -ide-source-code Actually, I'd like to know if some people would be interested in helping me to develop the IDE in little bit further. According to some messages on this IronPython mailing list, a lot of people would like to have a Python debugger, like the one in VS.NET. (This won't be a trivial job, and it would maybe need some coordination with the IronPython development team. In fact I've put the emphasis on separating the engine code and the IDE code, so that the same IDE code can be ported across IronPython version, but I won't be able to do that if I should program an IronPython debugger) I think that the debugging facilities are crucial for the popularity of a language and a development environment. Best regards to all, Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: From catherine.devlin at gmail.com Sun Feb 5 14:34:23 2006 From: catherine.devlin at gmail.com (Catherine Devlin) Date: Sun, 5 Feb 2006 08:34:23 -0500 Subject: [IronPython] GotDotNet UserSamples now support IronPython Message-ID: <6523e39a0602050534h2fd55bby2ba197cc1ac99a5@mail.gmail.com> Hi! Just thought I'd let everybody know... At the GotDotNet "User Samples" site, IronPython is now an official language! That means you can flag a code sample as being in IronPython, and find IronPython samples with the search-by-language dropdown. http://gotdotnet.com/community/usersamples/ At the moment, mine is the only sample you'll find there... but hopefully that won't be true for long! The dropdown choices are C++, C#, J#, VB.NET, IronPython, and "Other Languages". I'm pleased that we didn't get lumped in with the "Other Languages"! -- - Catherine http://catherinedevlin.blogspot.com/ From adnand.dragoti at chello.at Mon Feb 6 11:31:10 2006 From: adnand.dragoti at chello.at (adnand dragoti) Date: Mon, 06 Feb 2006 11:31:10 +0100 Subject: [IronPython] Accessing the Engine's module In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F501537853@df-foxhound-msg.exchange.corp.microsoft.com> References: <5C0A6F919D675745BB1DBA7412DB68F501537853@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <43E7256E.1050604@chello.at> Martin Maly wrote: > No, unfortunately. But I am curious to know what you would need from Python Engine that you don't get without accessing the frame and module directly. Our motivation is to come up with solid interface on the PythonEngine so any feedback on its possible deficiencies is absolutely welcome. > > Thanks! > Martin > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of adnand dragoti > Sent: Thursday, February 02, 2006 8:55 AM > To: Discussion of IronPython > Subject: [IronPython] Accessing the Engine's module > > Hi, > > is there any way to access the PythonEngine's module and frame (they are > declared private) ? > > Thanks in advance > Nandi > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > Hi Martin, thanks for your response. Now, to satisfy your curiosity, I'm playing around with a GUI console for IronPython (with intellisense, call tips and so on ...). In order to get the same interactive behaviour as the standard console I implemented the IConsole interface and thought it would be great if I could reuse "DoOneInteractive". Unfortunately, you need to pass a Frame parameter there. If you create your own Module and Frame then you have to overwrite all the methods which implicitly use PythonEngine's private _module and _frame (and _context) : "Evaluate", "GetVariable", "SetVariable",... (that's what I've actually done) This is in no way a satisfactory and elegant solution. Furthermore, I wanted to "inject" a simple function in the interpreter. I've maybe overseen something, but the only way I found to do it was : engine.SetVariable(new Function0(module,"functionName", new CallTarget0( ... ) )) In this case too, you need to have a module. My suggestion would be to have PythonEngine's contructor accept an optional Frame as argument: public PythonEngine(Frame top_frame) { ... if(top_frame==null) { _module = new PythonModule("__main__", new Dict()); topFrame = new Frame(_module); } else { topFrame=top_frame; _module=topFrame.__module__; } ... } public PythonEngine() : this(null) {} That will solve all the problems above. By the way, while examining the code of "DoOneInteractive" I discovered the following at line 322 (I'm referring to Beta 2): if (context.TrueDivision) { _module.TrueDivision = true; // shouldn't it be topFrame.__module__.TrueDivision ? } Many thanks for your attention, Keep this excellent work going, Nandi From sanxiyn at gmail.com Tue Feb 7 12:02:21 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 7 Feb 2006 20:02:21 +0900 Subject: [IronPython] Builtin functions are never bound Message-ID: <5b0248170602070302n6085936br@mail.gmail.com> In CPython, there is an assumption that builtin functions are never bound. What an obscure stuff. Hopefully an example would clarify this. # ex.py class C: method = cmp c = C() print c.method(1, 1) $ python ex.py 0 $ ip ex.py Traceback (most recent call last): File __main__, line unknown, in Initialize TypeError: cmp() takes exactly 2 arguments (3 given) PyPy has suffered this too: http://codespeak.net/pipermail/pypy-svn/2005-May/004905.html Standard library modules like optparse and unittest are known to rely on this. I don't like this quirk at all, but perhaps you want to know these stuffs... Seo Sanghyeon From meisterli at gmx.de Tue Feb 7 12:14:33 2006 From: meisterli at gmx.de (meisterli at gmx.de) Date: Tue, 7 Feb 2006 12:14:33 +0100 (MET) Subject: [IronPython] Using IronPython classes in C#... Message-ID: <31883.1139310873@www024.gmx.net> Hi is it possible to write IronPython classes and use this classes in C# like all other assemblies imported by adding a reference to it? This would imply the ability of IronPython to generate .NET assemblies. Does any one know about that? Thanks Markus From william at resolversystems.com Tue Feb 7 15:13:26 2006 From: william at resolversystems.com (William Reade) Date: Tue, 07 Feb 2006 14:13:26 +0000 Subject: [IronPython] Nitpicking: Message-ID: <43E8AB06.7000508@resolversystems.com> "lambda" appears to be misspelled here: ----------------------- IronPython 1.0.2216 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> lambda x : x ----------------------- Cheers William -- We're hiring! From dinov at exchange.microsoft.com Tue Feb 7 17:47:24 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 7 Feb 2006 08:47:24 -0800 Subject: [IronPython] Builtin functions are never bound In-Reply-To: <5b0248170602070302n6085936br@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0171B3B0@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the bug report - we actually still have a little cleanup to do in the area of built-in functions, but it's great to have this one extra edge case on the radar before we get there. I've filed the bug in our database but I'm not entirely sure when we'll get to this one, but hopefully soon. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Tuesday, February 07, 2006 3:02 AM To: Discussion of IronPython Subject: [IronPython] Builtin functions are never bound In CPython, there is an assumption that builtin functions are never bound. What an obscure stuff. Hopefully an example would clarify this. # ex.py class C: method = cmp c = C() print c.method(1, 1) $ python ex.py 0 $ ip ex.py Traceback (most recent call last): File __main__, line unknown, in Initialize TypeError: cmp() takes exactly 2 arguments (3 given) PyPy has suffered this too: http://codespeak.net/pipermail/pypy-svn/2005-May/004905.html Standard library modules like optparse and unittest are known to rely on this. I don't like this quirk at all, but perhaps you want to know these stuffs... Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Feb 7 18:00:49 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 7 Feb 2006 09:00:49 -0800 Subject: [IronPython] Using IronPython classes in C#... In-Reply-To: <31883.1139310873@www024.gmx.net> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0171B3D2@df-foxhound-msg.exchange.corp.microsoft.com> IronPython does have a compiler but it's not currently exposed. Unfortunately it probably won't do what you want right now. While it is getting compiled as an assembly the methods you define on a class don't show up as being methods in the IL, and your class doesn't show up as a normal class. Instead everything ends up as being a bunch of functions, a derived "new type" (derived from your base type), and initialization code so we can later create instances of your "type". Unfortunately this isn't an easy problem to solve, so there's on ETA on when exactly we'd have this support. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of meisterli at gmx.de Sent: Tuesday, February 07, 2006 3:15 AM To: users at lists.ironpython.com Subject: [IronPython] Using IronPython classes in C#... Hi is it possible to write IronPython classes and use this classes in C# like all other assemblies imported by adding a reference to it? This would imply the ability of IronPython to generate .NET assemblies. Does any one know about that? Thanks Markus _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jvm_cop at spamcop.net Tue Feb 7 19:11:00 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Tue, 07 Feb 2006 13:11:00 -0500 Subject: [IronPython] Using IronPython classes in C#... In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E0171B3D2@df-foxhound-msg.e xchange.corp.microsoft.com> References: <31883.1139310873@www024.gmx.net> Message-ID: <4.3.2.7.2.20060207131028.051f0450@mail.comcast.net> At 12:00 PM 2/7/2006, Dino Viehland wrote (in part) >Unfortunately this isn't an easy problem to solve, so there's on ETA on when exactly we'd have this support. Did you mean "no ETA" (vs "on ETA")? J. Merrill / Analytical Software Corp From dinov at exchange.microsoft.com Tue Feb 7 19:14:49 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 7 Feb 2006 10:14:49 -0800 Subject: [IronPython] Using IronPython classes in C#... In-Reply-To: <4.3.2.7.2.20060207131028.051f0450@mail.comcast.net> Message-ID: <4039D552ADAB094BB1EA670F3E96214E0171B4B5@df-foxhound-msg.exchange.corp.microsoft.com> Doh! Yep, I sure did. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Tuesday, February 07, 2006 10:11 AM To: Discussion of IronPython Subject: Re: [IronPython] Using IronPython classes in C#... At 12:00 PM 2/7/2006, Dino Viehland wrote (in part) >Unfortunately this isn't an easy problem to solve, so there's on ETA on when exactly we'd have this support. Did you mean "no ETA" (vs "on ETA")? J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From sanxiyn at gmail.com Wed Feb 8 01:34:25 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Wed, 8 Feb 2006 09:34:25 +0900 Subject: [IronPython] tempfile.mktemp Message-ID: <5b0248170602071634l2b311206x@mail.gmail.com> Currently, tempfile module doesn't import on IronPython for various reasons. If you only need tempfile.mktemp, this should be enough: # tempfile.py import System mktemp = System.IO.Path.GetTempFileName Seo Sanghyeon From sanxiyn at gmail.com Wed Feb 8 01:46:29 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Wed, 8 Feb 2006 09:46:29 +0900 Subject: [IronPython] fake _codecs for IronPython Message-ID: <5b0248170602071646q3cc3cc1h@mail.gmail.com> Here you will find _codecs.py for IronPython so that you can use CPython's codecs module unmodified: http://sparcs.kaist.ac.kr/~tinuviel/fepy/lib/ It is definitely incomplete and doesn't perform any error handling at all, but it does reasonable job for most common cases. In particular, you can use Jason Orendorff's path.py with this. The module 100% works as far as I can tell, but unittests can't be run because of a bug (not related to path.py) I already reported. path.py is here: http://www.jorendorff.com/articles/python/path/ Seo Sanghyeon From h.t.g.weffers at tue.nl Wed Feb 8 13:10:08 2006 From: h.t.g.weffers at tue.nl (Weffers, H.T.G.) Date: Wed, 8 Feb 2006 13:10:08 +0100 Subject: [IronPython] Question (Novice) on using Microsoft Excel via IronPython Message-ID: <9F38CF35D80CAE409B979F3EB5242B4A03EE4A9D@winex2.campus.tue.nl> If the following is a too frequently asked question, then please forgive me. Being a novice in the use of IronPython and Python I spent a significant amount of time trying to find the answer to the below question in a FAQ list, but until now I did not (yet) find a (pointer to a) useful answer. Using IronPython (on a Microsoft Windows XP platform) I want to develop an application that takes data from a specific range of cells in a Microsoft Excel Workbook (file), processes the relevant data, and then creates a graph representation using GraphViz. What I am currently most looking for is a way of accessing the specific data in the Microsoft Excel file, preferably using the most recent beta of Microsoft IronPython effectively 'exploiting' its .Net capabilities. Concrete suggestions for or pointers to (similar) solutions are appreciated. Sincerely yours, Harold Weffers -------------- next part -------------- An HTML attachment was scrubbed... URL: From info at geatec.com Wed Feb 8 17:00:27 2006 From: info at geatec.com (J. de Hooge) Date: Wed, 8 Feb 2006 17:00:27 +0100 Subject: [IronPython] Question (Novice) on using Microsoft Excel viaIronPython In-Reply-To: <9F38CF35D80CAE409B979F3EB5242B4A03EE4A9D@winex2.campus.tue.nl> Message-ID: <000501c62cc8$c78b8a10$6402a8c0@GEADELL> Sorry, I forgot where I found this, but maybe it helps. # this example starts Excel, creates a new workbook, # puts some text in the first and second cell # closes the workbook without saving the changes # and closes Excel. This happens really fast, so # you may want to comment out some lines and add them # back in one at a time ... or do the commands interactively from win32com.client import Dispatch xlApp = Dispatch("Excel.Application") xlApp.Visible = 1 xlApp.Workbooks.Add() xlApp.ActiveSheet.Cells(1,1).Value = 'Python Rules!' xlApp.ActiveWorkbook.ActiveSheet.Cells(1,2).Value = 'Python Rules 2!' xlApp.ActiveWorkbook.Close(SaveChanges=0) xlApp.Quit() del xlApp # raw_input("press Enter ...") Kind regards Jacques de Hooge info at geatec.com -----Oorspronkelijk bericht----- Van: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Namens Weffers, H.T.G. Verzonden: Wednesday, February 08, 2006 1:10 PM Aan: users at lists.ironpython.com Onderwerp: [IronPython] Question (Novice) on using Microsoft Excel viaIronPython If the following is a too frequently asked question, then please forgive me. Being a novice in the use of IronPython and Python I spent a significant amount of time trying to find the answer to the below question in a FAQ list, but until now I did not (yet) find a (pointer to a) useful answer. Using IronPython (on a Microsoft Windows XP platform) I want to develop an application that takes data from a specific range of cells in a Microsoft Excel Workbook (file), processes the relevant data, and then creates a graph representation using GraphViz. What I am currently most looking for is a way of accessing the specific data in the Microsoft Excel file, preferably using the most recent beta of Microsoft IronPython effectively 'exploiting' its .Net capabilities. Concrete suggestions for or pointers to (similar) solutions are appreciated. Sincerely yours, Harold Weffers -------------- next part -------------- An HTML attachment was scrubbed... URL: From ionrock at gmail.com Wed Feb 8 17:15:38 2006 From: ionrock at gmail.com (Eric Larson) Date: Wed, 8 Feb 2006 10:15:38 -0600 Subject: [IronPython] Question (Novice) on using Microsoft Excel viaIronPython In-Reply-To: <000501c62cc8$c78b8a10$6402a8c0@GEADELL> References: <9F38CF35D80CAE409B979F3EB5242B4A03EE4A9D@winex2.campus.tue.nl> <000501c62cc8$c78b8a10$6402a8c0@GEADELL> Message-ID: <6e46dd1e0602080815x5448fde6k83d1160f960fee03@mail.gmail.com> Could you also connect to a COM object (or do something similar) and then use IronPython similar to VBScript? I am not sure, but this may have been what the original poster wanted. Of course I could be wrong and simply putting my hopes to use IronPython as a macro language on the table :) Eric On 2/8/06, J. de Hooge wrote: > > Sorry, I forgot where I found this, but maybe it helps? > > > > # this example starts Excel, creates a new workbook, > > # puts some text in the first and second cell > > # closes the workbook without saving the changes > > # and closes Excel. This happens really fast, so > > # you may want to comment out some lines and add them > > # back in one at a time ... or do the commands interactively > > > > from win32com.client import Dispatch > > > > xlApp = Dispatch("Excel.Application") > > xlApp.Visible = 1 > > xlApp.Workbooks.Add() > > xlApp.ActiveSheet.Cells(1,1).Value = 'Python Rules!' > > xlApp.ActiveWorkbook.ActiveSheet.Cells(1,2).Value = 'Python Rules 2!' > > xlApp.ActiveWorkbook.Close(SaveChanges=0) > > xlApp.Quit() > > del xlApp > > > > # raw_input("press Enter ...") > > > > Kind regards > > Jacques de Hooge > > info at geatec.com > > > > > > -----Oorspronkelijk bericht----- > *Van:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *Namens *Weffers, H.T.G. > *Verzonden:* Wednesday, February 08, 2006 1:10 PM > *Aan:* users at lists.ironpython.com > *Onderwerp:* [IronPython] Question (Novice) on using Microsoft Excel > viaIronPython > > > > If the following is a too frequently asked question, then please > > forgive me. > > > > Being a novice in the use of IronPython and Python I spent a > > significant amount of time trying to find the answer to the below > > question in a FAQ list, but until now I did not (yet) find a (pointer > > to a) useful answer. > > > > Using IronPython (on a Microsoft Windows XP platform) I want to > > develop an application that takes data from a specific range of > > cells in a Microsoft Excel Workbook (file), processes the relevant > > data, and then creates a graph representation using GraphViz. > > > > What I am currently most looking for is a way of accessing the > > specific data in the Microsoft Excel file, preferably using the > > most recent beta of Microsoft IronPython effectively 'exploiting' > > its .Net capabilities. > > > > Concrete suggestions for or pointers to (similar) solutions are > > appreciated. > > > > Sincerely yours, > > > > Harold Weffers > > > > _______________________________________________ > 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 riltim at gmail.com Wed Feb 8 17:25:29 2006 From: riltim at gmail.com (Tim Riley) Date: Wed, 8 Feb 2006 11:25:29 -0500 Subject: [IronPython] Question (Novice) on using Microsoft Excel via IronPython In-Reply-To: <9F38CF35D80CAE409B979F3EB5242B4A03EE4A9D@winex2.campus.tue.nl> References: <9F38CF35D80CAE409B979F3EB5242B4A03EE4A9D@winex2.campus.tue.nl> Message-ID: Check the Ironpython tutorial included with IronPython. There is a section titled "Tutorial 3: IronPython and COM interoperability". Best of luck, Tim Riley On 2/8/06, Weffers, H.T.G. wrote: > > If the following is a too frequently asked question, then please > forgive me. > > Being a novice in the use of IronPython and Python I spent a > significant amount of time trying to find the answer to the below > question in a FAQ list, but until now I did not (yet) find a (pointer > to a) useful answer. > > Using IronPython (on a Microsoft Windows XP platform) I want to > develop an application that takes data from a specific range of > cells in a Microsoft Excel Workbook (file), processes the relevant > data, and then creates a graph representation using GraphViz. > > What I am currently most looking for is a way of accessing the > specific data in the Microsoft Excel file, preferably using the > most recent beta of Microsoft IronPython effectively 'exploiting' > its .Net capabilities. > > Concrete suggestions for or pointers to (similar) solutions are > appreciated. > > Sincerely yours, > > > Harold Weffers > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From korpse-ironpython at kaydash.za.net Wed Feb 8 17:36:17 2006 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Wed, 08 Feb 2006 18:36:17 +0200 Subject: [IronPython] Question (Novice) on using Microsoft Excel via IronPython In-Reply-To: <9F38CF35D80CAE409B979F3EB5242B4A03EE4A9D@winex2.campus.tue.nl> References: <9F38CF35D80CAE409B979F3EB5242B4A03EE4A9D@winex2.campus.tue.nl> Message-ID: <43EA1E01.2080107@kaydash.za.net> Weffers, H.T.G. wrote: > Being a novice in the use of IronPython and Python I spent a > significant amount of time trying to find the answer to the below > question in a FAQ list, but until now I did not (yet) find a (pointer > to a) useful answer. > What I am currently most looking for is a way of accessing the > specific data in the Microsoft Excel file, preferably using the > most recent beta of Microsoft IronPython effectively 'exploiting' > its .Net capabilities. Hi Harold, The real hurdle isn't IronPython, it's doing something useful with a COM (yuck) object. I recently had to do some inter-operating with a COM (yuck) object, which was, needless to say, rather painful; I'm hoping I can save you some of that pain. I'd just like to point out that I'm using Office 2003 and IronPython 1.0b2 and that I'd rather not promise anything other different circumstances. The first thing you'll need to do is convert the Excel type library to a .NET assembly using "tlbimp.exe" (I'm using the Visual C# 2005 Express Edition and mine is located in "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin") like so: C:\...\>IronPython-1.0-Beta2>tlbimp /out:excel.dll "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" Microsoft (R) .NET Framework Type Library to Assembly Converter 2.0.50727.42 Copyright (C) Microsoft Corporation. All rights reserved. TlbImp : warning TI0000 : The type library importer could not convert the signature for the member 'DISPPARAMS.rgvarg'. TlbImp : warning TI0000 : The type library importer could not convert the signature for the member 'DISPPARAMS.rgdispidNamedArgs'. Type library imported to C:\...\IronPython-1.0-Beta2\excel.dll I've attached a script that I wrote in order to demonstrate how to use this assembly, it assumes that the assembly is called "excel.dll" and that it is in the current directory. Here's some example output: C:\...\>IronPython-1.0-Beta2>IronPythonConsole.exe xl.py pc.xls A2 A3:A5 -- Values for the range: A2 u'MSI K8N SLI-F 939 pin AMD\xae Athlon\x2122 64 Processor ATX Mainboard' -- Values for the range: A3:A5 u'AMD\xae Athlon 64\x2122 3200+/800Mhz (Boxed)' 'DDR400 2Gb PC3200 400Mhz (Kit of 2 pieces 1Gb)' 'Western Digital Caviar \xae SE 320.0Gb 7200RPM + 8MB Buffer SATA150' Don't forget to call .Quit on the Excel Application object otherwise you'll get Excel processes hanging around. As far as a reference for this goes, the best I could do was adding a reference to the "Microsoft Excel 11 Object Library" COM (yuck) library from the "Add Reference" dialog within Visual Studio and then using the object browser to browse the namespace. Objects that you can instantiate are usually prefixed with the word "Class", the rest seem to be interfaces or abstract objects of sorts, this confused me a bit when I first poked around. You'll find a few code snippets of doing this sort of thing in the .NET framework documentation but their namespaces are usually named differently, which must be as a result of Visual Studio's conversion process. Hope this helps. -- Jonathan When you meet a master swordsman, show him your sword. When you meet a man who is not a poet, do not show him your poem. -- Rinzai, ninth century Zen master -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: xl.py URL: From jvm_cop at spamcop.net Wed Feb 8 18:01:24 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Wed, 08 Feb 2006 12:01:24 -0500 Subject: [IronPython] Question (Novice) on using Microsoft Excel via IronPython In-Reply-To: <9F38CF35D80CAE409B979F3EB5242B4A03EE4A9D@winex2.campus.tue .nl> Message-ID: <4.3.2.7.2.20060208114235.0500d990@mail.comcast.net> There is very little, if any, advantage in attempting to "exploit .Net capabilities" when the goal of the task is to interact with code that is not based in .Net. Excel does not have a .Net-based API; it has only a COM-based API. It is both easier (less code to write, more available documentation) and more efficient (fewer "layers" to go through at execution time) to work with a COM-based API using unmanaged code rather than managed code. If you were to use non-Iron Python (there is another post that has some code showing some of the incantations needed) you would be at least as close to the goal. If you have a requirement to use a .Net language to complete the task, IronPython will be as good as anything. You will need to get hold of (and install) the "primary interop assemblies" (PIAs) for the version of Excel that you're using -- and, if the program is to run on someone else's machine eventually, you'll have to get them (and .Net 2 and IronPython) onto that machine as well. Holler if you need assistance with that. But I suggest you use "ordinary" Python for the task. Good luck! At 07:10 AM 2/8/2006, Weffers, H.T.G. wrote (in part) >What I am currently most looking for is a way of accessing the >specific data in the Microsoft Excel file, preferably using the >most recent beta of Microsoft IronPython effectively 'exploiting' >its .Net capabilities. J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Wed Feb 8 18:10:38 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Wed, 08 Feb 2006 12:10:38 -0500 Subject: [IronPython] Question (Novice) on using Microsoft Excel via IronPython In-Reply-To: <43EA1E01.2080107@kaydash.za.net> References: <9F38CF35D80CAE409B979F3EB5242B4A03EE4A9D@winex2.campus.tue.nl> <9F38CF35D80CAE409B979F3EB5242B4A03EE4A9D@winex2.campus.tue.nl> Message-ID: <4.3.2.7.2.20060208120626.04f4a008@mail.comcast.net> Unless you're using an old version of Excel (neither 2003 nor XP), the "use tlbimp to build a .Net assembly for Excel" part of this is both not necessary (MS has done it for you, by building the PIAs I mentioned in my other post) and not a good idea (for lots of reasons, some clear and others quite obscure). Other than that, this is a good post! At 11:36 AM 2/8/2006, Jonathan Jacobs wrote >Weffers, H.T.G. wrote: >>Being a novice in the use of IronPython and Python I spent a >>significant amount of time trying to find the answer to the below >>question in a FAQ list, but until now I did not (yet) find a (pointer >>to a) useful answer. > >>What I am currently most looking for is a way of accessing the >>specific data in the Microsoft Excel file, preferably using the >>most recent beta of Microsoft IronPython effectively 'exploiting' >>its .Net capabilities. > >Hi Harold, > >The real hurdle isn't IronPython, it's doing something useful with a COM (yuck) object. I recently had to do some inter-operating with a COM (yuck) object, which was, needless to say, rather painful; I'm hoping I can save you some of that pain. > >I'd just like to point out that I'm using Office 2003 and IronPython 1.0b2 and that I'd rather not promise anything other different circumstances. > >The first thing you'll need to do is convert the Excel type library to a .NET assembly using "tlbimp.exe" (I'm using the Visual C# 2005 Express Edition and mine is located in "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin") like so: > >C:\...\>IronPython-1.0-Beta2>tlbimp /out:excel.dll "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" >Microsoft (R) .NET Framework Type Library to Assembly Converter 2.0.50727.42 >Copyright (C) Microsoft Corporation. All rights reserved. > >TlbImp : warning TI0000 : The type library importer could not convert the signature for the member 'DISPPARAMS.rgvarg'. >TlbImp : warning TI0000 : The type library importer could not convert the signature for the member 'DISPPARAMS.rgdispidNamedArgs'. >Type library imported to C:\...\IronPython-1.0-Beta2\excel.dll > >I've attached a script that I wrote in order to demonstrate how to use this assembly, it assumes that the assembly is called "excel.dll" and that it is in the current directory. Here's some example output: > >C:\...\>IronPython-1.0-Beta2>IronPythonConsole.exe xl.py pc.xls A2 A3:A5 >-- Values for the range: A2 >u'MSI K8N SLI-F 939 pin AMD\xae Athlon\x2122 64 Processor ATX Mainboard' >-- Values for the range: A3:A5 >u'AMD\xae Athlon 64\x2122 3200+/800Mhz (Boxed)' >'DDR400 2Gb PC3200 400Mhz (Kit of 2 pieces 1Gb)' >'Western Digital Caviar \xae SE 320.0Gb 7200RPM + 8MB Buffer SATA150' > >Don't forget to call .Quit on the Excel Application object otherwise you'll get Excel processes hanging around. > >As far as a reference for this goes, the best I could do was adding a reference to the "Microsoft Excel 11 Object Library" COM (yuck) library from the "Add Reference" dialog within Visual Studio and then using the object browser to browse the namespace. Objects that you can instantiate are usually prefixed with the word "Class", the rest seem to be interfaces or abstract objects of sorts, this confused me a bit when I first poked around. > >You'll find a few code snippets of doing this sort of thing in the .NET framework documentation but their namespaces are usually named differently, which must be as a result of Visual Studio's conversion process. > >Hope this helps. >-- >Jonathan > >When you meet a master swordsman, >show him your sword. >When you meet a man who is not a poet, >do not show him your poem. > -- Rinzai, ninth century Zen master > > >import clr >clr.AddReferenceToFile('excel.dll') > >import sys >import excel >import System.IO.Directory > >app = excel.ApplicationClass() >app.DefaultFilePath = System.IO.Directory.GetCurrentDirectory() >wb = app.Workbooks.Open(sys.argv[1]) >ws = wb.ActiveSheet > >for arg in sys.argv[2:]: > print '-- Values for the range:', arg > for cell in ws.get_Range(arg): > print repr(cell.get_Value()) > >app.Quit() >_______________________________________________ >users mailing list >users at lists.ironpython.com >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com J. Merrill / Analytical Software Corp From info at geatec.com Thu Feb 9 12:05:45 2006 From: info at geatec.com (J. de Hooge) Date: Thu, 9 Feb 2006 12:05:45 +0100 Subject: [IronPython] Exception.StackTrace gone? Message-ID: <000001c62d68$c9d0c970$6402a8c0@GEADELL> Hi In IP 0.95 I used to be able to print the stacktrace of an exception as follows: . . . . . . except Exception, exception: . . . print str (exception) print exception.StackTrace . . . . . . . . . This fails in IP 1.0 Beta 2. Does anyone know why it fails, and, more important, how I still can print a stack trace? Kind regards Jacques de Hooge info at geatec.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From korpse-ironpython at kaydash.za.net Thu Feb 9 13:19:20 2006 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Thu, 09 Feb 2006 14:19:20 +0200 Subject: [IronPython] Exception.StackTrace gone? In-Reply-To: <000001c62d68$c9d0c970$6402a8c0@GEADELL> References: <000001c62d68$c9d0c970$6402a8c0@GEADELL> Message-ID: <43EB3348.4050702@kaydash.za.net> J. de Hooge wrote: > Does anyone know why it fails, and, more important, how I still can > print a stack trace? You could either use sys.exc_value or .clsException.StackTrace on Exception objects. I don't know if the latter is a reliable source. >>> import sys >>> try: ... raise NotImplementedError ... except Exception, e: ... print e.clsException.StackTrace ... print '*****' ... print sys.exc_value.StackTrace ... at IronPython.Runtime.Ops.Raise(Object type, Object value, Object traceback) at input##25(Frame ) ***** at IronPython.Runtime.Ops.Raise(Object type, Object value, Object traceback) at input##25(Frame ) >>> Hope this helps. -- Jonathan When you meet a master swordsman, show him your sword. When you meet a man who is not a poet, do not show him your poem. -- Rinzai, ninth century Zen master From korpse-ironpython at kaydash.za.net Thu Feb 9 13:22:12 2006 From: korpse-ironpython at kaydash.za.net (Jonathan Jacobs) Date: Thu, 09 Feb 2006 14:22:12 +0200 Subject: [IronPython] Exception.StackTrace gone? In-Reply-To: <43EB3348.4050702@kaydash.za.net> References: <000001c62d68$c9d0c970$6402a8c0@GEADELL> <43EB3348.4050702@kaydash.za.net> Message-ID: <43EB33F4.8060809@kaydash.za.net> Jonathan Jacobs wrote: > You could either use sys.exc_value or .clsException.StackTrace on > Exception objects. I don't know if the latter is a reliable source. Or you could use traceback.py from the Python standard library. -- Jonathan From info at geatec.com Thu Feb 9 15:33:48 2006 From: info at geatec.com (J. de Hooge) Date: Thu, 9 Feb 2006 15:33:48 +0100 Subject: [IronPython] Exception.StackTrace gone? In-Reply-To: <43EB3348.4050702@kaydash.za.net> Message-ID: <000501c62d85$d6b31a40$6402a8c0@GEADELL> Works like a charm. Thanks! Jacques -----Oorspronkelijk bericht----- Van: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Namens Jonathan Jacobs Verzonden: Thursday, February 09, 2006 1:19 PM Aan: Discussion of IronPython Onderwerp: Re: [IronPython] Exception.StackTrace gone? J. de Hooge wrote: > Does anyone know why it fails, and, more important, how I still can > print a stack trace? You could either use sys.exc_value or .clsException.StackTrace on Exception objects. I don't know if the latter is a reliable source. >>> import sys >>> try: .. raise NotImplementedError .. except Exception, e: .. print e.clsException.StackTrace .. print '*****' .. print sys.exc_value.StackTrace .. at IronPython.Runtime.Ops.Raise(Object type, Object value, Object traceback) at input##25(Frame ) ***** at IronPython.Runtime.Ops.Raise(Object type, Object value, Object traceback) at input##25(Frame ) >>> Hope this helps. -- Jonathan When you meet a master swordsman, show him your sword. When you meet a man who is not a poet, do not show him your poem. -- Rinzai, ninth century Zen master _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From h.t.g.weffers at tue.nl Thu Feb 9 17:44:30 2006 From: h.t.g.weffers at tue.nl (Weffers, H.T.G.) Date: Thu, 9 Feb 2006 17:44:30 +0100 Subject: [IronPython] Microsoft Excel via IronPython using PIAs on Windows XP Message-ID: <9F38CF35D80CAE409B979F3EB5242B4A03EE4E8A@winex2.campus.tue.nl> I received a number of suggestions using 'regular' Python and using PythonWin for Python2.4 and a number of received examples and code snippets I got it working. Thank you. Nevertheless, I also tried the suggestion on using IronPython with 'just' the PIAs. On a Microsoft WindowsXP platform running Microsoft Office2003 I installed the PIAs according to the accompanying documentation but this does not yield success: >>> import clr >>> clr.AddReferenceToFile("excel.dll") results in >>> RuntimeError: Could not add reference to assembly excel.dll Suggestions are appreciated.... Sincerely yours, Harold Weffers _____ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Wednesday, February 08, 2006 6:01 PM To: Discussion of IronPython Subject: Re: [IronPython] Question (Novice) on using Microsoft Excel via IronPython There is very little, if any, advantage in attempting to "exploit .Net capabilities" when the goal of the task is to interact with code that is not based in .Net. Excel does not have a .Net-based API; it has only a COM-based API. It is both easier (less code to write, more available documentation) and more efficient (fewer "layers" to go through at execution time) to work with a COM-based API using unmanaged code rather than managed code. If you were to use non-Iron Python (there is another post that has some code showing some of the incantations needed) you would be at least as close to the goal. If you have a requirement to use a .Net language to complete the task, IronPython will be as good as anything. You will need to get hold of (and install) the "primary interop assemblies" (PIAs) for the version of Excel that you're using -- and, if the program is to run on someone else's machine eventually, you'll have to get them (and .Net 2 and IronPython) onto that machine as well. Holler if you need assistance with that. But I suggest you use "ordinary" Python for the task. Good luck! -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Thu Feb 9 18:45:46 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Thu, 09 Feb 2006 12:45:46 -0500 Subject: [IronPython] Microsoft Excel via IronPython using PIAs on Windows XP In-Reply-To: <9F38CF35D80CAE409B979F3EB5242B4A03EE4E8A@winex2.campus.tue .nl> Message-ID: <4.3.2.7.2.20060209122241.051f4248@mail.comcast.net> There's no file "excel.dll" -- what made you think there was? The file that has the PIA for Excel is named 'Microsoft.Office.Interop.Excel.dll'. However, I have not attempted to load it with IP (I don't have Office 2003 on the same machine as IP). You will probably want to use clr.AddReference (rather than AddReferenceToFile) because the latter apparently requires a full path spec, and if you installed the PIAs using the provided file (O2003PIA.MSI) they end up in the GAC. At 11:44 AM 2/9/2006, Weffers, H.T.G. wrote (in part) >I received a number of suggestions using 'regular' Python and using >PythonWin for Python2.4 and a number of received examples and >code snippets I got it working. Thank you. > >Nevertheless, I also tried the suggestion on using IronPython with >'just' the PIAs. On a Microsoft WindowsXP platform running Microsoft >Office2003 I installed the PIAs according to the accompanying >documentation but this does not yield success: > >>>> import clr >>>> clr.AddReferenceToFile("excel.dll") > >results in > >>>> RuntimeError: Could not add reference to assembly excel.dll > >Suggestions are appreciated.... > >Sincerely yours, > >Harold Weffers >[snip] J. Merrill / Analytical Software Corp -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Feb 9 18:46:06 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 9 Feb 2006 09:46:06 -0800 Subject: [IronPython] Exception.StackTrace gone? In-Reply-To: <000501c62d85$d6b31a40$6402a8c0@GEADELL> Message-ID: <4039D552ADAB094BB1EA670F3E96214E017AEDCB@df-foxhound-msg.exchange.corp.microsoft.com> The fact that you can access this via exc_value.StackTrace is actually a bug - and one that's already fixed internally for our next release. So for now using the clsException field is the better way to go. Another alternative here is that you can also explicitly catch a CLS exception. Eg: import System try: ... except System.Exception, e: ... and we'll actually give you an instance of a CLR exception (with StackTrace) rather than a Python Exception class. The underlying theme here is that we give you what you ask for> And finally the BEST mechanism is obviously sys.exc_traceback / sys.exc_info()[2] for compatibility with CPython. But unfortunately we just haven't implemented this yet. We have a bug for 1.0 on this so it should be fixed during one of the upcoming betas. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. de Hooge Sent: Thursday, February 09, 2006 6:34 AM To: 'Discussion of IronPython' Subject: Re: [IronPython] Exception.StackTrace gone? Works like a charm. Thanks! Jacques -----Oorspronkelijk bericht----- Van: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] Namens Jonathan Jacobs Verzonden: Thursday, February 09, 2006 1:19 PM Aan: Discussion of IronPython Onderwerp: Re: [IronPython] Exception.StackTrace gone? J. de Hooge wrote: > Does anyone know why it fails, and, more important, how I still can > print a stack trace? You could either use sys.exc_value or .clsException.StackTrace on Exception objects. I don't know if the latter is a reliable source. >>> import sys >>> try: .. raise NotImplementedError .. except Exception, e: .. print e.clsException.StackTrace .. print '*****' .. print sys.exc_value.StackTrace .. at IronPython.Runtime.Ops.Raise(Object type, Object value, Object traceback) at input##25(Frame ) ***** at IronPython.Runtime.Ops.Raise(Object type, Object value, Object traceback) at input##25(Frame ) >>> Hope this helps. -- Jonathan When you meet a master swordsman, show him your sword. When you meet a man who is not a poet, do not show him your poem. -- Rinzai, ninth century Zen master _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From jeremystellsmith at gmail.com Fri Feb 10 05:06:35 2006 From: jeremystellsmith at gmail.com (Jeremy Stell-Smith) Date: Thu, 9 Feb 2006 22:06:35 -0600 Subject: [IronPython] Understanding the code Message-ID: I'm currently spiking out an "IronRuby". And I've been going to IronPython to see how y'all do things. It's been helpful, but there's not a lot of documentation and it's taking some time to figure things out (though reflector has been real helpful :) ). I was wondering if anyone had an IM they'd be willing to volunteer for small stupid questions, like "why is half of Ops generated?" or "what's the difference between a function1 and a function2?" Thanks, Jeremy Stell-Smith XP Coach/Developer ThoughtWorks -------------- next part -------------- An HTML attachment was scrubbed... URL: From jvm_cop at spamcop.net Fri Feb 10 06:02:21 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Fri, 10 Feb 2006 00:02:21 -0500 Subject: [IronPython] Understanding the code In-Reply-To: Message-ID: <4.3.2.7.2.20060210000051.05c576e8@mail.comcast.net> You know that the source code from IronPython is available, don't you? So you're reflecting on the assemblies that IP generates? That's perhaps not a fruitful use of your time, as they're planning on (major) changes to support making callable-from-other-.Net-languages DLLs / libraries. At 11:06 PM 2/9/2006, Jeremy Stell-Smith wrote >I'm currently spiking out an "IronRuby". And I've been going to IronPython to see how y'all do things. It's been helpful, but there's not a lot of documentation and it's taking some time to figure things out (though reflector has been real helpful :) ). > >I was wondering if anyone had an IM they'd be willing to volunteer for small stupid questions, like "why is half of Ops generated?" or "what's the difference between a function1 and a function2?" > >Thanks, > >Jeremy Stell-Smith >XP Coach/Developer >ThoughtWorks J. Merrill / Analytical Software Corp From textdirected at gmail.com Fri Feb 10 09:01:59 2006 From: textdirected at gmail.com (HEMMI, Shigeru) Date: Fri, 10 Feb 2006 17:01:59 +0900 Subject: [IronPython] eval('123.456E-19')*2.0 Message-ID: Hello, There seems to be a bug. IronPython 1.0.2223 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> eval('123.456E-19')*2.0 0.0 C:\MagnaFIM\license>python Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> eval('123.456E-19')*2.0 2.46912e-017 Regards, From stan at phidani.be Fri Feb 10 13:09:33 2006 From: stan at phidani.be (Stanislas Pinte) Date: Fri, 10 Feb 2006 13:09:33 +0100 Subject: [IronPython] Bug in engine.LoadAssembly(...) -> PythonImportError Message-ID: <1139573373.43ec827d929e8@webmail.raincode.com> Hello, I have troubles importing classes defined in my own assembly: [Release]> ./TestImport.exe Unhandled Exception: IronPython.Runtime.PythonImportError: No module named Other at IronPython.Runtime.ReflectedMethodBase.Invoke(MethodBinding binding) .. at TestAccessOtherNamespace.Initialize() in c:TempTestImportTestImportbin ReleaseTestAccessOtherNamespace.py:line 1 I am actually trying to give access to all the namespaces defined in the main assembly, like that: class Program { static void Main(string[] args) { PythonEngine engine = new PythonEngine(); //allow python scrupts to import all classes of my assembly engine.LoadAssembly(Assembly.GetAssembly(typeof(Program))); engine.AddToPath(@"."); engine.Import("TestAccessOtherNamespace"); } } Am I missing anything? See attached full source code (c# program, and python script). Thanks a lot, Stan. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Program.cs URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TestAccessOtherNamespace.py Type: application/octet-stream Size: 53 bytes Desc: not available URL: From ionrock at gmail.com Fri Feb 10 15:46:28 2006 From: ionrock at gmail.com (Eric Larson) Date: Fri, 10 Feb 2006 08:46:28 -0600 Subject: [IronPython] Visual Studio Integration Message-ID: <6e46dd1e0602100646p3453faaej81d39c955e9d0c94@mail.gmail.com> I was curious how/if I can use Visual Studio 2005 with IronPython. I realize that I probably *can* use it of course, but I was wondering about the obvious niceties such as intellisense and code highlighting. Great Stuff! Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeremystellsmith at gmail.com Fri Feb 10 16:18:15 2006 From: jeremystellsmith at gmail.com (Jeremy Stell-Smith) Date: Fri, 10 Feb 2006 09:18:15 -0600 Subject: [IronPython] Understanding the code In-Reply-To: <4.3.2.7.2.20060210000051.05c576e8@mail.comcast.net> References: <4.3.2.7.2.20060210000051.05c576e8@mail.comcast.net> Message-ID: no, I have the source, I'm going through it, but a combination of going through the source, and using reflector to change the IL back to csharp seems to be working, if slow. On 2/9/06, J. Merrill wrote: > > You know that the source code from IronPython is available, don't you? So > you're reflecting on the assemblies that IP generates? That's perhaps not a > fruitful use of your time, as they're planning on (major) changes to support > making callable-from-other-.Net-languages DLLs / libraries. > > At 11:06 PM 2/9/2006, Jeremy Stell-Smith wrote > >I'm currently spiking out an "IronRuby". And I've been going to > IronPython to see how y'all do things. It's been helpful, but there's not a > lot of documentation and it's taking some time to figure things out (though > reflector has been real helpful :) ). > > > >I was wondering if anyone had an IM they'd be willing to volunteer for > small stupid questions, like "why is half of Ops generated?" or "what's the > difference between a function1 and a function2?" > > > >Thanks, > > > >Jeremy Stell-Smith > >XP Coach/Developer > >ThoughtWorks > > > J. Merrill / Analytical Software Corp > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Fri Feb 10 17:46:00 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 10 Feb 2006 08:46:00 -0800 Subject: [IronPython] Understanding the code In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E017AF64E@df-foxhound-msg.exchange.corp.microsoft.com> The mailing list would be a great place for this - simply because it'd be nice if we could archive it rather than losing the data. The reason for Ops (and other classes being generated) is usually because they'd be a bunch of copy & paste code that would have to be maintained by hand. Instead we use Python scripts to generate this code so it's just all around easier to maintain, make updates and get everything right, not miss a spot, etc... Our functions are also like this (where we have fast paths for 0-5 arguments that are all generated) and there's lots of other spots. We cleaned this up a lot recently so generated code ends up in partial classes (that way it's easy to not accidentally modify this) and we've made sure they're all up to date as well. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jeremy Stell-Smith Sent: Friday, February 10, 2006 7:18 AM To: Discussion of IronPython Subject: Re: [IronPython] Understanding the code no, I have the source, I'm going through it, but a combination of going through the source, and using reflector to change the IL back to csharp seems to be working, if slow. On 2/9/06, J. Merrill wrote: You know that the source code from IronPython is available, don't you? So you're reflecting on the assemblies that IP generates? That's perhaps not a fruitful use of your time, as they're planning on (major) changes to support making callable-from-other-.Net-languages DLLs / libraries. At 11:06 PM 2/9/2006, Jeremy Stell-Smith wrote >I'm currently spiking out an "IronRuby". And I've been going to IronPython to see how y'all do things. It's been helpful, but there's not a lot of documentation and it's taking some time to figure things out (though reflector has been real helpful :) ). > >I was wondering if anyone had an IM they'd be willing to volunteer for small stupid questions, like "why is half of Ops generated?" or "what's the difference between a function1 and a function2?" > >Thanks, > >Jeremy Stell-Smith >XP Coach/Developer >ThoughtWorks J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Fri Feb 10 17:50:43 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 10 Feb 2006 08:50:43 -0800 Subject: [IronPython] eval('123.456E-19')*2.0 In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E017AF655@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the bug report, I'll get it filed and it seems like we should be able to get this one fixed for the next release. This is just a problem with displaying the actual value to its full precision. For example: print '%g' % (eval('123.456E-19')*2) Prints: 2.46912e-17 so the value is there, it comes back from eval fine, we multiply it fine, we just print it incorrectly. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of HEMMI, Shigeru Sent: Friday, February 10, 2006 12:02 AM To: users at lists.ironpython.com Subject: [IronPython] eval('123.456E-19')*2.0 Hello, There seems to be a bug. IronPython 1.0.2223 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> eval('123.456E-19')*2.0 0.0 C:\MagnaFIM\license>python Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> eval('123.456E-19')*2.0 2.46912e-017 Regards, _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Fri Feb 10 17:55:13 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 10 Feb 2006 08:55:13 -0800 Subject: [IronPython] Visual Studio Integration In-Reply-To: <6e46dd1e0602100646p3453faaej81d39c955e9d0c94@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E017AF65D@df-foxhound-msg.exchange.corp.microsoft.com> Our VSIP team's SDK includes a sample that integrates IronPython into VS. Aaron Marten has blogged about this here: http://blogs.msdn.com/aaronmar/ - but I don't think it's quite as easy as downloading a IronPython Express SKU just yet... I also don't know if we have all the niceties you want yet, but it is a start... ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Eric Larson Sent: Friday, February 10, 2006 6:46 AM To: Discussion of IronPython Subject: [IronPython] Visual Studio Integration I was curious how/if I can use Visual Studio 2005 with IronPython. I realize that I probably *can* use it of course, but I was wondering about the obvious niceties such as intellisense and code highlighting. Great Stuff! Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From Nathan.Ernst at citadelgroup.com Fri Feb 10 19:29:38 2006 From: Nathan.Ernst at citadelgroup.com (Ernst, Nathan) Date: Fri, 10 Feb 2006 12:29:38 -0600 Subject: [IronPython] Visual Studio Integration Message-ID: I apologize if this is covered in the VS SDK docs, but does the ironpython integration work on the express editions of VS? Thanks, Nathan ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Friday, February 10, 2006 10:55 AM To: Discussion of IronPython Subject: Re: [IronPython] Visual Studio Integration Our VSIP team's SDK includes a sample that integrates IronPython into VS. Aaron Marten has blogged about this here: http://blogs.msdn.com/aaronmar/ - but I don't think it's quite as easy as downloading a IronPython Express SKU just yet... I also don't know if we have all the niceties you want yet, but it is a start... ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Eric Larson Sent: Friday, February 10, 2006 6:46 AM To: Discussion of IronPython Subject: [IronPython] Visual Studio Integration I was curious how/if I can use Visual Studio 2005 with IronPython. I realize that I probably *can* use it of course, but I was wondering about the obvious niceties such as intellisense and code highlighting. Great Stuff! Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From Aaron.Marten at microsoft.com Fri Feb 10 19:36:54 2006 From: Aaron.Marten at microsoft.com (Aaron Marten) Date: Fri, 10 Feb 2006 10:36:54 -0800 Subject: [IronPython] Visual Studio Integration Message-ID: <5FCAA6E21F110544B8CD0EEBB51B0AE80179F1B8@RED-MSG-20.redmond.corp.microsoft.com> No, extensibility (addins & VSPackages) is not supported on any of the Visual Studio Express products. You'll need at least VS Standard Edition. Thanks, Aaron Marten ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ernst, Nathan Sent: Friday, February 10, 2006 10:30 AM To: Discussion of IronPython Subject: Re: [IronPython] Visual Studio Integration I apologize if this is covered in the VS SDK docs, but does the ironpython integration work on the express editions of VS? Thanks, Nathan ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Friday, February 10, 2006 10:55 AM To: Discussion of IronPython Subject: Re: [IronPython] Visual Studio Integration Our VSIP team's SDK includes a sample that integrates IronPython into VS. Aaron Marten has blogged about this here: http://blogs.msdn.com/aaronmar/ - but I don't think it's quite as easy as downloading a IronPython Express SKU just yet... I also don't know if we have all the niceties you want yet, but it is a start... ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Eric Larson Sent: Friday, February 10, 2006 6:46 AM To: Discussion of IronPython Subject: [IronPython] Visual Studio Integration I was curious how/if I can use Visual Studio 2005 with IronPython. I realize that I probably *can* use it of course, but I was wondering about the obvious niceties such as intellisense and code highlighting. Great Stuff! Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From paparipote at hotmail.com Sat Feb 11 17:28:07 2006 From: paparipote at hotmail.com (Paparipote .) Date: Sat, 11 Feb 2006 12:28:07 -0400 Subject: [IronPython] Using StreamReader.Read(char[], Int32, Int32) Message-ID: Hello: I need your guidelines please, I am a little (or very??) confused with the next: . . . r = StreamReader(file,System.Text.Encoding.Default) c=[] ?? r.Read(c,0,3) Traceback (most recent call last): File , line 0, in input##43 File mscorlib, line unknown, in Read ValueError: Offset and length were out of bounds for the array or count is greaer than the number of elements from index to the end of the source collection. if I write: c=[[],[],[]] r.Read(c,0,3) Traceback (most recent call last): File , line 0, in input##48 TypeError: bad args to this method Well ... the question is: how can I define an array of chars so I can avoid this message? Thanks. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From Martin.Maly at microsoft.com Sat Feb 11 19:58:08 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sat, 11 Feb 2006 10:58:08 -0800 Subject: [IronPython] Bug in engine.LoadAssembly(...) -> PythonImportError In-Reply-To: <1139573373.43ec827d929e8@webmail.raincode.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F50169CF1B@df-foxhound-msg.exchange.corp.microsoft.com> Your TestOther class is not public so IronPython can't access it, hence the exception. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Stanislas Pinte Sent: Friday, February 10, 2006 4:10 AM To: users at lists.ironpython.com Subject: [IronPython] Bug in engine.LoadAssembly(...) -> PythonImportError Hello, I have troubles importing classes defined in my own assembly: [Release]> ./TestImport.exe Unhandled Exception: IronPython.Runtime.PythonImportError: No module named Other at IronPython.Runtime.ReflectedMethodBase.Invoke(MethodBinding binding) .. at TestAccessOtherNamespace.Initialize() in c:TempTestImportTestImportbin ReleaseTestAccessOtherNamespace.py:line 1 I am actually trying to give access to all the namespaces defined in the main assembly, like that: class Program { static void Main(string[] args) { PythonEngine engine = new PythonEngine(); //allow python scrupts to import all classes of my assembly engine.LoadAssembly(Assembly.GetAssembly(typeof(Program))); engine.AddToPath(@"."); engine.Import("TestAccessOtherNamespace"); } } Am I missing anything? See attached full source code (c# program, and python script). Thanks a lot, Stan. From dinov at exchange.microsoft.com Mon Feb 13 17:41:11 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 13 Feb 2006 08:41:11 -0800 Subject: [IronPython] Using StreamReader.Read(char[], Int32, Int32) In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E01841A3A@df-foxhound-msg.exchange.corp.microsoft.com> The way you'll want to make an array is: import System System.Array.CreateInstance(System.Char, 3) Where 3 is the number of elements in the array. In the first case we're auto-marshalling your list into a byte[] array but we auto-marshal in a zero-length byte array (because you gave us a zero-length list). Note that we won't back-propagate any changes to your list here so this is only effective for incoming parameters. The 2nd case won't work because we can't convert the list to a byte. In Beta 3 we've also looked into improving array semantics in general. It looks like we'll have an additional form of syntax for creating arrays that are initialized w/ values. That tentatively looks like: System.Array[int](2,3,4,5) Where here we'd create an array of int's w/ 4 elements containing the values 2,3,4,5. But Array.CreateInstance remains the preferred syntax for creating arrays w/ no initial values. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote . Sent: Saturday, February 11, 2006 8:28 AM To: users at lists.ironpython.com Subject: [IronPython] Using StreamReader.Read(char[], Int32, Int32) Hello: I need your guidelines please, I am a little (or very??) confused with the next: . . . r = StreamReader(file,System.Text.Encoding.Default) c=[] ?? r.Read(c,0,3) Traceback (most recent call last): File , line 0, in input##43 File mscorlib, line unknown, in Read ValueError: Offset and length were out of bounds for the array or count is greaer than the number of elements from index to the end of the source collection. if I write: c=[[],[],[]] r.Read(c,0,3) Traceback (most recent call last): File , line 0, in input##48 TypeError: bad args to this method Well ... the question is: how can I define an array of chars so I can avoid this message? Thanks. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From gdavidson at aplicor.com Mon Feb 13 19:28:38 2006 From: gdavidson at aplicor.com (Gary Davidson) Date: Mon, 13 Feb 2006 13:28:38 -0500 Subject: [IronPython] ASp.net 2.0 Implementaiton Message-ID: <1D284A6C62755C4AA2437C54E9AC141B7E1A@us-br-hq-pdc-01.aplicor.local> My apologies if this has been answered, In the code behind of an aspx page engine.SetVariable("Host", this); engine.SetVariable("TextBox1", this.TextBox1); I can work with TextBox1 & Host in a script, but Host.TextBox1 does not work at all Any ideas? This is purely curiosity, I am not implementing it this way in my app. From yalvi at exchange.microsoft.com Tue Feb 7 18:42:58 2006 From: yalvi at exchange.microsoft.com (Yasir Alvi) Date: Tue, 7 Feb 2006 09:42:58 -0800 Subject: [IronPython] Nitpicking: In-Reply-To: <43E8AB06.7000508@resolversystems.com> Message-ID: <2D38793E06D9DE449285146407202692018D51DC@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the report. I've filed the bug in our database. Thanks, Yasir -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of William Reade Sent: Tuesday, February 07, 2006 6:13 AM To: Discussion of IronPython Subject: [IronPython] Nitpicking: "lambda" appears to be misspelled here: ----------------------- IronPython 1.0.2216 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> lambda x : x ----------------------- Cheers William -- We're hiring! _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From nikolaus.j.wagner at gmx.at Thu Feb 2 19:48:01 2006 From: nikolaus.j.wagner at gmx.at (Nikolaus Wagner) Date: Thu, 02 Feb 2006 19:48:01 +0100 Subject: [IronPython] Version 1.0 downloadable? Message-ID: <43E253E1.4030102@gmx.at> Hi! Where can I download the latest version of Ironpython? http://www.ironpython.com/ only has a nearly 2 year old version. Thanks, Nikolaus Wagner From kgmuller at xs4all.nl Thu Feb 2 07:56:57 2006 From: kgmuller at xs4all.nl (Klaus Muller) Date: Thu, 2 Feb 2006 07:56:57 +0100 Subject: [IronPython] SimPy on IronPython timing test Message-ID: <200602020657.k126v1Ax049550@smtp-vbr9.xs4all.nl> All: I have run a first simple benchmark to compare SimPy under IronPython with SimPy under CPython. I ran the following program: from SimPy.Simulation import * import time class Dum(Process): def run(self): yield hold,self,3 initialize() nrProcs=int(raw_input("Nr of processes?")) processes=[Dum("Dum%s"%x) for x in range(1,nrProcs)] for i in range(nrProcs): p=Dum("%s"%i) activate(p,p.run(),at=i) tStart=(time.clock(),time.time()) simulate(until=2*nrProcs) print "Ran in %s seconds for %s processes"%((time.clock()-tStart[0],time.time()-tStart[1]),nrProcs) raw_input("Hit any key . . .") Here are the results: Nr processes=10000 ------------------ IronPython: 2.06 seconds CPython: 0.5 seconds Nr processes=50000 ------------------ IronPython: 15.53 seconds CPython: 3.67 seconds At this moment, IronPython is clearly way slower than CPython on this benchmark. Clearly, it is early days for IronPython (this was run under beta release 2) and its developers will surely still optimize its performance a lot. If Microsoft actually support IronPython, this will be an important SimPy platform in the future and we will have to watch its further development. Klaus M?ller -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3936 bytes Desc: not available URL: From rsnair at avaya.com Mon Feb 6 19:38:13 2006 From: rsnair at avaya.com (Nair, Rankarajan S (Rankarajan S)) Date: Mon, 6 Feb 2006 10:38:13 -0800 Subject: [IronPython] IRON Python Syntax Coloring Message-ID: <5C7752CCB00C3A47A70D5C4204A360B20885F475@CAQ010AVEX1U.sv.avaya.com> Hi, Is there a plugin available for Visual Studio 2005 to High light the syntax of Python...? Thanks in Advance -Ranka Nair -------------- next part -------------- An HTML attachment was scrubbed... URL: From Lihong_Chen at maxtor.com Tue Feb 7 02:30:08 2006 From: Lihong_Chen at maxtor.com (Chen, Tom Li Hong) Date: Tue, 7 Feb 2006 09:30:08 +0800 Subject: [IronPython] FW: how to debug pthon script in IronPython Message-ID: <81D58019740F4B43B2840ACD407C70FC6558AC@tswexc03.corp.mxtr.net> Hi: Thanks for your help and your advice! But I don't want to make use of CLR Debugger to debug script. In CPython user only need pdb(pdb.py) module to debug python script. So user can debug python script in Python IDE (version: Python2.4). in your advice , if I want to debug python script , I must open CLR Debugger which is a tool of .NET framework. I want to develop a tool which can debug python script with C# language. I can't get C# source code of CLR Debugger, so I can't make use of CLR Debugger to debug python script. ( IronPython is free open source). I want to debug python script directly in IronPython console. Or there is some way to get C# source code of CLR Debugger, So that I can make use of CLR Debugger to debug python script. Or whether there is a alike module (like pdb in CPython) that support python script debugging service. Wish your help! Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan at ertmssolutions.com Wed Feb 8 13:46:53 2006 From: stan at ertmssolutions.com (Stanislas Pinte) Date: Wed, 8 Feb 2006 13:46:53 +0100 Subject: [IronPython] Question (Novice) on using Microsoft Excel via IronPython In-Reply-To: <9F38CF35D80CAE409B979F3EB5242B4A03EE4A9D@winex2.campus.tue.nl> References: <9F38CF35D80CAE409B979F3EB5242B4A03EE4A9D@winex2.campus.tue.nl> Message-ID: <1139402813.43e9e83d0674f@webmail.raincode.com> Selon "Weffers, H.T.G." : > If the following is a too frequently asked question, then please > forgive me. > > Being a novice in the use of IronPython and Python I spent a > significant amount of time trying to find the answer to the below > question in a FAQ list, but until now I did not (yet) find a (pointer > to a) useful answer. > > Using IronPython (on a Microsoft Windows XP platform) I want to > develop an application that takes data from a specific range of > cells in a Microsoft Excel Workbook (file), processes the relevant > data, and then creates a graph representation using GraphViz. > check the csharp sample here: http://www.thecodeproject.com/csharp/csharp_excel.asp it should be fairly straightforward to translate that to python directly, like import CLR.Excel workbookPath = "c:/SomeWorkBook.xls" excelWorkbook = excelApp.Workbooks.Open(workbookPath, 0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false); > What I am currently most looking for is a way of accessing the > specific data in the Microsoft Excel file, preferably using the > most recent beta of Microsoft IronPython effectively 'exploiting' > its .Net capabilities. > > Concrete suggestions for or pointers to (similar) solutions are > appreciated. > > Sincerely yours, > > > Harold Weffers > > > > -- ----------------------------------------------------------------- Stanislas Pinte e-mail: stan at ertmssolutions.com ERTMS Solutions http://www.ertmssolutions.com Rue de l'Autonomie, 1 Tel: + 322 - 522.06.63 1070 Bruxelles Fax: + 322 - 522.09.30 ----------------------------------------------------------------- From Shawn.Farkas at microsoft.com Tue Feb 14 02:04:23 2006 From: Shawn.Farkas at microsoft.com (Shawn Farkas) Date: Mon, 13 Feb 2006 17:04:23 -0800 Subject: [IronPython] FW: how to debug pthon script in IronPython In-Reply-To: <81D58019740F4B43B2840ACD407C70FC6558AC@tswexc03.corp.mxtr.net> Message-ID: The C# source code to the MDbg debugger is available here: http://www.microsoft.com/downloads/details.aspx?familyid=38449a42-6b7a-4e28-80ce-c55645ab1310&displaylang=en . Mike Stall often blogs about this set of code, you can find the archive of his posts here: http://blogs.msdn.com/jmstall/archive/category/7394.aspx. -Shawn ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Chen, Tom Li Hong Sent: Monday, February 06, 2006 5:30 PM To: users at lists.ironpython.com Cc: Ma, Wen Zhao Subject: [IronPython] FW: how to debug pthon script in IronPython Hi: Thanks for your help and your advice! But I don't want to make use of CLR Debugger to debug script. In CPython user only need pdb(pdb.py) module to debug python script. So user can debug python script in Python IDE (version: Python2.4). in your advice , if I want to debug python script , I must open CLR Debugger which is a tool of .NET framework. I want to develop a tool which can debug python script with C# language. I can't get C# source code of CLR Debugger, so I can't make use of CLR Debugger to debug python script. ( IronPython is free open source). I want to debug python script directly in IronPython console. Or there is some way to get C# source code of CLR Debugger, So that I can make use of CLR Debugger to debug python script. Or whether there is a alike module (like pdb in CPython) that support python script debugging service. Wish your help! Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From hys545 at dreamwiz.com Tue Feb 14 02:38:26 2006 From: hys545 at dreamwiz.com (=?EUC-KR?B?yLLAsby6?=) Date: Tue, 14 Feb 2006 10:38:26 +0900 (KST) Subject: [IronPython] Version 1.0 downloadable? In-Reply-To: <43E253E1.4030102@gmx.at> References: <43E253E1.4030102@gmx.at> Message-ID: <20060214013826.0000E20F01F20223@mail6.dreamwiz.com> New Homepage: http://workspaces.gotdotnet.com/ironpython ----- Original Message ----- From: "Nikolaus Wagner" nikolaus.j.wagner at gmx.at To: users at lists.ironpython.com Date: Thu, 02 Feb 2006 19:48:01 +0100 Subject: [IronPython] Version 1.0 downloadable? Hi! Where can I download the latest version of Ironpython? http://www.ironpython.com/ only has a nearly 2 year old version. Thanks, Nikolaus Wagner _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ------------------------------------------------- Your Life on the Net DreamWiz Free Mail @ http://www.dreamwiz.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.hsu at gmail.com Tue Feb 14 03:38:31 2006 From: richard.hsu at gmail.com (richard hsu) Date: Mon, 13 Feb 2006 21:38:31 -0500 Subject: [IronPython] Error while running sgmllib.py from Python 2.4 library Message-ID: Running: IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 C:\IronPython\Lib>ironpythonconsole sgmllib.py "c:\webhost\index.html" Traceback (most recent call last): File C:\Documents and Settings\user\My Documents\Develop\IronPython\Lib\sgmllib.py, line 511, in Initialize File C:\Documents and Settings\user\My Documents\Develop\IronPython\Lib\sgmllib.py, line 506, in test$f38 File C:\Documents and Settings\user\My Documents\Develop\IronPython\Lib\sgmllib.py, line 95, in feed$f4 File C:\Documents and Settings\user\My Documents\Develop\IronPython\Lib\sgmllib.py, line 116, in goahead$f7 TypeError: search() takes exactly 2 argument (3 given) I copied both sgmllib.py and its dependency markupbase.py into the IronPython's Lib directory before running the script. The two files are from Python 2.4 Library. The script runs with python 2.4 and prints out the html tags and data in the console. Mark Pilgrim's discusses sgmllib.py in Dive Into Python [ http://diveintopython.org/html_processing/introducing_sgmllib.html] My overall objective is to get IronPython to run Mark Pilgrim's feedparser.py [http://feedparser.org] feedparser.py imports sgmllib, re, sys, copy, urlparse, time, rfc822, types, cgi, urllib, urllib2, CStringIO/StringIO, gzip/zlib, xml.sax, base64, binascii, cjkcodecs.aliases and a few other modules. So, it will be interesting. Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Tue Feb 14 04:59:45 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 14 Feb 2006 12:59:45 +0900 Subject: [IronPython] Error during unittest initialization In-Reply-To: <08AAC77C2656414E91980F8EBB1E7F01037EFEF9@electra.corp.pharsight.com> References: <08AAC77C2656414E91980F8EBB1E7F01037EFEF9@electra.corp.pharsight.com> Message-ID: <5b0248170602131959k49f3678ds@mail.gmail.com> 2006/1/30, Greg Lee : > Using IronPython 1.0.2216 (Beta) on .NET 2.0.50727.42 to run this: > > (snip) > > Traceback (most recent call last): > File c:\box\test\testdmxmetadataeditor\foo.py, line 11, > in Initialize > File unittest, line unknown, in __init__$f196 > File c:\python24\lib\unittest.py, line 758, in __init__$f196 > File c:\python24\lib\unittest.py, line 787, in parseArgs$f198 > File c:\python24\lib\unittest.py, line 507, in loadTestsFromModule$f173 > File c:\python24\lib\unittest.py, line 495, in loadTestsFromTestCase$f172 > File c:\python24\lib\unittest.py, line 570, in getTestCaseNames$f176 > TypeError: cmp() takes exactly 2 argument (3 given) This is exactly the same bug I reported earlier: http://lists.ironpython.com/pipermail/users-ironpython.com/2006-February/001721.html One workaround is to edit unittest.py to change "cmp" to "staticmethod(cmp)" where appropriate. Hopefully this bug will be resolved soon... Seo Sanghyeon From dinov at exchange.microsoft.com Tue Feb 14 05:21:37 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 13 Feb 2006 20:21:37 -0800 Subject: [IronPython] Error during unittest initialization In-Reply-To: <5b0248170602131959k49f3678ds@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01842269@df-foxhound-msg.exchange.corp.microsoft.com> Soon indeed! We've got it fixed for the beta 3 release. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Monday, February 13, 2006 8:00 PM To: Discussion of IronPython Subject: Re: [IronPython] Error during unittest initialization 2006/1/30, Greg Lee : > Using IronPython 1.0.2216 (Beta) on .NET 2.0.50727.42 to run this: > > (snip) > > Traceback (most recent call last): > File c:\box\test\testdmxmetadataeditor\foo.py, line 11, > in Initialize > File unittest, line unknown, in __init__$f196 > File c:\python24\lib\unittest.py, line 758, in __init__$f196 > File c:\python24\lib\unittest.py, line 787, in parseArgs$f198 > File c:\python24\lib\unittest.py, line 507, in loadTestsFromModule$f173 > File c:\python24\lib\unittest.py, line 495, in loadTestsFromTestCase$f172 > File c:\python24\lib\unittest.py, line 570, in getTestCaseNames$f176 > TypeError: cmp() takes exactly 2 argument (3 given) This is exactly the same bug I reported earlier: http://lists.ironpython.com/pipermail/users-ironpython.com/2006-February/001721.html One workaround is to edit unittest.py to change "cmp" to "staticmethod(cmp)" where appropriate. Hopefully this bug will be resolved soon... Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Feb 14 18:00:43 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 14 Feb 2006 09:00:43 -0800 Subject: [IronPython] SimPy on IronPython timing test In-Reply-To: <200602020657.k126v1Ax049550@smtp-vbr9.xs4all.nl> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01842373@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the report Klaus. Currently we're mostly focused on correctness but later in the beta cycle we're going to come back and target perf pretty heavily. I've gone ahead and filed this in our bug database so we won't miss it when we get to that point. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Klaus Muller Sent: Wednesday, February 01, 2006 10:57 PM To: simpy-users at lists.sourceforge.net; 'Simpy-Developer List' Cc: users at lists.ironpython.com Subject: [IronPython] SimPy on IronPython timing test All: I have run a first simple benchmark to compare SimPy under IronPython with SimPy under CPython. I ran the following program: from SimPy.Simulation import * import time class Dum(Process): def run(self): yield hold,self,3 initialize() nrProcs=int(raw_input("Nr of processes?")) processes=[Dum("Dum%s"%x) for x in range(1,nrProcs)] for i in range(nrProcs): p=Dum("%s"%i) activate(p,p.run(),at=i) tStart=(time.clock(),time.time()) simulate(until=2*nrProcs) print "Ran in %s seconds for %s processes"%((time.clock()-tStart[0],time.time()-tStart[1]),nrProcs) raw_input("Hit any key . . .") Here are the results: Nr processes=10000 ------------------ IronPython: 2.06 seconds CPython: 0.5 seconds Nr processes=50000 ------------------ IronPython: 15.53 seconds CPython: 3.67 seconds At this moment, IronPython is clearly way slower than CPython on this benchmark. Clearly, it is early days for IronPython (this was run under beta release 2) and its developers will surely still optimize its performance a lot. If Microsoft actually support IronPython, this will be an important SimPy platform in the future and we will have to watch its further development. Klaus M?ller From almondb at gmail.com Tue Feb 14 18:49:49 2006 From: almondb at gmail.com (Brian) Date: Tue, 14 Feb 2006 09:49:49 -0800 Subject: [IronPython] Version 1.0 downloadable? In-Reply-To: <43DBE633.3030500@gmx.at> References: <43DBE633.3030500@gmx.at> Message-ID: <21f1e2700602140949l7ee1b356g5257e209466f4de2@mail.gmail.com> On 1/28/06, Nikolaus Wagner wrote: > > Hi! > Where can I download the latest version of Ironpython? > You can find the download links at the bottom of this, the IronPython "workspace" page: http://www.gotdotnet.com/workspaces/workspace.aspx?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742 -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Feb 16 00:48:43 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 15 Feb 2006 15:48:43 -0800 Subject: [IronPython] IronPython 1.0 Beta 3 Released! Message-ID: <4039D552ADAB094BB1EA670F3E96214E01901204@df-foxhound-msg.exchange.corp.microsoft.com> Hello IronPython Community, We have just released IronPython 1.0 Beta 3. This release is primarily a bug fix release as we drive towards IronPython 1.0. Unfortunately we didn?t get to review the PythonEngine APIs in this release but will be getting this done for the next beta. We also continue to work on improving CLR and Python interop. In this release we?ve added support for an assembly path (clr.Path) for assembly dependency resolution. If you?re currently using clr.AddReferenceToFile(???) you?ll need to modify these calls to update the path and then add a reference without a full path (this will ensure dependencies get resolved in an orderly fashion). We?ve also improved our array support, adding both slicing operations for arrays and a new array creation syntax: System.Array[int]((2,3,4,5)) will create an integer array with the values 2,3,4 and 5. Finally we continue to advance standard Python compatibility with the addition of a few new built-in modules: struct, codecs, and marshal. These are some of the most-requested modules from the community. You can download the release from: http://www.microsoft.com/downloads/details.aspx?FamilyId=F22E51E5-B82E-4A54-9CCC-3418E0BF5639&displaylang=en We'd like to thank everyone in the community for your bug reports and suggestions that helped make this a better release: allenwb, Flexibal, Giles Thomas, glchapman, Hector Miuler Malpica Gallegos, Shigeru Hemmi, Jesse Kaplan, John Platt, Matt Beckuis, Michael Shilman, Michael Twomey, Mike Hostetler, mrwizard82d1, Nicholas Jacobson, Paparipote, Ravi Terala, Sanghyeon Seo, Stanpinte, Thomas, and Vargaz. Thanks and keep in touch, The IronPython Team More complete list of changes and bug fixes: ============================================ Python CodeDom generator, parser, and compiler implemented Bugfix: string.split() throws incorrect exception Bugfix: Compiled module not initialized properly when imported Resource support for the compiler Bugfix: Compiler throw on invalid syntax Many parser fixes for handling invalid syntax Improved test support for running tests in multiple modes Bugfix: Exception.args cannot be accessed from Python code Bugfix: sys.exc_info()[1] in except block yields CLR exception instance, not Python exception instance Bugfix: Data from exception does not capture all arguments Bugfix: sys is missing sys.byteorder Built-in function enhancements Bugfix: Ctrl-C support in Console Bugfix: __str__ not working on new style classes Bugfix: implement ?x command line parameter Bugfix: Do not generate EXEs and PDBs as by-products by default (-X:SaveAssemblies overrides) Bugfix: Meta-classes not doing the right thing in some cases Bugfix: RE_Pattern.finditer() requires optional arguments Bugfix: re.groupindex() returns non-empty dictionary even w/ no symbol groups Bugfix: Context not flowing to compiled code when executed with eval Bugfix: Null reference exception in PythonEngine.DumpException Bugfix: sys.LoadAssemblyFromFile() should search sys.path for the specified assembly (searches clr.Path) Bugfix: Dynamic overloading of ReflectedMethod?s is broken Bugfix: Displaying a multi-dimensional array with lower-bounds is broken Bugfix: Conflict between IList and overloaded indexers Bugfix: list w/ a key isn?t a stable sort Bugfix: built-in functions shouldn?t ever be bound Bugfix: ReflectOptimizer can now properly distinguish between methods & static functions Bugfix: Finish cleanup of caller context changes Bugfix: typo in lambda Bugfix: NewTypeMaker single object array params may have adverse affects on keyword / params args Bugfix: Inheriting from built-in type damages super type Bugfix: MakeNew collisions resulting in unverifiable assemblies w/ NewTypeMaker Bugfix: Python class subclassing .NET class: constructor weirdness? Tutorial includes information on creating events from Python Bugfix: Eval still leaks for many corner-cases Bugfix: problems with exec Bugfix: exec doesn?t use proper environment in a class def Bugfix: Unable to remove event handlers completely sometimes Bugfix: List comparison fails with class instances Bugfix: Display floats w/ lots of precision correctly Bugfix: Import __main__ raises ImportError Bugfix: Implement _codecs built-in module Bugfix: Precision field not used with string-formatting codes Bugfix: Can?t access globals from inside exec running in the class body or function Bugfix: String subclass test in string_tests.py is disabled Bugfix: Should be able to use a CLR Hashtable or Dictionary<> to provide keyword bindings of arguments using the ** operator Bugfix: vars() -- TypeError: vars() argument must have __dict__ attribute Bugfix: When keyword argument and unpacking argument lists together... Bugfix: For functions of arity >= 6, called with wrong number of arguments, the TypeError reports the actual number incorrectly Bugfix: Iron Python Exceptions need to be marked serializable Bugfix: list of lambdas only evaluates first expression Bugfix: ReflectedProperty.__set__ does not check for setter==null before checking setter.IsStatic Bugfix: Support mapping key in string formatting operation Bugfix: Equality comparison for slices is broken Do you want to help develop Dynamic languages on CLR? ( http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038 From jon at datasim.co.uk Thu Feb 16 02:35:17 2006 From: jon at datasim.co.uk (Jon Kale) Date: Thu, 16 Feb 2006 01:35:17 -0000 Subject: [IronPython] IronPython 1.0 Beta 3 Released! In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01901204@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <001b01c63299$3fb2b7e0$0600a8c0@datasim.co.uk> Trying to add a reference to System.Xml, I get StackOverflowException. [] C:\Program Files\IronPython (Thu 16/02 1:19) >IronPythonConsole.exe -X:TabCompletion IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReference("System.Xml") Process is terminated due to StackOverflowException. The fix appears to be to change AddReference(object reference): private void AddReference(object reference) { string strRef = reference as string; if (strRef != null) { AddReference(strRef); return; } AddReference(reference, null); } but since this is my first time in the IP code I could well be wrong... -- Jon From sdrucker at microsoft.com Thu Feb 16 03:10:41 2006 From: sdrucker at microsoft.com (Steven Drucker) Date: Wed, 15 Feb 2006 18:10:41 -0800 Subject: [IronPython] IronPython 1.0 Beta 3 Released! In-Reply-To: <001b01c63299$3fb2b7e0$0600a8c0@datasim.co.uk> Message-ID: Also having problems with Assemblies. I've got an assembly that references another assembly. Even when I do the following: import clr clr.Path = ['C://code//assemblyloc'] clr.AddReferenceToFile('Aforge.Imaging.dll') I get an error that it can't load 'AForge.Math' . Aforge.Math is in the given location. In fact, if I just do a clr.AddReferenceToFile('Aforge.Math.dll'), it works fine. This was broken in Beta1, fixed in Beta2, but seems to be broken again. (Or at least, I'm not sure of the proper calling procedure). --S -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jon Kale Sent: Wednesday, February 15, 2006 5:35 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] IronPython 1.0 Beta 3 Released! Trying to add a reference to System.Xml, I get StackOverflowException. [] C:\Program Files\IronPython (Thu 16/02 1:19) >IronPythonConsole.exe -X:TabCompletion IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReference("System.Xml") Process is terminated due to StackOverflowException. The fix appears to be to change AddReference(object reference): private void AddReference(object reference) { string strRef = reference as string; if (strRef != null) { AddReference(strRef); return; } AddReference(reference, null); } but since this is my first time in the IP code I could well be wrong... -- Jon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From lcm at spiralcomms.com Thu Feb 16 09:57:59 2006 From: lcm at spiralcomms.com (Chee Meng) Date: 16 Feb 2006 16:57:59 +0800 Subject: [IronPython] howto access interface method? Message-ID: <2006021616:57:59lcm@spiralcomms.com> hi, I am using the DataGridView object which implements the interface ISupportInitialize, and that have 2 methods BeginInit and EndInit . However, through Ironpython, the 2 methods cannot be found. is there a way to access the 2 methods in python? #((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.dataGridView1.BeginInit() above code gives this error, AttributeError: 'DataGridView' object has no attribute 'BeginInit' thks regards cheemeng From Martin.Maly at microsoft.com Thu Feb 16 10:06:15 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 16 Feb 2006 01:06:15 -0800 Subject: [IronPython] IronPython console runs out of memory In-Reply-To: <08AAC77C2656414E91980F8EBB1E7F0104EA2530@electra.corp.pharsight.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501806073@df-foxhound-msg.exchange.corp.microsoft.com> This is a valid bug - thanks for the repro. IronPython gets into infinite recursion when importing minidom. Of course, this is something we'll fix. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Greg Lee Sent: Tuesday, January 31, 2006 12:40 PM To: users at lists.ironpython.com Subject: [IronPython] IronPython console runs out of memory This one-liner causes IronPython console to run out of memory (2.05GB page file) and freeze Windows XP: from xml.dom import minidom This is the installation: Microsoft Windows XP [Version 5.1.2600] IronPython 1.0.2216 (Beta) on .NET 2.0.50727.42 python 2.4.2 pyxml 0.8.4 pywin32 205 py2exe 0.6.3 IRONPYTHONPATH = c:\python24\lib _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Thu Feb 16 10:21:21 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 16 Feb 2006 01:21:21 -0800 Subject: [IronPython] IronPython 1.0 Beta 3 Released! In-Reply-To: <001b01c63299$3fb2b7e0$0600a8c0@datasim.co.uk> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501806079@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the repro, Jon, we'll fix this right away. apart from changing the code, here is another workaround: clr.AddReferenceByPartialName("System.Xml") Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jon Kale Sent: Wednesday, February 15, 2006 5:35 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] IronPython 1.0 Beta 3 Released! Trying to add a reference to System.Xml, I get StackOverflowException. [] C:\Program Files\IronPython (Thu 16/02 1:19) >IronPythonConsole.exe -X:TabCompletion IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReference("System.Xml") Process is terminated due to StackOverflowException. The fix appears to be to change AddReference(object reference): private void AddReference(object reference) { string strRef = reference as string; if (strRef != null) { AddReference(strRef); return; } AddReference(reference, null); } but since this is my first time in the IP code I could well be wrong... -- Jon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Thu Feb 16 10:27:30 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 16 Feb 2006 01:27:30 -0800 Subject: [IronPython] IRON Python Syntax Coloring In-Reply-To: <5C7752CCB00C3A47A70D5C4204A360B20885F475@CAQ010AVEX1U.sv.avaya.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F50180607B@df-foxhound-msg.exchange.corp.microsoft.com> The Visual Studio SDK contains a sample plugin for VS 2005. Aaron Marten's blog has more details http://blogs.msdn.com/aaronmar/ . One question that appeared earlier on this alias was which Visual Studio edition one needs to use the plug-in. At least the VS Standard edition is required so the plug-in won't work with the VS express editions. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Nair, Rankarajan S (Rankarajan S) Sent: Monday, February 06, 2006 10:38 AM To: users at lists.ironpython.com Subject: [IronPython] IRON Python Syntax Coloring Hi, Is there a plugin available for Visual Studio 2005 to High light the syntax of Python...? Thanks in Advance -Ranka Nair -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Thu Feb 16 10:33:59 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Thu, 16 Feb 2006 01:33:59 -0800 Subject: [IronPython] Error while running sgmllib.py from Python 2.4 library In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F50180607E@df-foxhound-msg.exchange.corp.microsoft.com> I don't have the exact file you are running sgmllib on, but based on running on different input (actually, the IronPython tutorial) and consulting the source code, I believe this bug is fixed in 1.0 Beta 3. However, when running the sgmllib on our tutorial as an input, I got different problem down the line and we'll look into that one. Thank you! Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of richard hsu Sent: Monday, February 13, 2006 6:39 PM To: users at lists.ironpython.com Subject: [IronPython] Error while running sgmllib.py from Python 2.4 library Running: IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42 C:\IronPython\Lib>ironpythonconsole sgmllib.py "c:\webhost\index.html" Traceback (most recent call last): File C:\Documents and Settings\user\My Documents\Develop\IronPython\Lib\sgmllib.py, line 511, in Initialize File C:\Documents and Settings\user\My Documents\Develop\IronPython\Lib\sgmllib.py, line 506, in test$f38 File C:\Documents and Settings\user\My Documents\Develop\IronPython\Lib\sgmllib.py, line 95, in feed$f4 File C:\Documents and Settings\user\My Documents\Develop\IronPython\Lib\sgmllib.py, line 116, in goahead$f7 TypeError: search() takes exactly 2 argument (3 given) I copied both sgmllib.py and its dependency markupbase.py into the IronPython's Lib directory before running the script. The two files are from Python 2.4 Library. The script runs with python 2.4 and prints out the html tags and data in the console. Mark Pilgrim's discusses sgmllib.py in Dive Into Python [http://diveintopython.org/html_processing/introducing_sgmllib.html] My overall objective is to get IronPython to run Mark Pilgrim's feedparser.py [http://feedparser.org] feedparser.py imports sgmllib, re, sys, copy, urlparse, time, rfc822, types, cgi, urllib, urllib2, CStringIO/StringIO, gzip/zlib, xml.sax, base64, binascii, cjkcodecs.aliases and a few other modules. So, it will be interesting. Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sam at nuevageorgia.com Thu Feb 16 15:16:05 2006 From: sam at nuevageorgia.com (Sam Feltus) Date: Thu, 16 Feb 2006 07:16:05 -0700 Subject: [IronPython] IronPython - Web Hosting Message-ID: How far (in general) is IronPython Web Hosting from existing, or does it already? Thanks, Sam http://sonomasunshine.com From sanxiyn at gmail.com Thu Feb 16 15:47:32 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 16 Feb 2006 23:47:32 +0900 Subject: [IronPython] Release file name Message-ID: <5b0248170602160647q270b8314x@mail.gmail.com> This is a nitpick. IronPython 1.0 Beta 2 release was named IronPython-1.0-Beta2.zip. However, IronPython 1.0 Beta 3 release is named IronPython-1-Beta3.zip, using "1" instead of "1.0". Seo Sanghyeon From sanxiyn at gmail.com Thu Feb 16 16:48:01 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 17 Feb 2006 00:48:01 +0900 Subject: [IronPython] IronPython 1.0 Beta 3 on Mono Message-ID: <5b0248170602160748t2de43735q@mail.gmail.com> This is an update on "IronPython 1.0 Beta 2 on Mono" mail. http://lists.ironpython.com/pipermail/users-ironpython.com/2006-January/001678.html "Mono SVN trunk" referred below is revision 56919, in case that matters. Neither current Mono release nor current Mono SVN trunk can run Beta 3 binary. Both fails at startup with: Unhandled Exception: System.NotImplementedException: The requested feature is not implemented. in <...> System.Reflection.Emit.DynamicMethod:DefineParameter (Int32 position, ParameterAttributes attributes, System.String strParamName) Looking up the Mono source, this method is marked "MonoTODO". However, Mono SVN trunk can compile Beta 3 source! Well, compiling isn't that useful if you can't run the result, but it turned out that there's a simple workaround for now. Here's how: 1. Download and unzip IronPython 1.0 Beta 3. 2. Delete IronMath.dll, IronPython.dll, IronPythonConsole.exe. (We will rebuild.) 3. Change to Src directory. 4. Edit makefile. 4-1. Change "csc" to "gmcs". 4-2. Change "mkdir" to "mkdir -p". 5. Edit IronPython/Compiler/Options.cs. 5-1. Change OptimizeReflectCalls to false at line 43. 6. Type "make". You will get a lot of warnings. A topic for another mail... Anyway, you should see "Compilation succeeded" message. Resulting binary can be run with both current Mono release and Mono SVN trunk. time module problem I mentioned earlier is still there. With current Mono release, you get "Missing member" message as expected. With Mono SVN trunk, you get "An exception was thrown by the type initializer for IronPython.Modules.Time", and this exception is really NotImplementedException. IsDaylightSavingTime is marked "MonoTODO" in the Mono source. There's another simple workaround for this though. Add this to site.py: # A hack for Mono try: import time except: pass Importing time *the second time* will succeed. Don't ask me why. With above two workarounds, it seems pretty usable. I will experiment more now. Seo Sanghyeon From dinov at exchange.microsoft.com Thu Feb 16 17:55:49 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 16 Feb 2006 08:55:49 -0800 Subject: [IronPython] howto access interface method? In-Reply-To: <2006021616:57:59lcm@spiralcomms.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01901582@df-foxhound-msg.exchange.corp.microsoft.com> The issue here is that the interface's methods are marked private, but are exposed publicly via the interface (aka explicit interface implementation) -hence the reason you need the cast in C#. This is a shortcoming we're aware of but we don't have a bug on it. I'll go ahead and file a bug on this so it doesn't get lost. The fix may be a little complex for this one so it may not make it for beta 4 but I'll initially open it as a beta 4 bug so we'll give it a shot. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Chee Meng Sent: Thursday, February 16, 2006 12:58 AM To: users at lists.ironpython.com Subject: [IronPython] howto access interface method? hi, I am using the DataGridView object which implements the interface ISupportInitialize, and that have 2 methods BeginInit and EndInit . However, through Ironpython, the 2 methods cannot be found. is there a way to access the 2 methods in python? #((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.dataGridView1.BeginInit() above code gives this error, AttributeError: 'DataGridView' object has no attribute 'BeginInit' thks regards cheemeng _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Thu Feb 16 17:57:21 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 16 Feb 2006 08:57:21 -0800 Subject: [IronPython] IronPython 1.0 Beta 3 Released! In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E01901584@df-foxhound-msg.exchange.corp.microsoft.com> This should work as you're doing it (the only curiosity I see is the backslashes instead of the forward slashes). I'll need to investigate this one and get back to you later today. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Steven Drucker Sent: Wednesday, February 15, 2006 6:11 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.0 Beta 3 Released! Also having problems with Assemblies. I've got an assembly that references another assembly. Even when I do the following: import clr clr.Path = ['C://code//assemblyloc'] clr.AddReferenceToFile('Aforge.Imaging.dll') I get an error that it can't load 'AForge.Math' . Aforge.Math is in the given location. In fact, if I just do a clr.AddReferenceToFile('Aforge.Math.dll'), it works fine. This was broken in Beta1, fixed in Beta2, but seems to be broken again. (Or at least, I'm not sure of the proper calling procedure). --S -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jon Kale Sent: Wednesday, February 15, 2006 5:35 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] IronPython 1.0 Beta 3 Released! Trying to add a reference to System.Xml, I get StackOverflowException. [] C:\Program Files\IronPython (Thu 16/02 1:19) >IronPythonConsole.exe -X:TabCompletion IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReference("System.Xml") Process is terminated due to StackOverflowException. The fix appears to be to change AddReference(object reference): private void AddReference(object reference) { string strRef = reference as string; if (strRef != null) { AddReference(strRef); return; } AddReference(reference, null); } but since this is my first time in the IP code I could well be wrong... -- Jon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.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 micktwomey at gmail.com Thu Feb 16 17:39:07 2006 From: micktwomey at gmail.com (Michael Twomey) Date: Thu, 16 Feb 2006 16:39:07 +0000 Subject: [IronPython] IronPython 1.0 Beta 3 on Mono In-Reply-To: <5b0248170602160748t2de43735q@mail.gmail.com> References: <5b0248170602160748t2de43735q@mail.gmail.com> Message-ID: <50a522ca0602160839u569c8debj@mail.gmail.com> On 16/02/06, Sanghyeon Seo wrote: > You will get a lot of warnings. A topic for another mail... Anyway, > you should see "Compilation succeeded" message. > > Resulting binary can be run with both current Mono release and Mono SVN trunk. > Good stuff, I'm pretty eager to get IronPython working on my powerbook > There's another simple workaround for this though. Add this to site.py: > > # A hack for Mono > try: > import time > except: > pass > > Importing time *the second time* will succeed. Don't ask me why. > I suspect this is due to a bug in module loading which afflicted cpython too (fixed in 2.4). When you import a module for the first time python tries to initialize the module and load it. If it fails python should throw away the broken module but this bug means that the old junk is left over. So when you try to import for the second time you are getting the broken time module (but no import errors). This can lead to some very strange errors. cheers, Michael From dinov at exchange.microsoft.com Thu Feb 16 18:36:06 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 16 Feb 2006 09:36:06 -0800 Subject: [IronPython] IronPython 1.0 Beta 3 Released! In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E019015C5@df-foxhound-msg.exchange.corp.microsoft.com> The reason this is happening is due to the . in the filename - we end up seeing that as an extension and the assembly load request comes in w/o the .DLL so we don't try appending .DLL to do the load. It looks like we need to do that no matter what. You can fix this by just removing the if (String.IsNullOrEmpty(System.IO.Path.GetExtension(fullName))) { line in LoadAssemblyFromFile in clr.cs. Unfortunately then you'll start hitting the stack overflow bug that Jon reported. His fix is close to being right, but really it should become: private void AddReference(object reference) { Assembly asmRef = reference as Assembly; if (asmRef != null) { AddReference(asmRef); return; } string strRef = reference as string; if (strRef != null) { AddReference(strRef); return; } } And AddReference(object reference, string alias) should go away - it looks like this one was just missed w/ catastrophic results. I'm extremely sorry for the trouble here - it's my fault this time. This happened when I completely changed our aliasing support. I'll make sure we get some additional test coverage here so we don't keep breaking you. And the good really good news is that we believe we've got the final solutions for loading now so we shouldn't be changing loading anymore before 1.0 (other than these bug fixes for the next release, of course). Again, I'm sorry for the trouble here. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Steven Drucker Sent: Wednesday, February 15, 2006 6:11 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.0 Beta 3 Released! Also having problems with Assemblies. I've got an assembly that references another assembly. Even when I do the following: import clr clr.Path = ['C://code//assemblyloc'] clr.AddReferenceToFile('Aforge.Imaging.dll') I get an error that it can't load 'AForge.Math' . Aforge.Math is in the given location. In fact, if I just do a clr.AddReferenceToFile('Aforge.Math.dll'), it works fine. This was broken in Beta1, fixed in Beta2, but seems to be broken again. (Or at least, I'm not sure of the proper calling procedure). --S -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jon Kale Sent: Wednesday, February 15, 2006 5:35 PM To: 'Discussion of IronPython' Subject: Re: [IronPython] IronPython 1.0 Beta 3 Released! Trying to add a reference to System.Xml, I get StackOverflowException. [] C:\Program Files\IronPython (Thu 16/02 1:19) >IronPythonConsole.exe -X:TabCompletion IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReference("System.Xml") Process is terminated due to StackOverflowException. The fix appears to be to change AddReference(object reference): private void AddReference(object reference) { string strRef = reference as string; if (strRef != null) { AddReference(strRef); return; } AddReference(reference, null); } but since this is my first time in the IP code I could well be wrong... -- Jon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.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 Aaron.Marten at microsoft.com Thu Feb 16 20:59:01 2006 From: Aaron.Marten at microsoft.com (Aaron Marten) Date: Thu, 16 Feb 2006 11:59:01 -0800 Subject: [IronPython] IRON Python Syntax Coloring In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F50180607B@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <5FCAA6E21F110544B8CD0EEBB51B0AE801898CEC@RED-MSG-20.redmond.corp.microsoft.com> Hi Ranka, Since there have been several questions about the sample, I've posted a FAQ about getting started with the IronPython integration sample. Here's the permalink: http://blogs.msdn.com/aaronmar/archive/2006/02/16/533273.aspx Thanks! AaronM (aaron.marten at microsoft.com) ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Martin Maly Sent: Thursday, February 16, 2006 1:28 AM To: Discussion of IronPython Subject: Re: [IronPython] IRON Python Syntax Coloring The Visual Studio SDK contains a sample plugin for VS 2005. Aaron Marten's blog has more details http://blogs.msdn.com/aaronmar/ . One question that appeared earlier on this alias was which Visual Studio edition one needs to use the plug-in. At least the VS Standard edition is required so the plug-in won't work with the VS express editions. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Nair, Rankarajan S (Rankarajan S) Sent: Monday, February 06, 2006 10:38 AM To: users at lists.ironpython.com Subject: [IronPython] IRON Python Syntax Coloring Hi, Is there a plugin available for Visual Studio 2005 to High light the syntax of Python...? Thanks in Advance -Ranka Nair -------------- next part -------------- An HTML attachment was scrubbed... URL: From giles.thomas at resolversystems.com Thu Feb 16 21:32:07 2006 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Thu, 16 Feb 2006 20:32:07 +0000 Subject: [IronPython] Beta 3 - thanks! Message-ID: <43F4E147.1000207@resolversystems.com> I'd just like to post a big "thanks!" to the IronPython team for Beta 3. It took us just 20 minutes to move our software over, including the removal of a couple of kludges we'd put in for the now-fixed problem with bound methods as event listeners. And the result is that our full unit test suite, which previously took about 5 minutes to run, is complete within 1m20s. Not having the .exes and .pdbs cluttering up the code tree is also a big plus. Perhaps those weren't the most important points addressed in this release, but they are very much appreciated here :-) Cheers, Giles -- Giles Thomas Resolver Systems giles.thomas at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ From s at rusek.org Fri Feb 17 03:10:00 2006 From: s at rusek.org (Stefan Rusek) Date: Thu, 16 Feb 2006 21:10:00 -0500 Subject: [IronPython] IronPython - Web Hosting In-Reply-To: Message-ID: <01a701c63367$422ab120$0100a8c0@obeikelp.com> I've written the CodeDom stuff for it and it works, all except for the fact that IP currently doesn't generate DLLs that has classes that can be used normally. --Stefan -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sam Feltus Sent: Thursday, February 16, 2006 9:16 AM To: users at lists.ironpython.com Subject: [IronPython] IronPython - Web Hosting How far (in general) is IronPython Web Hosting from existing, or does it already? Thanks, Sam http://sonomasunshine.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From lcm at spiralcomms.com Fri Feb 17 03:30:48 2006 From: lcm at spiralcomms.com (Chee Meng) Date: 17 Feb 2006 10:30:48 +0800 Subject: [IronPython] howto access interface method? Message-ID: <2006021710:30:48lcm@spiralcomms.com> thks Dino ! I will be looking forward to the next release. regards cheemeng >The issue here is that the interface's methods are marked private, but are exposed publicly via the interface (aka explicit interface implementation) -hence the reason you need the cast in C#. >This is a shortcoming we're aware of but we don't have a bug on it. I'll go ahead and file a bug on this so it doesn't get lost. The fix may be a little complex for this one so it may not make it for beta 4 but I'll initially open it as a beta 4 bug so we'll give it a shot. From paparipote at hotmail.com Fri Feb 17 05:10:53 2006 From: paparipote at hotmail.com (Paparipote .) Date: Fri, 17 Feb 2006 00:10:53 -0400 Subject: [IronPython] RuntimeError: Could not add reference to assembly SAPProxyENTE.dll Message-ID: Dino: I had the same problem of Jon. In spite of the instructions given to solve the problem of "Process is terminated due to StackOverflowException." After modifications, I got the error: RuntimeError: Could not add reference to assembly Test.dll when putting the instructions: clr.AddReferenceByPartialName("Test.dll") or clr.AddReference("Test.dll") In clr.cs I changed: private void AddReference(object reference) { AddReference(reference, null); } by: private void AddReference(object reference) { Assembly asmRef = reference as Assembly; if (asmRef != null) { AddReference(asmRef); return; } string strRef = reference as string; if (strRef != null) { AddReference(strRef); return; } } I deleted entire private void AddReference(object reference, string alias) { Assembly asmRef = reference as Assembly; if (asmRef != null) { AddReference(asmRef, alias); return; } string strRef = reference as string; if (strRef != null) { AddReference(strRef, alias); return; } } and I commented: // if (String.IsNullOrEmpty(System.IO.Path.GetExtension(fullName))) { and also the corresponding closing "}" The ironpython.dll was generated without errors. Is there something wrong with the changes I made? Best regards. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From tclancy at gmail.com Fri Feb 17 15:19:31 2006 From: tclancy at gmail.com (Tom Clancy) Date: Fri, 17 Feb 2006 09:19:31 -0500 Subject: [IronPython] Consuming Python Classes from C# Message-ID: Sorry if this is an obvious one, but I can't find a good resource on this. I created a very simple Python class library in VS.NET2005 with one file called HelloWorld.py that looks like this: class Speaker: "Just a test to see if I can reference this" def __init__(self): pass def speak(self): return "Hello, world" I built it and added it as a reference to a C# project (along with IronPython). I can see a class named "HelloWorld", but cannot instantiate a Speaker object or find a speak method inside the class through the object browser. (I changed the name of the class to make it clearer what VS.NET was seeing) First off, should my class and filenames match exactly? I've never been clear on that in Python and I feel like it's obscuring my actual problem here. Second, while I see the HelloWorld class in the object browser, whenever I fiddle with the Python code enough to reveal (what should be) a class inside it, it's always static. Why would that be? But my actual question is: how can I (best) create Python classes and consume them in C#? Thanks for digging through that ramble, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Fri Feb 17 17:24:18 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 17 Feb 2006 08:24:18 -0800 Subject: [IronPython] Consuming Python Classes from C# In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501806940@df-foxhound-msg.exchange.corp.microsoft.com> This is currently not supported. The compilation of Python into classes/types readily usable by C# or VB is very difficult problem given the dynamic nature of Python and it is one of our open questions to investigate. Martin ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tom Clancy Sent: Friday, February 17, 2006 6:20 AM To: users at lists.ironpython.com Subject: [IronPython] Consuming Python Classes from C# Sorry if this is an obvious one, but I can't find a good resource on this. I created a very simple Python class library in VS.NET2005 with one file called HelloWorld.py that looks like this: class Speaker: "Just a test to see if I can reference this" def __init__(self): pass def speak(self): return "Hello, world" I built it and added it as a reference to a C# project (along with IronPython). I can see a class named "HelloWorld", but cannot instantiate a Speaker object or find a speak method inside the class through the object browser. (I changed the name of the class to make it clearer what VS.NET was seeing) First off, should my class and filenames match exactly? I've never been clear on that in Python and I feel like it's obscuring my actual problem here. Second, while I see the HelloWorld class in the object browser, whenever I fiddle with the Python code enough to reveal (what should be) a class inside it, it's always static. Why would that be? But my actual question is: how can I (best) create Python classes and consume them in C#? Thanks for digging through that ramble, Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Fri Feb 17 17:38:38 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 17 Feb 2006 08:38:38 -0800 Subject: [IronPython] RuntimeError: Could not add reference to assembly SAPProxyENTE.dll In-Reply-To: References: Message-ID: <4039D552ADAB094BB1EA670F3E96214E235C38@df-foxhound-msg.exchange.corp.microsoft.com> That should do it - where does test.dll live in this case? Also, does: import System System.Reflection.Assembly.LoadAssembly('test') this successfully load the assembly or does that fail as well? ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Paparipote . Sent: Thursday, February 16, 2006 8:10 PM To: users at lists.ironpython.com Subject: [IronPython] RuntimeError: Could not add reference to assembly SAPProxyENTE.dll Dino: I had the same problem of Jon. In spite of the instructions given to solve the problem of "Process is terminated due to StackOverflowException." After modifications, I got the error: RuntimeError: Could not add reference to assembly Test.dll when putting the instructions: clr.AddReferenceByPartialName("Test.dll") or clr.AddReference("Test.dll") In clr.cs I changed: private void AddReference(object reference) { AddReference(reference, null); } by: private void AddReference(object reference) { Assembly asmRef = reference as Assembly; if (asmRef != null) { AddReference(asmRef); return; } string strRef = reference as string; if (strRef != null) { AddReference(strRef); return; } } I deleted entire private void AddReference(object reference, string alias) { Assembly asmRef = reference as Assembly; if (asmRef != null) { AddReference(asmRef, alias); return; } string strRef = reference as string; if (strRef != null) { AddReference(strRef, alias); return; } } and I commented: // if (String.IsNullOrEmpty(System.IO.Path.GetExtension(fullName))) { and also the corresponding closing "}" The ironpython.dll was generated without errors. Is there something wrong with the changes I made? Best regards. _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jim.Hugunin at microsoft.com Fri Feb 17 18:32:55 2006 From: Jim.Hugunin at microsoft.com (Jim Hugunin) Date: Fri, 17 Feb 2006 09:32:55 -0800 Subject: [IronPython] howto access interface method? In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01901582@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: Dino's right that this is behavior that we'd like to make more natural and that we'll look into fixing. However, there's a classic python-style work-around for this issue that can also be used to handle the case where a class implements two conflicting interfaces. This relies on the fact that methods are first class entities in Python. BTW - I'd suggest that you use shorter form names in actual code: >>> import clr >>> clr.AddReferenceByPartialName("System.Windows.Forms") >>> import System >>> dgv = System.Windows.Forms.DataGridView() >>> dgv.BeginInit() #fails Traceback (most recent call last): File , line 0, in input##102 AttributeError: 'DataGridView' object has no attribute 'BeginInit' >>> System.ComponentModel.ISupportInitialize.BeginInit(dgv) #works >>> This is the same idiom that Python uses for explicitly calling a super classes method on a subclass and can be used here to call an interface method on an object that explicitly implements and interface but doesn't expose the methods directly. While we'll try to do the right thing for you behind the scenes more often, this idiom is valuable to know as the "true" way to call these kinds of methods. This same approach can also be used sometimes with COM objects when we fail to do the right thing for you automagically. -Jim -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Thursday, February 16, 2006 8:56 AM To: Discussion of IronPython Subject: Re: [IronPython] howto access interface method? The issue here is that the interface's methods are marked private, but are exposed publicly via the interface (aka explicit interface implementation) -hence the reason you need the cast in C#. This is a shortcoming we're aware of but we don't have a bug on it. I'll go ahead and file a bug on this so it doesn't get lost. The fix may be a little complex for this one so it may not make it for beta 4 but I'll initially open it as a beta 4 bug so we'll give it a shot. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Chee Meng Sent: Thursday, February 16, 2006 12:58 AM To: users at lists.ironpython.com Subject: [IronPython] howto access interface method? hi, I am using the DataGridView object which implements the interface ISupportInitialize, and that have 2 methods BeginInit and EndInit . However, through Ironpython, the 2 methods cannot be found. is there a way to access the 2 methods in python? #((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.dataGridView1.BeginInit() above code gives this error, AttributeError: 'DataGridView' object has no attribute 'BeginInit' thks regards cheemeng _______________________________________________ users mailing list users at lists.ironpython.com http://lists.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 paparipote at hotmail.com Fri Feb 17 19:26:20 2006 From: paparipote at hotmail.com (Paparipote .) Date: Fri, 17 Feb 2006 14:26:20 -0400 Subject: [IronPython] AttributeError: type object 'Assembly' has no attribute 'LoadAssembly' Message-ID: Dino: Again, thanks for you attention. By the way, I recompiled all again witrh the same results of: RuntimeError: Could not add reference to assembly test When I issue the commands you asked for, I get: .ironpythonconsole IronPython 1.0.2239 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. ['C:\\IP\\src', 'C:\\python24\\lib', 'C:\\IP\\IronPython-1.0-Beta3', 'C:\\IP\\Ir onPython-1.0-Beta3\\Tutorial', 'C:\\IP\\IronPython-1.0-Beta3\\Lib'] >>>import System >>>System.Reflection.Assembly.LoadAssembly('test') Traceback (most recent call last): File , line 0, in input##590 AttributeError: type object 'Assembly' has no attribute 'LoadAssembly' >>> I pass you some data about my Windows environment: >>>^Z .cd C:\IP\src .dir test.dll Volume in drive C has no label. Volume Serial Number is 845A-2976 Directory of C:\IP\src 07/02/2006 07:21 p.m. 49,152 Test.dll 1 File(s) 49,152 bytes 0 Dir(s) 35,997,466,624 bytes free .dir *.dll Volume in drive C has no label. Volume Serial Number is 845A-2976 Directory of C:\IP\src 07/02/2006 07:21 p.m. 49,152 Test.dll 1 File(s) 49,152 bytes 0 Dir(s) 35,997,446,144 bytes free .dir ..\IronPython-1.0-Beta3 Volume in drive C has no label. Volume Serial Number is 845A-2976 Directory of C:\IP\IronPython-1.0-Beta3 17/02/2006 01:49 p.m. . 17/02/2006 01:49 p.m. .. 15/02/2006 09:47 a.m. Doc 10/02/2006 12:23 a.m. 4,580 FAQ.html 17/02/2006 01:49 p.m. 40,960 IronMath.dll 17/02/2006 01:49 p.m. 89,600 IronMath.pdb 17/02/2006 01:49 p.m. 782,336 IronPython.dll 17/02/2006 01:49 p.m. 2,557,440 IronPython.pdb 17/02/2006 01:49 p.m. 32,768 IronPythonConsole.exe 17/02/2006 01:49 p.m. 48,640 IronPythonConsole.pdb 15/02/2006 09:47 a.m. Lib 29/12/2005 12:16 a.m. 2,832 License.html 12/01/2006 03:43 p.m. 5,945 Readme.html 15/02/2006 09:47 a.m. Src 15/02/2006 09:47 a.m. Tutorial 9 File(s) 3,565,101 bytes 6 Dir(s) 35,997,429,760 bytes free .set ALLUSERSPROFILE=C:\Documents and Settings\All Users CLIENTNAME=Console CommonProgramFiles=C:\Program Files\Common Files ComSpec=C:\WINDOWS\system32\cmd.exe FP_NO_HOST_CHECK=NO HOMEDRIVE=C: INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\include;C:\Program Files\M icrosoft.NET\SDK\v2.0\include;c:\Program Files\Microsoft Visual Studio .NET 2003 \SDK\v1.1\include\ IP=C:\IP\IronPython-1.0-Beta3 IPH=C:\IP IRONPYTHONPATH=C:/python24/lib;C:\IP\IronPython-1.0-Beta3;C:\IP\IronPython-1.0-B eta3/Tutorial IRONPYTHONSTARTUP=C:\IP/src/ini.py LANG=ES LIB=C:\Program Files\Microsoft Visual Studio 8\VC\lib;C:\Program Files\Microsoft .NET\SDK\v2.0\Lib;c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Li b\ LOGONSERVER=\\ENADS407 NetSamplePath=C:\Program Files\Microsoft.NET\SDK\v2.0 NUMBER_OF_PROCESSORS=1 OS=Windows_NT Path=C:\Program Files\Microsoft.NET\SDK\v2.0\Bin;C:\WINDOWS\Microsoft.NET\Framew ork\v2.0.50727;C:\IP\IronPython-1.0-Beta3;C:\Program Files\Microsoft Visual Stud io 8\VC\bin;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Fi les\Microsoft Visual Studio 8\VC\vcpackages;C:\oracle\product\10.1.0\Client_1\bi n;C:\oracle\product\10.1.0\Client_1\jre\1.4.2\bin\client;C:\oracle\product\10.1. 0\Client_1\jre\1.4.2\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem ;C:\Program Files\ATI Technologies\ATI Control Panel;C:\WINDOWS\Microsoft.NET\Fr amework\v1.1.4322;C:\Program Files\Common Files\Roxio Shared\DLLShared;C:\python 24;c:\Program Files\Microsoft SQL Server\90\Tools\binn\ PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 15 Model 2 Stepping 9, GenuineIntel PROCESSOR_LEVEL=15 PROCESSOR_REVISION=0209 ProgramFiles=C:\Program Files PROMPT=. RFC_INI=C:\Inetpub\wwwroot SESSIONNAME=Console SystemDrive=C: SystemRoot=C:\WINDOWS VCBUILD_DEFAULT_CFG=Debug|Win32 VCBUILD_DEFAULT_OPTIONS=/useenv VS71COMNTOOLS=c:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\ windir=C:\WINDOWS IRONPYTHONSTARTUP ============== .type ini.py import sys print sys.path The ip.bat I invoke is: @set IPH=C:\IP @set IP=%IPH%\IronPython-1.0-Beta3 rem The 8 lines below were extracted from: C:\Program Files\Microsoft.NET\SDK\v2.0\Bin\sdkvars.bat @Set Path=C:\Program Files\Microsoft.NET\SDK\v2.0\Bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;%IP%;C:\Program Files\Microsoft Visual Studio 8\VC\bin;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\vcpackages;%PATH% @Set LIB=C:\Program Files\Microsoft Visual Studio 8\VC\lib;C:\Program Files\Microsoft.NET\SDK\v2.0\Lib;%LIB% @Set INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\include;C:\Program Files\Microsoft.NET\SDK\v2.0\include;%INCLUDE% @Set NetSamplePath=C:\Program Files\Microsoft.NET\SDK\v2.0 @Set VCBUILD_DEFAULT_CFG=Debug^|Win32 @Set VCBUILD_DEFAULT_OPTIONS=/useenv @echo Setting environment to use Microsoft .NET Framework v2.0 SDK tools. @echo For a list of SDK tools, see the 'StartTools.htm' file in the bin folder. cd %IPH%\src prompt . @set IRONPYTHONPATH=C:/python24/lib;%IP%;%IP%/Tutorial @set IRONPYTHONSTARTUP=%IPH%/src/ini.py ironpythonconsole _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From Martin.Maly at microsoft.com Fri Feb 17 19:32:23 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Fri, 17 Feb 2006 10:32:23 -0800 Subject: [IronPython] AttributeError: type object 'Assembly' has no attribute 'LoadAssembly' In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501806A60@df-foxhound-msg.exchange.corp.microsoft.com> Assembly has no LoadAssembly on it. Your options are: 'Load', 'LoadFile', 'LoadFrom', 'LoadWithPartialName' Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote . Sent: Friday, February 17, 2006 10:26 AM To: users at lists.ironpython.com Subject: [IronPython] AttributeError: type object 'Assembly' has no attribute 'LoadAssembly' Dino: Again, thanks for you attention. By the way, I recompiled all again witrh the same results of: RuntimeError: Could not add reference to assembly test When I issue the commands you asked for, I get: .ironpythonconsole IronPython 1.0.2239 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. ['C:\\IP\\src', 'C:\\python24\\lib', 'C:\\IP\\IronPython-1.0-Beta3', 'C:\\IP\\Ir onPython-1.0-Beta3\\Tutorial', 'C:\\IP\\IronPython-1.0-Beta3\\Lib'] >>>import System >>>System.Reflection.Assembly.LoadAssembly('test') Traceback (most recent call last): File , line 0, in input##590 AttributeError: type object 'Assembly' has no attribute 'LoadAssembly' >>> I pass you some data about my Windows environment: >>>^Z .cd C:\IP\src .dir test.dll Volume in drive C has no label. Volume Serial Number is 845A-2976 Directory of C:\IP\src 07/02/2006 07:21 p.m. 49,152 Test.dll 1 File(s) 49,152 bytes 0 Dir(s) 35,997,466,624 bytes free .dir *.dll Volume in drive C has no label. Volume Serial Number is 845A-2976 Directory of C:\IP\src 07/02/2006 07:21 p.m. 49,152 Test.dll 1 File(s) 49,152 bytes 0 Dir(s) 35,997,446,144 bytes free .dir ..\IronPython-1.0-Beta3 Volume in drive C has no label. Volume Serial Number is 845A-2976 Directory of C:\IP\IronPython-1.0-Beta3 17/02/2006 01:49 p.m. . 17/02/2006 01:49 p.m. .. 15/02/2006 09:47 a.m. Doc 10/02/2006 12:23 a.m. 4,580 FAQ.html 17/02/2006 01:49 p.m. 40,960 IronMath.dll 17/02/2006 01:49 p.m. 89,600 IronMath.pdb 17/02/2006 01:49 p.m. 782,336 IronPython.dll 17/02/2006 01:49 p.m. 2,557,440 IronPython.pdb 17/02/2006 01:49 p.m. 32,768 IronPythonConsole.exe 17/02/2006 01:49 p.m. 48,640 IronPythonConsole.pdb 15/02/2006 09:47 a.m. Lib 29/12/2005 12:16 a.m. 2,832 License.html 12/01/2006 03:43 p.m. 5,945 Readme.html 15/02/2006 09:47 a.m. Src 15/02/2006 09:47 a.m. Tutorial 9 File(s) 3,565,101 bytes 6 Dir(s) 35,997,429,760 bytes free .set ALLUSERSPROFILE=C:\Documents and Settings\All Users CLIENTNAME=Console CommonProgramFiles=C:\Program Files\Common Files ComSpec=C:\WINDOWS\system32\cmd.exe FP_NO_HOST_CHECK=NO HOMEDRIVE=C: INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\include;C:\Program Files\M icrosoft.NET\SDK\v2.0\include;c:\Program Files\Microsoft Visual Studio .NET 2003 \SDK\v1.1\include\ IP=C:\IP\IronPython-1.0-Beta3 IPH=C:\IP IRONPYTHONPATH=C:/python24/lib;C:\IP\IronPython-1.0-Beta3;C:\IP\IronPython-1.0-B eta3/Tutorial IRONPYTHONSTARTUP=C:\IP/src/ini.py LANG=ES LIB=C:\Program Files\Microsoft Visual Studio 8\VC\lib;C:\Program Files\Microsoft .NET\SDK\v2.0\Lib;c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Li b\ LOGONSERVER=\\ENADS407 NetSamplePath=C:\Program Files\Microsoft.NET\SDK\v2.0 NUMBER_OF_PROCESSORS=1 OS=Windows_NT Path=C:\Program Files\Microsoft.NET\SDK\v2.0\Bin;C:\WINDOWS\Microsoft.NET\Framew ork\v2.0.50727;C:\IP\IronPython-1.0-Beta3;C:\Program Files\Microsoft Visual Stud io 8\VC\bin;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Fi les\Microsoft Visual Studio 8\VC\vcpackages;C:\oracle\product\10.1.0\Client_1\bi n;C:\oracle\product\10.1.0\Client_1\jre\1.4.2\bin\client;C:\oracle\product\10.1. 0\Client_1\jre\1.4.2\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem ;C:\Program Files\ATI Technologies\ATI Control Panel;C:\WINDOWS\Microsoft.NET\Fr amework\v1.1.4322;C:\Program Files\Common Files\Roxio Shared\DLLShared;C:\python 24;c:\Program Files\Microsoft SQL Server\90\Tools\binn\ PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 15 Model 2 Stepping 9, GenuineIntel PROCESSOR_LEVEL=15 PROCESSOR_REVISION=0209 ProgramFiles=C:\Program Files PROMPT=. RFC_INI=C:\Inetpub\wwwroot SESSIONNAME=Console SystemDrive=C: SystemRoot=C:\WINDOWS VCBUILD_DEFAULT_CFG=Debug|Win32 VCBUILD_DEFAULT_OPTIONS=/useenv VS71COMNTOOLS=c:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\ windir=C:\WINDOWS IRONPYTHONSTARTUP ============== .type ini.py import sys print sys.path The ip.bat I invoke is: @set IPH=C:\IP @set IP=%IPH%\IronPython-1.0-Beta3 rem The 8 lines below were extracted from: C:\Program Files\Microsoft.NET\SDK\v2.0\Bin\sdkvars.bat @Set Path=C:\Program Files\Microsoft.NET\SDK\v2.0\Bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;%IP%;C:\Program Files\Microsoft Visual Studio 8\VC\bin;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\vcpackages;%PATH% @Set LIB=C:\Program Files\Microsoft Visual Studio 8\VC\lib;C:\Program Files\Microsoft.NET\SDK\v2.0\Lib;%LIB% @Set INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\include;C:\Program Files\Microsoft.NET\SDK\v2.0\include;%INCLUDE% @Set NetSamplePath=C:\Program Files\Microsoft.NET\SDK\v2.0 @Set VCBUILD_DEFAULT_CFG=Debug^|Win32 @Set VCBUILD_DEFAULT_OPTIONS=/useenv @echo Setting environment to use Microsoft .NET Framework v2.0 SDK tools. @echo For a list of SDK tools, see the 'StartTools.htm' file in the bin folder. cd %IPH%\src prompt . @set IRONPYTHONPATH=C:/python24/lib;%IP%;%IP%/Tutorial @set IRONPYTHONSTARTUP=%IPH%/src/ini.py ironpythonconsole _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Fri Feb 17 20:03:51 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 17 Feb 2006 11:03:51 -0800 Subject: [IronPython] AttributeError: type object 'Assembly' has no attribute 'LoadAssembly' In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F501806A60@df-foxhound-msg.exchange.corp.microsoft.com> References: , <5C0A6F919D675745BB1DBA7412DB68F501806A60@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E235C3A@df-foxhound-msg.exchange.corp.microsoft.com> Argh, yeah, I meant Load not LoadAssembly... ________________________________________ From: users-bounces at lists.ironpython.com On Behalf Of Martin Maly Sent: Friday, February 17, 2006 10:32 AM To: Discussion of IronPython Subject: Re: [IronPython] AttributeError: type object 'Assembly' has no attribute 'LoadAssembly' Assembly has no LoadAssembly on it. Your options are: 'Load', 'LoadFile', 'LoadFrom', 'LoadWithPartialName' Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote . Sent: Friday, February 17, 2006 10:26 AM To: users at lists.ironpython.com Subject: [IronPython] AttributeError: type object 'Assembly' has no attribute 'LoadAssembly' Dino: Again, thanks for you attention. By the way, I recompiled all again witrh the same results of: RuntimeError: Could not add reference to assembly test When I issue the commands you asked for, I get: .ironpythonconsole IronPython 1.0.2239 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. ['C:\\IP\\src', 'C:\\python24\\lib', 'C:\\IP\\IronPython-1.0-Beta3', 'C:\\IP\\Ir onPython-1.0-Beta3\\Tutorial', 'C:\\IP\\IronPython-1.0-Beta3\\Lib'] >>>import System >>>System.Reflection.Assembly.LoadAssembly('test') Traceback (most recent call last): File , line 0, in input##590 AttributeError: type object 'Assembly' has no attribute 'LoadAssembly' >>> I pass you some data about my Windows environment: >>>^Z .cd C:\IP\src .dir test.dll Volume in drive C has no label. Volume Serial Number is 845A-2976 Directory of C:\IP\src 07/02/2006 07:21 p.m. 49,152 Test.dll 1 File(s) 49,152 bytes 0 Dir(s) 35,997,466,624 bytes free .dir *.dll Volume in drive C has no label. Volume Serial Number is 845A-2976 Directory of C:\IP\src 07/02/2006 07:21 p.m. 49,152 Test.dll 1 File(s) 49,152 bytes 0 Dir(s) 35,997,446,144 bytes free .dir ..\IronPython-1.0-Beta3 Volume in drive C has no label. Volume Serial Number is 845A-2976 Directory of C:\IP\IronPython-1.0-Beta3 17/02/2006 01:49 p.m. . 17/02/2006 01:49 p.m. .. 15/02/2006 09:47 a.m. Doc 10/02/2006 12:23 a.m. 4,580 FAQ.html 17/02/2006 01:49 p.m. 40,960 IronMath.dll 17/02/2006 01:49 p.m. 89,600 IronMath.pdb 17/02/2006 01:49 p.m. 782,336 IronPython.dll 17/02/2006 01:49 p.m. 2,557,440 IronPython.pdb 17/02/2006 01:49 p.m. 32,768 IronPythonConsole.exe 17/02/2006 01:49 p.m. 48,640 IronPythonConsole.pdb 15/02/2006 09:47 a.m. Lib 29/12/2005 12:16 a.m. 2,832 License.html 12/01/2006 03:43 p.m. 5,945 Readme.html 15/02/2006 09:47 a.m. Src 15/02/2006 09:47 a.m. Tutorial 9 File(s) 3,565,101 bytes 6 Dir(s) 35,997,429,760 bytes free .set ALLUSERSPROFILE=C:\Documents and Settings\All Users CLIENTNAME=Console CommonProgramFiles=C:\Program Files\Common Files ComSpec=C:\WINDOWS\system32\cmd.exe FP_NO_HOST_CHECK=NO HOMEDRIVE=C: INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\include;C:\Program Files\M icrosoft.NET\SDK\v2.0\include;c:\Program Files\Microsoft Visual Studio .NET 2003 \SDK\v1.1\include\ IP=C:\IP\IronPython-1.0-Beta3 IPH=C:\IP IRONPYTHONPATH=C:/python24/lib;C:\IP\IronPython-1.0-Beta3;C:\IP\IronPython-1.0-B eta3/Tutorial IRONPYTHONSTARTUP=C:\IP/src/ini.py LANG=ES LIB=C:\Program Files\Microsoft Visual Studio 8\VC\lib;C:\Program Files\Microsoft .NET\SDK\v2.0\Lib;c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Li b\ LOGONSERVER=\\ENADS407 NetSamplePath=C:\Program Files\Microsoft.NET\SDK\v2.0 NUMBER_OF_PROCESSORS=1 OS=Windows_NT Path=C:\Program Files\Microsoft.NET\SDK\v2.0\Bin;C:\WINDOWS\Microsoft.NET\Framew ork\v2.0.50727;C:\IP\IronPython-1.0-Beta3;C:\Program Files\Microsoft Visual Stud io 8\VC\bin;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Fi les\Microsoft Visual Studio 8\VC\vcpackages;C:\oracle\product\10.1.0\Client_1\bi n;C:\oracle\product\10.1.0\Client_1\jre\1.4.2\bin\client;C:\oracle\product\10.1. 0\Client_1\jre\1.4.2\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem ;C:\Program Files\ATI Technologies\ATI Control Panel;C:\WINDOWS\Microsoft.NET\Fr amework\v1.1.4322;C:\Program Files\Common Files\Roxio Shared\DLLShared;C:\python 24;c:\Program Files\Microsoft SQL Server\90\Tools\binn\ PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH PROCESSOR_ARCHITECTURE=x86 PROCESSOR_IDENTIFIER=x86 Family 15 Model 2 Stepping 9, GenuineIntel PROCESSOR_LEVEL=15 PROCESSOR_REVISION=0209 ProgramFiles=C:\Program Files PROMPT=. RFC_INI=C:\Inetpub\wwwroot SESSIONNAME=Console SystemDrive=C: SystemRoot=C:\WINDOWS VCBUILD_DEFAULT_CFG=Debug|Win32 VCBUILD_DEFAULT_OPTIONS=/useenv VS71COMNTOOLS=c:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\ windir=C:\WINDOWS IRONPYTHONSTARTUP ============== .type ini.py import sys print sys.path The ip.bat I invoke is: @set IPH=C:\IP @set IP=%IPH%\IronPython-1.0-Beta3 rem The 8 lines below were extracted from: C:\Program Files\Microsoft.NET\SDK\v2.0\Bin\sdkvars.bat @Set Path=C:\Program Files\Microsoft.NET\SDK\v2.0\Bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;%IP%;C:\Program Files\Microsoft Visual Studio 8\VC\bin;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\vcpackages;%PATH% @Set LIB=C:\Program Files\Microsoft Visual Studio 8\VC\lib;C:\Program Files\Microsoft.NET\SDK\v2.0\Lib;%LIB% @Set INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\include;C:\Program Files\Microsoft.NET\SDK\v2.0\include;%INCLUDE% @Set NetSamplePath=C:\Program Files\Microsoft.NET\SDK\v2.0 @Set VCBUILD_DEFAULT_CFG=Debug^|Win32 @Set VCBUILD_DEFAULT_OPTIONS=/useenv @echo Setting environment to use Microsoft .NET Framework v2.0 SDK tools. @echo For a list of SDK tools, see the 'StartTools.htm' file in the bin folder. cd %IPH%\src prompt . @set IRONPYTHONPATH=C:/python24/lib;%IP%;%IP%/Tutorial @set IRONPYTHONSTARTUP=%IPH%/src/ini.py ironpythonconsole _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From paparipote at hotmail.com Fri Feb 17 22:24:35 2006 From: paparipote at hotmail.com (Paparipote .) Date: Fri, 17 Feb 2006 17:24:35 -0400 Subject: [IronPython] Thanks for the indications about System.Reflection.Assembly.LoadFrom Message-ID: Martin, Dino: Thank you for the help. It works with: Import System Import clr aso = System.Reflection.Assembly.LoadFrom('test.dll') clr.AddReference(aso) import ...... I SHOULD suppose the eventual/temporal solution is to use System.Reflection.Assembly.LoadFrom('test.dll') but I forgot it, I accustomed to the direct clr.AddReference("test") solution ;-) Very best regards and have a good weekend. P.S. Let me ask a question, how do you get the indentation in this Discution pages of IP? i.e. Question (John) Answer (Dino) Answer (Martin) Question (John) Answer (Martin) What should I do during the mailing of my requests to generate that indentation? Thanks!! _________________________________________________________________ MSN Amor: busca tu ? naranja http://latam.msn.com/amor/ From mailinglist.account at gmail.com Sat Feb 18 12:04:14 2006 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Sat, 18 Feb 2006 12:04:14 +0100 Subject: [IronPython] Beta3: System.StackOverflowException Message-ID: Hi all, I after installing Beta 3, I tried to add a reference to System.Xml and received a System.StackOverflowException, any thoughts? Anthony IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> import System >>> clr.AddReference("System.Xml") And the Visual Studio Just-In-Time debugger popped up with the exception "An unhandled exception ('') occurred in IronPythonConsole.exe[488]. From mailinglist.account at gmail.com Sat Feb 18 12:09:30 2006 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Sat, 18 Feb 2006 12:09:30 +0100 Subject: [IronPython] Beta3: System.StackOverflowException In-Reply-To: References: Message-ID: More Info.. The import works fine if instead of clr.AddReference you use clrAddReferenceByPartialName.. See this output IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReferenceByPartialName("System.Xml") >>> import System.Xml >>> dir(System.Xml) ['ConformanceLevel', 'EntityHandling', 'Formatting', 'IHasXmlNode', 'IXmlLineInf o', 'IXmlNamespaceResolver', 'NameTable', 'NewLineHandling', 'ReadState', 'Schem a', 'Serialization', 'ValidationType', 'WhitespaceHandling', 'WriteState', 'XPat h', 'XmlAttribute', 'XmlAttributeCollection', 'XmlCDataSection', 'XmlCharacterDa ta', 'XmlComment', 'XmlConvert', 'XmlDateTimeSerializationMode', 'XmlDeclaration ', 'XmlDocument', 'XmlDocumentFragment', 'XmlDocumentType', 'XmlElement', 'XmlEn tity', 'XmlEntityReference', 'XmlException', 'XmlImplementation', 'XmlLinkedNode ', 'XmlNameTable', 'XmlNamedNodeMap', 'XmlNamespaceManager', 'XmlNamespaceScope' , 'XmlNode', 'XmlNodeChangedAction', 'XmlNodeChangedEventArgs', 'XmlNodeChangedE ventHandler', 'XmlNodeList', 'XmlNodeOrder', 'XmlNodeReader', 'XmlNodeType', 'Xm lNotation', 'XmlOutputMethod', 'XmlParserContext', 'XmlProcessingInstruction', ' XmlQualifiedName', 'XmlReader', 'XmlReaderSettings', 'XmlResolver', 'XmlSecureRe solver', 'XmlSignificantWhitespace', 'XmlSpace', 'XmlText', 'XmlTextReader', 'Xm lTextWriter', 'XmlTokenizedType', 'XmlUrlResolver', 'XmlValidatingReader', 'XmlW hitespace', 'XmlWriter', 'XmlWriterSettings', 'Xsl', '__builtins__', '__dict__', '__name__'] >>> On 2/18/06, Anthony Tarlano wrote: > Hi all, > > I after installing Beta 3, I tried to add a reference to System.Xml > and received a System.StackOverflowException, any thoughts? > > Anthony > > IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import clr > >>> import System > >>> clr.AddReference("System.Xml") > > And the Visual Studio Just-In-Time debugger popped up with the > exception "An unhandled exception ('') > occurred in IronPythonConsole.exe[488]. > From yalvi at exchange.microsoft.com Thu Feb 16 19:32:09 2006 From: yalvi at exchange.microsoft.com (Yasir Alvi) Date: Thu, 16 Feb 2006 10:32:09 -0800 Subject: [IronPython] Release file name In-Reply-To: <5b0248170602160647q270b8314x@mail.gmail.com> Message-ID: <2D38793E06D9DE44928514640720269201B56718@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for reporting this. We'll make sure we're consistent going forward. Yasir -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Thursday, February 16, 2006 6:48 AM To: Discussion of IronPython Subject: [IronPython] Release file name This is a nitpick. IronPython 1.0 Beta 2 release was named IronPython-1.0-Beta2.zip. However, IronPython 1.0 Beta 3 release is named IronPython-1-Beta3.zip, using "1" instead of "1.0". Seo Sanghyeon _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kgmuller at xs4all.nl Wed Feb 15 15:30:19 2006 From: kgmuller at xs4all.nl (Klaus Muller) Date: Wed, 15 Feb 2006 15:30:19 +0100 Subject: [IronPython] [Simpy-users] RE: SimPy on IronPython timing test In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01842373@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <200602151430.k1FEUMLu025341@smtp-vbr5.xs4all.nl> Dino, Fully understood! IronPython looks good for such an early version! I am looking forward to future releases of IronPython for performance, but continue trying the beta out with SimPy in the meantime. Klaus M?ller > -----Original Message----- > From: simpy-users-admin at lists.sourceforge.net > [mailto:simpy-users-admin at lists.sourceforge.net] On Behalf Of > Dino Viehland > Sent: Tuesday, February 14, 2006 6:01 PM > To: Discussion of IronPython; > simpy-users at lists.sourceforge.net; 'Simpy-Developer List' > Subject: [Simpy-users] RE: [IronPython] SimPy on IronPython > timing test > > Thanks for the report Klaus. Currently we're mostly focused > on correctness but later in the beta cycle we're going to > come back and target perf pretty heavily. I've gone ahead > and filed this in our bug database so we won't miss it when > we get to that point. > > > Do you want to help develop Dynamic languages on CLR? > (http://members.microsoft.com/careers/search/details.aspx?JobI > D=6D4754DE-11F0-45DF-8B78-DC1B43134038) > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Klaus Muller > Sent: Wednesday, February 01, 2006 10:57 PM > To: simpy-users at lists.sourceforge.net; 'Simpy-Developer List' > Cc: users at lists.ironpython.com > Subject: [IronPython] SimPy on IronPython timing test > > All: > I have run a first simple benchmark to compare SimPy under > IronPython with SimPy under CPython. I ran the following program: > > from SimPy.Simulation import * > import time > > class Dum(Process): > def run(self): > yield hold,self,3 > initialize() > nrProcs=int(raw_input("Nr of processes?")) > processes=[Dum("Dum%s"%x) for x in range(1,nrProcs)] > > for i in range(nrProcs): > p=Dum("%s"%i) > activate(p,p.run(),at=i) > > tStart=(time.clock(),time.time()) > simulate(until=2*nrProcs) > print "Ran in %s seconds for %s > processes"%((time.clock()-tStart[0],time.time()-tStart[1]),nrProcs) > raw_input("Hit any key . . .") > > Here are the results: > > Nr processes=10000 > ------------------ > IronPython: 2.06 seconds > CPython: 0.5 seconds > > Nr processes=50000 > ------------------ > IronPython: 15.53 seconds > CPython: 3.67 seconds > > At this moment, IronPython is clearly way slower than CPython > on this benchmark. > > Clearly, it is early days for IronPython (this was run under > beta release 2) and its developers will surely still optimize > its performance a lot. > > If Microsoft actually support IronPython, this will be an > important SimPy platform in the future and we will have to > watch its further development. > > Klaus M?ller > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep > through log files for problems? Stop! Download the new AJAX > search engine that makes searching your log files as easy as > surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd___________________________ > ____________________ > Simpy-users mailing list > Simpy-users at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/simpy-users > > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3936 bytes Desc: not available URL: From Martin.Maly at microsoft.com Sat Feb 18 17:14:20 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sat, 18 Feb 2006 08:14:20 -0800 Subject: [IronPython] Beta3: System.StackOverflowException In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F5018900B1@df-foxhound-msg.exchange.corp.microsoft.com> This is an unfortunate bug in our code. See attached for more information. Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano Sent: Saturday, February 18, 2006 3:10 AM To: Discussion of IronPython Subject: Re: [IronPython] Beta3: System.StackOverflowException More Info.. The import works fine if instead of clr.AddReference you use clrAddReferenceByPartialName.. See this output IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReferenceByPartialName("System.Xml") >>> import System.Xml >>> dir(System.Xml) ['ConformanceLevel', 'EntityHandling', 'Formatting', 'IHasXmlNode', 'IXmlLineInf o', 'IXmlNamespaceResolver', 'NameTable', 'NewLineHandling', 'ReadState', 'Schem a', 'Serialization', 'ValidationType', 'WhitespaceHandling', 'WriteState', 'XPat h', 'XmlAttribute', 'XmlAttributeCollection', 'XmlCDataSection', 'XmlCharacterDa ta', 'XmlComment', 'XmlConvert', 'XmlDateTimeSerializationMode', 'XmlDeclaration ', 'XmlDocument', 'XmlDocumentFragment', 'XmlDocumentType', 'XmlElement', 'XmlEn tity', 'XmlEntityReference', 'XmlException', 'XmlImplementation', 'XmlLinkedNode ', 'XmlNameTable', 'XmlNamedNodeMap', 'XmlNamespaceManager', 'XmlNamespaceScope' , 'XmlNode', 'XmlNodeChangedAction', 'XmlNodeChangedEventArgs', 'XmlNodeChangedE ventHandler', 'XmlNodeList', 'XmlNodeOrder', 'XmlNodeReader', 'XmlNodeType', 'Xm lNotation', 'XmlOutputMethod', 'XmlParserContext', 'XmlProcessingInstruction', ' XmlQualifiedName', 'XmlReader', 'XmlReaderSettings', 'XmlResolver', 'XmlSecureRe solver', 'XmlSignificantWhitespace', 'XmlSpace', 'XmlText', 'XmlTextReader', 'Xm lTextWriter', 'XmlTokenizedType', 'XmlUrlResolver', 'XmlValidatingReader', 'XmlW hitespace', 'XmlWriter', 'XmlWriterSettings', 'Xsl', '__builtins__', '__dict__', '__name__'] >>> On 2/18/06, Anthony Tarlano wrote: > Hi all, > > I after installing Beta 3, I tried to add a reference to System.Xml > and received a System.StackOverflowException, any thoughts? > > Anthony > > IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> import clr > >>> import System > >>> clr.AddReference("System.Xml") > > And the Visual Studio Just-In-Time debugger popped up with the > exception "An unhandled exception ('') > occurred in IronPythonConsole.exe[488]. > _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- A non-text attachment was scrubbed... Name: Re IronPython IronPython 1 0 Beta 3 Released!.msg Type: application/octet-stream Size: 43520 bytes Desc: Re IronPython IronPython 1 0 Beta 3 Released!.msg URL: From lcm at spiralcomms.com Mon Feb 20 04:53:32 2006 From: lcm at spiralcomms.com (Cheemeng) Date: Mon, 20 Feb 2006 11:53:32 +0800 Subject: [IronPython] howto access interface method? (Jim Hugunin) In-Reply-To: References: Message-ID: <43F93D3C.9060101@spiralcomms.com> Many thanks, Jim for the workaround. somehow, I just never thought of that. this will solve my problems. thks again! regards cheemeng > Date: Fri, 17 Feb 2006 09:32:55 -0800 > From: Jim Hugunin > Subject: Re: [IronPython] howto access interface method? > To: Discussion of IronPython > Message-ID: > > > Content-Type: text/plain; charset="us-ascii" > > Dino's right that this is behavior that we'd like to make more natural and that we'll look into fixing. > > However, there's a classic python-style work-around for this issue that can also be used to handle the case where a class implements two conflicting interfaces. This relies on the fact that methods are first class entities in Python. BTW - I'd suggest that you use shorter form names in actual code: > > >>>> import clr >>>> clr.AddReferenceByPartialName("System.Windows.Forms") >>>> import System >>>> dgv = System.Windows.Forms.DataGridView() >>>> dgv.BeginInit() #fails >>>> > Traceback (most recent call last): > File , line 0, in input##102 > AttributeError: 'DataGridView' object has no attribute 'BeginInit' > >>>> System.ComponentModel.ISupportInitialize.BeginInit(dgv) #works >>>> >>>> > > This is the same idiom that Python uses for explicitly calling a super classes method on a subclass and can be used here to call an interface method on an object that explicitly implements and interface but doesn't expose the methods directly. > > While we'll try to do the right thing for you behind the scenes more often, this idiom is valuable to know as the "true" way to call these kinds of methods. This same approach can also be used sometimes with COM objects when we fail to do the right thing for you automagically. > > -Jim > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Thursday, February 16, 2006 8:56 AM > To: Discussion of IronPython > Subject: Re: [IronPython] howto access interface method? > > The issue here is that the interface's methods are marked private, but are exposed publicly via the interface (aka explicit interface implementation) -hence the reason you need the cast in C#. > > This is a shortcoming we're aware of but we don't have a bug on it. I'll go ahead and file a bug on this so it doesn't get lost. The fix may be a little complex for this one so it may not make it for beta 4 but I'll initially open it as a beta 4 bug so we'll give it a shot. > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Chee Meng > Sent: Thursday, February 16, 2006 12:58 AM > To: users at lists.ironpython.com > Subject: [IronPython] howto access interface method? > > > hi, > > I am using the DataGridView object which implements the interface ISupportInitialize, > and that have 2 methods BeginInit and EndInit . > > However, through Ironpython, > the 2 methods cannot be found. > > is there a way to access the 2 methods in python? > > #((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); > this.dataGridView1.BeginInit() > > above code gives this error, AttributeError: 'DataGridView' object has no attribute 'BeginInit' > > > thks > > > regards > cheemeng > > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 > > > End of users Digest, Vol 19, Issue 17 > ************************************* > From sanxiyn at gmail.com Mon Feb 20 07:29:19 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 20 Feb 2006 15:29:19 +0900 Subject: [IronPython] IronPython 1.0 Beta 3 on Mono In-Reply-To: <5b0248170602160748t2de43735q@mail.gmail.com> References: <5b0248170602160748t2de43735q@mail.gmail.com> Message-ID: <5b0248170602192229y8d7b482u@mail.gmail.com> 2006/2/17, Sanghyeon Seo : > "Mono SVN trunk" referred below is revision 56919, in case that matters. > > Neither current Mono release nor current Mono SVN trunk can run Beta 3 > binary. Both fails at startup with: > > Unhandled Exception: System.NotImplementedException: The requested > feature is not implemented. > in <...> System.Reflection.Emit.DynamicMethod:DefineParameter (Int32 > position, ParameterAttributes attributes, System.String strParamName) As this feature is now implemented, Mono revision above 57000 should work fine. (I'm at revision 57059.) Nice! Seo Sanghyeon From paparipote at hotmail.com Mon Feb 20 13:51:34 2006 From: paparipote at hotmail.com (Paparipote .) Date: Mon, 20 Feb 2006 08:51:34 -0400 Subject: [IronPython] Two questions about .exe files generated by IronPython.Hosting.PythonCompiler Message-ID: Hello: I have two questions about this: 1) I invoke the Show.exe program which prints command-line arguments: Show arg1 arg2 The result I get is arg1 arg2 However should not it be: Show arg1 arg2 (the script name should be included in the "argv") ? 2) When I run an .exe, it claims for ironpython.dll; only when I copy this .dll to the same folder of the .exe file, all things goes well. However, how can I avoid this copy and get the .exe to run? Regards _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ From dinov at exchange.microsoft.com Mon Feb 20 18:52:07 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 20 Feb 2006 09:52:07 -0800 Subject: [IronPython] Two questions about .exe files generated by IronPython.Hosting.PythonCompiler In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E01A124AB@df-foxhound-msg.exchange.corp.microsoft.com> You're absolutely correct we should include sys.argv... This was just an oversight - when I initially ran the tests I compared against CPython just running at the console. For the 2nd issue what we really need to do is strong name IronPython and install it into the GAC. Then all assemblies will be able to access it. We want to look at the implications of this more closely though before we go and make the change. You could either re-build with a strong name or until we make the change you'll need to keep copying IronPython.dll over. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote . Sent: Monday, February 20, 2006 4:52 AM To: users at lists.ironpython.com Subject: [IronPython] Two questions about .exe files generated by IronPython.Hosting.PythonCompiler Hello: I have two questions about this: 1) I invoke the Show.exe program which prints command-line arguments: Show arg1 arg2 The result I get is arg1 arg2 However should not it be: Show arg1 arg2 (the script name should be included in the "argv") ? 2) When I run an .exe, it claims for ironpython.dll; only when I copy this .dll to the same folder of the .exe file, all things goes well. However, how can I avoid this copy and get the .exe to run? Regards _________________________________________________________________ Charla con tus amigos en l?nea mediante MSN Messenger: http://messenger.latam.msn.com/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From paparipote at hotmail.com Tue Feb 21 00:20:11 2006 From: paparipote at hotmail.com (Paparipote .) Date: Mon, 20 Feb 2006 19:20:11 -0400 Subject: [IronPython] Screen inhibited when running a .py program that uses ShowDialog Message-ID: To demonstrate this please: 1) invoke ironpythonconsole from DOS prompt 2) Copy and paste the next code (it is inoffensive): import winforms from System.Windows.Forms import * from System.Drawing import * def ShowFiles(multiSel=1, title="Select a File to select"): fd = OpenFileDialog() fd.Multiselect = multiSel fd.Title = title if fd.ShowDialog() == DialogResult.OK: return (0, fd.FileNames) else: msg = 'Selection of file(s) was cancelled.' MessageBox.Show(msg) return (1, msg) if __name__ == '__main__': res = ShowFiles(title="Select files to show") if res[0] == 0: for i in res[1]: print i MessageBox.Show("Successful show") 3) In the File dialog window Select one or more files and press OK or cancel. 4) All finishes well, ?ok? Now, save the code in a file (for example cat.py) 1) From a Dos command prompt type: ironpythonconsole cat.py and press return. 2) Do the same actions as above. 3) After finishing the script with a windows message box, does not it keep hanged?' Please, confirm me that? Thanks. Best regards. _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ From neville.bagnall at propylon.com Tue Feb 21 20:54:26 2006 From: neville.bagnall at propylon.com (Neville Bagnall) Date: Tue, 21 Feb 2006 19:54:26 -0000 Subject: [IronPython] Bugs: os.environ and os.path.exists/os.stat Message-ID: I've found these two cases of incorrect behaviour with Beta 3. os.environ is not populated: >>> import nt >>> nt.environ Traceback (most recent call last): File , line 0, in input##414 AttributeError: 'module' object has no attribute 'environ' >>> import os >>> os.environ {} os.stat returns fails to raise an exception for non-existent files, consequently os.path.exists always return True: >>> import System.IO >>> System.IO.Directory.Exists('c:/path') False >>> System.IO.Directory.GetCreationTime('c:/path') 01/01/1601 00:00:00 >>> import os >>> os.path.exists('c:/path') True Regards, Neville. From jvm_cop at spamcop.net Tue Feb 21 21:50:17 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Tue, 21 Feb 2006 15:50:17 -0500 Subject: [IronPython] IronPython 1.0 Beta 3 Released! In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E019015C5@df-foxhound-msg.e xchange.corp.microsoft.com> References: Message-ID: <4.3.2.7.2.20060221154305.04f97dd0@mail.comcast.net> Shouldn't the function below raise an exception if the object holds neither an assemnbly nor a string? Silence should not be a translation of "we ignored what you passed in because it was not an expected type" !! (Should there perhaps be another block supporting reference being an AssemblyName? I don't know where a Python programmer would get one, however.) At 12:36 PM 2/16/2006, Dino Viehland wrote (in part) >[snip] >Unfortunately then you'll start hitting the stack overflow bug that Jon reported. His fix is close to being right, but really it should become: > > private void AddReference(object reference) { > Assembly asmRef = reference as Assembly; > if (asmRef != null) { > AddReference(asmRef); > return; > } > > string strRef = reference as string; > if (strRef != null) { > AddReference(strRef); > return; > } > } >[snip] J. Merrill / Analytical Software Corp From jvm_cop at spamcop.net Tue Feb 21 22:00:22 2006 From: jvm_cop at spamcop.net (J. Merrill) Date: Tue, 21 Feb 2006 16:00:22 -0500 Subject: [IronPython] howto access interface method? In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01901582@df-foxhound-msg.e xchange.corp.microsoft.com> References: <2006021616:57:59lcm@spiralcomms.com> Message-ID: <4.3.2.7.2.20060221155758.04e30008@mail.comcast.net> Would it be reasonable to use syntax this.DataGridView1[ISupportInitialize].BeginInit to do the equivalent of "casting to an interface" in IP? At 11:55 AM 2/16/2006, Dino Viehland wrote >The issue here is that the interface's methods are marked private, but are exposed publicly via the interface (aka explicit interface implementation) -hence the reason you need the cast in C#. > >This is a shortcoming we're aware of but we don't have a bug on it. I'll go ahead and file a bug on this so it doesn't get lost. The fix may be a little complex for this one so it may not make it for beta 4 but I'll initially open it as a beta 4 bug so we'll give it a shot. > > >-----Original Message----- >From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Chee Meng >Sent: Thursday, February 16, 2006 12:58 AM >To: users at lists.ironpython.com >Subject: [IronPython] howto access interface method? > > >hi, > >I am using the DataGridView object which implements the interface ISupportInitialize, >and that have 2 methods BeginInit and EndInit . > >However, through Ironpython, >the 2 methods cannot be found. > >is there a way to access the 2 methods in python? > >#((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); >this.dataGridView1.BeginInit() > >above code gives this error, AttributeError: 'DataGridView' object has no attribute 'BeginInit' > > >thks > > >regards >cheemeng J. Merrill / Analytical Software Corp From dinov at exchange.microsoft.com Tue Feb 21 22:07:00 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 21 Feb 2006 13:07:00 -0800 Subject: [IronPython] IronPython 1.0 Beta 3 Released! In-Reply-To: <4.3.2.7.2.20060221154305.04f97dd0@mail.comcast.net> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01A12EC7@df-foxhound-msg.exchange.corp.microsoft.com> I think you're right about needing to throw here. I'll get that fixed for the next beta. AssemblyName's are an interesting idea, but I wonder if anyone will ever get an assembly name too. I think it's probably best to stay away from that until we know of a scenario where this actually makes a difference. If someone really needs to interact that deeply w/ CLR loading they can always fall back to giving us the raw assembly object after doing an Assembly.Load(AssemblyName). But I'd rather add the feature later than have some useless dead code lingering around forever :). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Tuesday, February 21, 2006 12:50 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.0 Beta 3 Released! Shouldn't the function below raise an exception if the object holds neither an assemnbly nor a string? Silence should not be a translation of "we ignored what you passed in because it was not an expected type" !! (Should there perhaps be another block supporting reference being an AssemblyName? I don't know where a Python programmer would get one, however.) At 12:36 PM 2/16/2006, Dino Viehland wrote (in part) >[snip] >Unfortunately then you'll start hitting the stack overflow bug that Jon reported. His fix is close to being right, but really it should become: > > private void AddReference(object reference) { > Assembly asmRef = reference as Assembly; > if (asmRef != null) { > AddReference(asmRef); > return; > } > > string strRef = reference as string; > if (strRef != null) { > AddReference(strRef); > return; > } > } >[snip] J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Feb 21 22:01:44 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 21 Feb 2006 13:01:44 -0800 Subject: [IronPython] Bugs: os.environ and os.path.exists/os.stat In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E01A12EBD@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the bug reports - I've got these filed and we'll get both of these fixed for Beta 4. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Neville Bagnall Sent: Tuesday, February 21, 2006 11:54 AM To: users at lists.ironpython.com Subject: [IronPython] Bugs: os.environ and os.path.exists/os.stat I've found these two cases of incorrect behaviour with Beta 3. os.environ is not populated: >>> import nt >>> nt.environ Traceback (most recent call last): File , line 0, in input##414 AttributeError: 'module' object has no attribute 'environ' >>> import os >>> os.environ {} os.stat returns fails to raise an exception for non-existent files, consequently os.path.exists always return True: >>> import System.IO >>> System.IO.Directory.Exists('c:/path') False >>> System.IO.Directory.GetCreationTime('c:/path') 01/01/1601 00:00:00 >>> import os >>> os.path.exists('c:/path') True Regards, Neville. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Feb 21 22:10:27 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 21 Feb 2006 13:10:27 -0800 Subject: [IronPython] howto access interface method? In-Reply-To: <4.3.2.7.2.20060221155758.04e30008@mail.comcast.net> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01A12ED3@df-foxhound-msg.exchange.corp.microsoft.com> It's an interesting idea, but I think it'll end up conflicting w/ generics. What happens if I have a class that explicitly implements an interface that has BeginInit on it and defines a BeginInit method? We won't know which one we should bind to. My current thoughts on this are self.DataGridView1.ISupperInitialize_BeginInit. It's more verbose then I'd like it, but it also avoids versioning problems (where someone could add "BeginInit" in a later version and suddently you're calling something different). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Tuesday, February 21, 2006 1:00 PM To: Discussion of IronPython Subject: Re: [IronPython] howto access interface method? Would it be reasonable to use syntax this.DataGridView1[ISupportInitialize].BeginInit to do the equivalent of "casting to an interface" in IP? At 11:55 AM 2/16/2006, Dino Viehland wrote >The issue here is that the interface's methods are marked private, but are exposed publicly via the interface (aka explicit interface implementation) -hence the reason you need the cast in C#. > >This is a shortcoming we're aware of but we don't have a bug on it. I'll go ahead and file a bug on this so it doesn't get lost. The fix may be a little complex for this one so it may not make it for beta 4 but I'll initially open it as a beta 4 bug so we'll give it a shot. > > >-----Original Message----- >From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Chee Meng >Sent: Thursday, February 16, 2006 12:58 AM >To: users at lists.ironpython.com >Subject: [IronPython] howto access interface method? > > >hi, > >I am using the DataGridView object which implements the interface ISupportInitialize, >and that have 2 methods BeginInit and EndInit . > >However, through Ironpython, >the 2 methods cannot be found. > >is there a way to access the 2 methods in python? > >#((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); >this.dataGridView1.BeginInit() > >above code gives this error, AttributeError: 'DataGridView' object has no attribute 'BeginInit' > > >thks > > >regards >cheemeng J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Feb 22 01:28:43 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 21 Feb 2006 16:28:43 -0800 Subject: [IronPython] CLR Compiler Lab - March 13th thru March15th Message-ID: <4039D552ADAB094BB1EA670F3E96214E01A13159@df-foxhound-msg.exchange.corp.microsoft.com> I just wanted to let everyone know of an upcoming compiler lab where one of the topics will be IronPython. It will be hosted here in Redmond from March 13th thru March 15th. This will be primarily focused at compiler writers targeting the CLR. Therefore this will probably be more interesting if you're interested in the internals of IronPython and looking at implementing a compiler for the CLR. If you're just using IronPython because it's a wonderful programming language and an efficient way to program w/ .NET then it might not be that insightful for you. If you'd like more information both Kathy Kam (a PM on the CLR team) and Michael Lehman (a technical evangelist) have blogged w/ more details: http://blogs.msdn.com/kathykam/archive/2006/02/09/528773.aspx http://blogs.msdn.com/mglehman/archive/2006/02/10/529663.aspx There's even a free BBQ dinner Tuesday night! Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -------------- next part -------------- An HTML attachment was scrubbed... URL: From Nathan.Ernst at citadelgroup.com Wed Feb 22 02:12:46 2006 From: Nathan.Ernst at citadelgroup.com (Ernst, Nathan) Date: Tue, 21 Feb 2006 19:12:46 -0600 Subject: [IronPython] IronPython 1.0 Beta 3 Released! Message-ID: Perhaps this is just an appropriate place for an overload of super? Not having tried it, I can't comment on whether or not this will work. But, rather than adding a new syntax for an "implicit" cast, the python-ish way of doing this would seem to be to force an explicit "cast" using super. In C#, wouldn't you be required to issue an explicit cast to invoke the member? Why in IronPython should it be any different? My $.02 -Nathan Ernst -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Tuesday, February 21, 2006 3:07 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.0 Beta 3 Released! I think you're right about needing to throw here. I'll get that fixed for the next beta. AssemblyName's are an interesting idea, but I wonder if anyone will ever get an assembly name too. I think it's probably best to stay away from that until we know of a scenario where this actually makes a difference. If someone really needs to interact that deeply w/ CLR loading they can always fall back to giving us the raw assembly object after doing an Assembly.Load(AssemblyName). But I'd rather add the feature later than have some useless dead code lingering around forever :). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE -11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Tuesday, February 21, 2006 12:50 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.0 Beta 3 Released! Shouldn't the function below raise an exception if the object holds neither an assemnbly nor a string? Silence should not be a translation of "we ignored what you passed in because it was not an expected type" !! (Should there perhaps be another block supporting reference being an AssemblyName? I don't know where a Python programmer would get one, however.) At 12:36 PM 2/16/2006, Dino Viehland wrote (in part) >[snip] >Unfortunately then you'll start hitting the stack overflow bug that Jon reported. His fix is close to being right, but really it should become: > > private void AddReference(object reference) { > Assembly asmRef = reference as Assembly; > if (asmRef != null) { > AddReference(asmRef); > return; > } > > string strRef = reference as string; > if (strRef != null) { > AddReference(strRef); > return; > } > } >[snip] J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Feb 22 02:28:57 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 21 Feb 2006 17:28:57 -0800 Subject: [IronPython] IronPython 1.0 Beta 3 Released! In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E01A1320B@df-foxhound-msg.exchange.corp.microsoft.com> Not sure if our wires are getting crossed here or what (there's a separate implicit cast thread somewhere else I thought, but anyway...) Implicit casts should actually happen implicitly though - you shouldn?t need any syntax to cause them to happen. The closest thing I could find in CPython to an implicit cast was __coerce__ for numeric methods, but it has rather strange semantics compared to what we want here. In C# if you define an implict cast: public class A { public A(int value) { this.value = value; } public int value; public static implicit operator B(A a) { return new B(a.value); } } You can then do: B xyz = A(5); And it compiles and the C# calls the implicit cast under the covers. If you did an explicit cast instead you would indeed need to add the cast: B xyz = (B)A(5); Otherwise it wouldn't compile. I think a good syntax for the explicit cast might just be object creation like: xyz = B(A(5)) which is similar in many respects to: a = int('23') although then there'd probably be issues w/ a class that defines both a constructor & an explicit cast, so this is more complex than implicit casts (for implicit casts we can just fall back to checking for op_Implicit on the type as the last step of our conversion efforts, so it fits in nicely). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Ernst, Nathan Sent: Tuesday, February 21, 2006 5:13 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.0 Beta 3 Released! Perhaps this is just an appropriate place for an overload of super? Not having tried it, I can't comment on whether or not this will work. But, rather than adding a new syntax for an "implicit" cast, the python-ish way of doing this would seem to be to force an explicit "cast" using super. In C#, wouldn't you be required to issue an explicit cast to invoke the member? Why in IronPython should it be any different? My $.02 -Nathan Ernst -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Tuesday, February 21, 2006 3:07 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.0 Beta 3 Released! I think you're right about needing to throw here. I'll get that fixed for the next beta. AssemblyName's are an interesting idea, but I wonder if anyone will ever get an assembly name too. I think it's probably best to stay away from that until we know of a scenario where this actually makes a difference. If someone really needs to interact that deeply w/ CLR loading they can always fall back to giving us the raw assembly object after doing an Assembly.Load(AssemblyName). But I'd rather add the feature later than have some useless dead code lingering around forever :). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE -11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of J. Merrill Sent: Tuesday, February 21, 2006 12:50 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.0 Beta 3 Released! Shouldn't the function below raise an exception if the object holds neither an assemnbly nor a string? Silence should not be a translation of "we ignored what you passed in because it was not an expected type" !! (Should there perhaps be another block supporting reference being an AssemblyName? I don't know where a Python programmer would get one, however.) At 12:36 PM 2/16/2006, Dino Viehland wrote (in part) >[snip] >Unfortunately then you'll start hitting the stack overflow bug that Jon reported. His fix is close to being right, but really it should become: > > private void AddReference(object reference) { > Assembly asmRef = reference as Assembly; > if (asmRef != null) { > AddReference(asmRef); > return; > } > > string strRef = reference as string; > if (strRef != null) { > AddReference(strRef); > return; > } > } >[snip] J. Merrill / Analytical Software Corp _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From alexei.vinidiktov at gmail.com Wed Feb 22 02:50:44 2006 From: alexei.vinidiktov at gmail.com (Alexei Vinidiktov) Date: Wed, 22 Feb 2006 08:50:44 +0700 Subject: [IronPython] How to generate an exe using IronPython.Hosting.PythonCompiler? Message-ID: <43FBC374.30002@gmail.com> Hello, I'd like to use IronPython.Hosting.PythonCompiler for generating exe files from my scripts, but I can't figure out how to do it. Could someone please provide a minimal example? Thanks a lot! -- Kind regards, Alexei Vinidiktov From sanxiyn at gmail.com Wed Feb 22 06:38:56 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Wed, 22 Feb 2006 14:38:56 +0900 Subject: [IronPython] How to generate an exe using IronPython.Hosting.PythonCompiler? In-Reply-To: <43FBC374.30002@gmail.com> References: <43FBC374.30002@gmail.com> Message-ID: <5b0248170602212138v37a6062al@mail.gmail.com> 2006/2/22, Alexei Vinidiktov : > I'd like to use IronPython.Hosting.PythonCompiler for generating exe > files from my scripts, but I can't figure out how to do it. In the IronPython distribution, Src/Scripts/Tests/compiler.py should be enough to get started. Here's a minimal example in IronPython: # compiler.py from IronPython.Hosting import PythonCompiler from System.Collections.Generic import List sources = List[str]() sources.Add('hello.py') outfile = 'hello.exe' compiler = PythonCompiler(sources, outfile) compiler.Compile() Seo Sanghyeon From maxiplux at gmail.com Wed Feb 22 20:57:15 2006 From: maxiplux at gmail.com (lord abel devas "the gmail") Date: Wed, 22 Feb 2006 14:57:15 -0500 Subject: [IronPython] como hacer gui en ironpython Message-ID: <52c2fb950602221157n5f8f4025x9e5ca301a11bf795@mail.gmail.com> puedo hacer gui comon en ironpython y con el dise?ador de intefaces de vst2005 -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Wed Feb 22 21:24:23 2006 From: kfarmer at thuban.org (Keith J. Farmer) Date: Wed, 22 Feb 2006 12:24:23 -0800 Subject: [IronPython] como hacer gui en ironpython References: <52c2fb950602221157n5f8f4025x9e5ca301a11bf795@mail.gmail.com> Message-ID: Por Google, hay exemplos en http://ironpythonwin.blogspot.com/ (Perdon, solamente puedo hablar espanol un poquitissimo. ;) ________________________________ From: users-bounces at lists.ironpython.com on behalf of lord abel devas "the gmail" Sent: Wed 2/22/2006 11:57 AM To: users at lists.ironpython.com Subject: [IronPython] como hacer gui en ironpython puedo hacer gui comon en ironpython y con el dise?ador de intefaces de vst2005 -------------- next part -------------- A non-text attachment was scrubbed... Name: winmail.dat Type: application/ms-tnef Size: 3566 bytes Desc: not available URL: From Martin.Maly at microsoft.com Wed Feb 22 21:55:20 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Wed, 22 Feb 2006 12:55:20 -0800 Subject: [IronPython] Screen inhibited when running a .py program that uses ShowDialog In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F50195CEE3@df-foxhound-msg.exchange.corp.microsoft.com> Hi, I am assuming that the winforms your code imports at the top is the winforms.py that we include with our tutorial. If that is indeed the case, it may very well be the cause of the hang you are seeing. The winforms.py does a bit more than just import the System.Windows.Forms assemblies. It also creates another thread that the code interactively typed at the console will run on. The reason is that the console thread is suspended, waiting for input and cannot process messages for the window application which is being interactively built. Therefore the winforms.py launches new thread that the interactive code will execute on. Once you run your code as a script, you are likely to hit problems. One reason for the hang I can see from the top of my head is that the thread created by winforms.py depends on the console exiting to exit its message loop so it may cause your app to stay up and running/limping :). The solution is to not import winforms.py and only use the following code at the top of your script (taken from winforms.py) import clr clr.AddReferenceByPartialName("System.Windows.Forms") clr.AddReferenceByPartialName("System.Drawing") Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Paparipote . Sent: Monday, February 20, 2006 3:20 PM To: users at lists.ironpython.com Subject: [IronPython] Screen inhibited when running a .py program that uses ShowDialog To demonstrate this please: 1) invoke ironpythonconsole from DOS prompt 2) Copy and paste the next code (it is inoffensive): import winforms from System.Windows.Forms import * from System.Drawing import * def ShowFiles(multiSel=1, title="Select a File to select"): fd = OpenFileDialog() fd.Multiselect = multiSel fd.Title = title if fd.ShowDialog() == DialogResult.OK: return (0, fd.FileNames) else: msg = 'Selection of file(s) was cancelled.' MessageBox.Show(msg) return (1, msg) if __name__ == '__main__': res = ShowFiles(title="Select files to show") if res[0] == 0: for i in res[1]: print i MessageBox.Show("Successful show") 3) In the File dialog window Select one or more files and press OK or cancel. 4) All finishes well, ?ok? Now, save the code in a file (for example cat.py) 1) From a Dos command prompt type: ironpythonconsole cat.py and press return. 2) Do the same actions as above. 3) After finishing the script with a windows message box, does not it keep hanged?' Please, confirm me that? Thanks. Best regards. _________________________________________________________________ Las mejores tiendas, los precios mas bajos, entregas en todo el mundo, YupiMSN Compras: http://latam.msn.com/compras/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From alexei.vinidiktov at gmail.com Thu Feb 23 11:13:56 2006 From: alexei.vinidiktov at gmail.com (Alexei Vinidiktov) Date: Thu, 23 Feb 2006 17:13:56 +0700 Subject: [IronPython] How to generate an exe using IronPython.Hosting.PythonCompiler? In-Reply-To: <5b0248170602212138v37a6062al@mail.gmail.com> References: <43FBC374.30002@gmail.com> <5b0248170602212138v37a6062al@mail.gmail.com> Message-ID: <43FD8AE4.7040809@gmail.com> Thanks a lot, Seo! Sanghyeon Seo wrote: > 2006/2/22, Alexei Vinidiktov : > >>I'd like to use IronPython.Hosting.PythonCompiler for generating exe >>files from my scripts, but I can't figure out how to do it. > > > In the IronPython distribution, Src/Scripts/Tests/compiler.py should > be enough to get started. > > Here's a minimal example in IronPython: > > # compiler.py > from IronPython.Hosting import PythonCompiler > > from System.Collections.Generic import List > sources = List[str]() > sources.Add('hello.py') > outfile = 'hello.exe' > > compiler = PythonCompiler(sources, outfile) > compiler.Compile() > > Seo Sanghyeon -- Kind regards, Alexei Vinidiktov From etienne.fortin at sensio.tv Thu Feb 23 16:59:20 2006 From: etienne.fortin at sensio.tv (Etienne Fortin) Date: Thu, 23 Feb 2006 10:59:20 -0500 Subject: [IronPython] Crash on Beta3 Message-ID: clr.AddReference("") crash IronPython 1.0 Beta 3 with an StackOverflowException on my system. Looks like a recursive call that never ends... Anyone else experienced that? From dinov at exchange.microsoft.com Thu Feb 23 17:34:20 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 23 Feb 2006 08:34:20 -0800 Subject: [IronPython] Crash on Beta3 In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E01AA6EDA@df-foxhound-msg.exchange.corp.microsoft.com> Yep, it's a known issue w/ beta 3. We'll have it fixed for beta 4. You can work around this by going to the CLR to do the load: import System clr.AddReference(System.Reflection.Assembly.Load('')) as a temporarily workaround (you may find you need to call .LoadFrom instead of .Load to get the assembly loaded). Sorry for the trouble! Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Etienne Fortin Sent: Thursday, February 23, 2006 7:59 AM To: users at lists.ironpython.com Subject: [IronPython] Crash on Beta3 clr.AddReference("") crash IronPython 1.0 Beta 3 with an StackOverflowException on my system. Looks like a recursive call that never ends... Anyone else experienced that? _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From joesox at gmail.com Thu Feb 23 22:41:02 2006 From: joesox at gmail.com (JoeSox) Date: Thu, 23 Feb 2006 13:41:02 -0800 Subject: [IronPython] New User Message-ID: <785694cd0602231341s49341b80o186a1c4b858a64b3@mail.gmail.com> Hello, I'm new to using IronPython and am working, in my spare time, to integrate MIT's ConceptNet to C# and am debating to use IronPython or not. Right now I am having trouble understanding how, and if, IronPython is compatible with Tkinker because I am just trying to run ConceptNet's Mini-Browser demo thru IronPython. There maybe an easy answer to this question but seeing how I am new to both Python and IronPython, it is not obvious to me. Thanks, -- Joseph From joesox at gmail.com Thu Feb 23 23:01:16 2006 From: joesox at gmail.com (JoeSox) Date: Thu, 23 Feb 2006 14:01:16 -0800 Subject: [IronPython] New User In-Reply-To: <785694cd0602231341s49341b80o186a1c4b858a64b3@mail.gmail.com> References: <785694cd0602231341s49341b80o186a1c4b858a64b3@mail.gmail.com> Message-ID: <785694cd0602231401g6508e3fp67f152f139119555@mail.gmail.com> I guess I should add more details, in case anyone is interested: I believe I am importing everything Tkinter needs but I am not sure: myMethod() PythonEngine engine = new PythonEngine(); try { engine.SetVariable("IronPyTest", this); //Let the engine know what directories we are working in engine.AddToPath(Common.RuntimeDir); engine.AddToPath(Common.ConceptNetDir); engine.AddToPath(Common.Python24_LibDir); engine.AddToPath(Common.Python24_libsDir); engine.AddToPath(Common.montylinguaDir); //Natural Python24 Modules needed engine.Import("types"); engine.Import("inspect"); engine.Import("from repr import Repr"); engine.Import("FixTk"); engine.Import("from types import *"); engine.Import("from Tkconstants import *"); engine.Import("_tkinter"); engine.Import("zlib"); engine.Import("Tkinter"); engine.Import("from Tkinter import *"); ....} Here is the exception info: ===== IronPython.Runtime.PythonImportError was unhandled Message="No module named Tkinter" Source="IronPython" StackTrace: at IronPython.Runtime.ReflectedMethodBase.Invoke(MethodBinding binding) in C:\Documents and Settings\Joe\My Documents\Visual Studio 2005\Code Snippets\Visual C#\IronPython-1.0-Beta3\Src\IronPython\Runtime\ReflectedMethod.cs:line 303 at IronPython.Runtime.ReflectedMethodBase.TryCallWorker(Object[] args, Object& ret) in C:\Documents and Settings\Joe\My Documents\Visual Studio 2005\Code Snippets\Visual C#\IronPython-1.0-Beta3\Src\IronPython\Runtime\ReflectedMethod.cs:line 477 at IronPython.Runtime.ReflectedMethodBase.Call(Object[] args) in C:\Documents and Settings\Joe\My Documents\Visual Studio 2005\Code Snippets\Visual C#\IronPython-1.0-Beta3\Src\IronPython\Runtime\ReflectedMethod.cs:line 134 at IronPython.Runtime.ReflectedMethodBase.Call(ICallerContext context, Object[] args) in C:\Documents and Settings\Joe\My Documents\Visual Studio 2005\Code Snippets\Visual C#\IronPython-1.0-Beta3\Src\IronPython\Runtime\ReflectedMethod.cs:line 124 at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object func, Object[] args) in C:\Documents and Settings\Joe\My Documents\Visual Studio 2005\Code Snippets\Visual C#\IronPython-1.0-Beta3\Src\IronPython\Runtime\Ops.cs:line 823 at IronPython.Runtime.Ops.CallWithContext(ICallerContext context, Object func, Object arg0, Object arg1, Object arg2, Object arg3) in C:\Documents and Settings\Joe\My Documents\Visual Studio 2005\Code Snippets\Visual C#\IronPython-1.0-Beta3\Src\IronPython\Runtime\Ops.Generated.cs:line 155 at IronPython.Runtime.Importer.Import(PythonModule mod, String fullName, List from) in C:\Documents and Settings\Joe\My Documents\Visual Studio 2005\Code Snippets\Visual C#\IronPython-1.0-Beta3\Src\IronPython\Runtime\Importer.cs:line 40 at IronPython.Runtime.Ops.ImportStar(PythonModule mod, String fullName) in C:\Documents and Settings\Joe\My Documents\Visual Studio 2005\Code Snippets\Visual C#\IronPython-1.0-Beta3\Src\IronPython\Runtime\Ops.cs:line 1407 at tmp0.Initialize() in C:\Documents and Settings\Joe\My Documents\Python Projects\conceptnet2.1\ConceptNetGUI.py:line 32 at IronPython.Runtime.PythonModule.Initialize() in C:\Documents and Settings\Joe\My Documents\Visual Studio 2005\Code Snippets\Visual C#\IronPython-1.0-Beta3\Src\IronPython\Runtime\PythonModule.cs:line 126 at IronPython.Hosting.PythonEngine.RunFile(String fileName) in C:\Documents and Settings\Joe\My Documents\Visual Studio 2005\Code Snippets\Visual C#\IronPython-1.0-Beta3\Src\IronPython\Hosting\PythonEngine.cs:line 259 at myIronPythonDemo.Form1.btPyBrowse_Click(Object sender, EventArgs e) in C:\Documents and Settings\Joe\My Documents\Visual Studio 2005\Projects\myIronPythonDemo\myIronPythonDemo\Form1.cs:line 142 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at myIronPythonDemo.Program.Main() in C:\Documents and Settings\Joe\My Documents\Visual Studio 2005\Projects\myIronPythonDemo\myIronPythonDemo\Program.cs:line 17 at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() ===== And ConceptNetGUI.py:line 32 reads: from Tkinter import * -- Joseph From dinov at exchange.microsoft.com Thu Feb 23 23:23:11 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 23 Feb 2006 14:23:11 -0800 Subject: [IronPython] New User In-Reply-To: <785694cd0602231341s49341b80o186a1c4b858a64b3@mail.gmail.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01AA72F7@df-foxhound-msg.exchange.corp.microsoft.com> The tkinter module requires that we implement the _tkinter module in the IronPython core. Currently we haven't done that, and I don't think it's really been on our radar. Alternately there is both WinForms and Avalon/WPF interop but that might not meet your interoperability needs. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox Sent: Thursday, February 23, 2006 1:41 PM To: users at lists.ironpython.com Subject: [IronPython] New User Hello, I'm new to using IronPython and am working, in my spare time, to integrate MIT's ConceptNet to C# and am debating to use IronPython or not. Right now I am having trouble understanding how, and if, IronPython is compatible with Tkinker because I am just trying to run ConceptNet's Mini-Browser demo thru IronPython. There maybe an easy answer to this question but seeing how I am new to both Python and IronPython, it is not obvious to me. Thanks, -- Joseph _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Thu Feb 23 23:25:15 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 23 Feb 2006 14:25:15 -0800 Subject: [IronPython] New User In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01AA72F7@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01AA7300@df-foxhound-msg.exchange.corp.microsoft.com> Actually I guess it's not quite a built-in module, it's a DLL that comes w/ Python. But we also don't support CPython's plugin model either. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Thursday, February 23, 2006 2:23 PM To: Discussion of IronPython Subject: Re: [IronPython] New User The tkinter module requires that we implement the _tkinter module in the IronPython core. Currently we haven't done that, and I don't think it's really been on our radar. Alternately there is both WinForms and Avalon/WPF interop but that might not meet your interoperability needs. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of JoeSox Sent: Thursday, February 23, 2006 1:41 PM To: users at lists.ironpython.com Subject: [IronPython] New User Hello, I'm new to using IronPython and am working, in my spare time, to integrate MIT's ConceptNet to C# and am debating to use IronPython or not. Right now I am having trouble understanding how, and if, IronPython is compatible with Tkinker because I am just trying to run ConceptNet's Mini-Browser demo thru IronPython. There maybe an easy answer to this question but seeing how I am new to both Python and IronPython, it is not obvious to me. Thanks, -- Joseph _______________________________________________ users mailing list users at lists.ironpython.com http://lists.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 joesox at gmail.com Thu Feb 23 23:56:02 2006 From: joesox at gmail.com (JoeSox) Date: Thu, 23 Feb 2006 14:56:02 -0800 Subject: [IronPython] New User In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01AA72F7@df-foxhound-msg.exchange.corp.microsoft.com> References: <785694cd0602231341s49341b80o186a1c4b858a64b3@mail.gmail.com> <4039D552ADAB094BB1EA670F3E96214E01AA72F7@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <785694cd0602231456q240fc728q109eade6c149f3d9@mail.gmail.com> On 2/23/06, Dino Viehland wrote: > The tkinter module requires that we implement the _tkinter module in the IronPython core. Currently we haven't done that, and I don't think it's really been on our radar. > That is understandable. Part of me asking that question is limited knowledge about the _tkinter module and it's needs. > Alternately there is both WinForms and Avalon/WPF interop but that might not meet your interoperability needs. > That is what I am going to explore next. You have saved me some time. Thanks for the replies. -- Joseph From dans at houmus.org Fri Feb 24 01:19:21 2006 From: dans at houmus.org (Dan Shechter) Date: Fri, 24 Feb 2006 02:19:21 +0200 Subject: [IronPython] clr.AddRefernce* woes Message-ID: <001501c638d7$f64f3cf0$0200a8c0@cartman> Hi, I've just installed beta 3 drop but I can't use clr.AddReference to anything that isn't part of .NET 2.0 core libraries. I'm trying to load a .NET 2.0 compiled assembly. "PERWAPI.dll", I have a test.exe console c# program which does invoke methods and instantiate classes defined within that DLL. I'm also having problems with the tutorial "demo" using mapack.dll., I've provided a transcript below: ---------------------------------------- CUT HERE ---------------------------- >>> import clr >>> clr.AddReference("System.XML") - Crashed >>> import clr >>> clr.AddReferenceByPartialName("System.XML") - works >>> clr.AddReferenceByPartialName("Mapack") Traceback (most recent call last): File , line 0, in input##152 File , line 0, in AddReferenceByPartialName##81 RuntimeError: Could not add reference to assembly Mapack >>> clr.Path [] >>> clr.Path.append(System.Environment.CurrentDirectory) >>> clr.Path ['C:\\Development\\IronPython\\Tutorial'] >>> clr.AddReferenceByPartialName("Mapack") - Crashed ---------------------------------------- CUT HERE ---------------------------- Naturally the same happens for PERWAPI.dll (which I'm really interested in getting to work) and naturally, Both .DLLs (PERWAPI.DLL & MAPACK.DLL) are in the ' C:\Development\IronPython\Tutorial'' on my machine... Any ideas? From dinov at exchange.microsoft.com Fri Feb 24 03:07:32 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 23 Feb 2006 18:07:32 -0800 Subject: [IronPython] clr.AddRefernce* woes In-Reply-To: <001501c638d7$f64f3cf0$0200a8c0@cartman> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01AA7571@df-foxhound-msg.exchange.corp.microsoft.com> There were a couple of bugs w/ assembly loading in beta 3. As a work around you should be able to do: import System clr.AddReference(System.Reflection.Assembly.Load('System.Xml')) clr.AddReference(System.Reflection.Assembly.LoadFrom('System.Xml')) clr.AddReference(System.Reflection.Assembly.LoadWithPartialName('System.Xml')) Obviously we'll have it fixed in beta 4. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Shechter Sent: Thursday, February 23, 2006 4:19 PM To: users at lists.ironpython.com Subject: [IronPython] clr.AddRefernce* woes Hi, I've just installed beta 3 drop but I can't use clr.AddReference to anything that isn't part of .NET 2.0 core libraries. I'm trying to load a .NET 2.0 compiled assembly. "PERWAPI.dll", I have a test.exe console c# program which does invoke methods and instantiate classes defined within that DLL. I'm also having problems with the tutorial "demo" using mapack.dll., I've provided a transcript below: ---------------------------------------- CUT HERE ---------------------------- >>> import clr >>> clr.AddReference("System.XML") - Crashed >>> import clr >>> clr.AddReferenceByPartialName("System.XML") - works >>> clr.AddReferenceByPartialName("Mapack") Traceback (most recent call last): File , line 0, in input##152 File , line 0, in AddReferenceByPartialName##81 RuntimeError: Could not add reference to assembly Mapack >>> clr.Path [] >>> clr.Path.append(System.Environment.CurrentDirectory) >>> clr.Path ['C:\\Development\\IronPython\\Tutorial'] >>> clr.AddReferenceByPartialName("Mapack") - Crashed ---------------------------------------- CUT HERE ---------------------------- Naturally the same happens for PERWAPI.dll (which I'm really interested in getting to work) and naturally, Both .DLLs (PERWAPI.DLL & MAPACK.DLL) are in the ' C:\Development\IronPython\Tutorial'' on my machine... Any ideas? _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dans at houmus.org Fri Feb 24 10:49:28 2006 From: dans at houmus.org (Dan Shechter) Date: Fri, 24 Feb 2006 11:49:28 +0200 Subject: [IronPython] clr.AddRefernce* woes In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01AA7571@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <003701c63927$a61a0a30$0200a8c0@cartman> Perhaps I wasn't being clear: I have been able to use your suggested workaround to load .NET "Core" assemblies such as System.Xml etc. My problem is that I don't have a working workaround for Assemblies like mapack.dll or my own assemblies which reside in some other directory (like the IronPython tutorial directory). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Friday, February 24, 2006 04:08 To: Discussion of IronPython Subject: Re: [IronPython] clr.AddRefernce* woes There were a couple of bugs w/ assembly loading in beta 3. As a work around you should be able to do: import System clr.AddReference(System.Reflection.Assembly.Load('System.Xml')) clr.AddReference(System.Reflection.Assembly.LoadFrom('System.Xml')) clr.AddReference(System.Reflection.Assembly.LoadWithPartialName('System.Xml' )) Obviously we'll have it fixed in beta 4. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F 0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Shechter Sent: Thursday, February 23, 2006 4:19 PM To: users at lists.ironpython.com Subject: [IronPython] clr.AddRefernce* woes Hi, I've just installed beta 3 drop but I can't use clr.AddReference to anything that isn't part of .NET 2.0 core libraries. I'm trying to load a .NET 2.0 compiled assembly. "PERWAPI.dll", I have a test.exe console c# program which does invoke methods and instantiate classes defined within that DLL. I'm also having problems with the tutorial "demo" using mapack.dll., I've provided a transcript below: ---------------------------------------- CUT HERE ---------------------------- >>> import clr >>> clr.AddReference("System.XML") - Crashed >>> import clr >>> clr.AddReferenceByPartialName("System.XML") - works >>> clr.AddReferenceByPartialName("Mapack") Traceback (most recent call last): File , line 0, in input##152 File , line 0, in AddReferenceByPartialName##81 RuntimeError: Could not add reference to assembly Mapack >>> clr.Path [] >>> clr.Path.append(System.Environment.CurrentDirectory) >>> clr.Path ['C:\\Development\\IronPython\\Tutorial'] >>> clr.AddReferenceByPartialName("Mapack") - Crashed ---------------------------------------- CUT HERE ---------------------------- Naturally the same happens for PERWAPI.dll (which I'm really interested in getting to work) and naturally, Both .DLLs (PERWAPI.DLL & MAPACK.DLL) are in the ' C:\Development\IronPython\Tutorial'' on my machine... Any ideas? _______________________________________________ users mailing list users at lists.ironpython.com http://lists.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 stan at phidani.be Fri Feb 24 11:02:22 2006 From: stan at phidani.be (Stanislas Pinte) Date: Fri, 24 Feb 2006 11:02:22 +0100 Subject: [IronPython] clr.AddRefernce* woes In-Reply-To: <003701c63927$a61a0a30$0200a8c0@cartman> References: <003701c63927$a61a0a30$0200a8c0@cartman> Message-ID: <1140775341.43fed9ae04026@webmail.raincode.com> Selon Dan Shechter : > Perhaps I wasn't being clear: > I have been able to use your suggested workaround to load .NET "Core" > assemblies such as System.Xml etc. I am able to do that with the following code: (don't know if it is the recommended way) ClrModule.AddAssembly(Assembly.LoadFrom(currentDirName + Path.DirectorySeparatorChar + "MyPackage.dll")); --> all namespaces inside MyPackage.dll are then magically available in the python engine. > > My problem is that I don't have a working workaround for Assemblies like > mapack.dll or my own assemblies which reside in some other directory (like > the IronPython tutorial directory). > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Friday, February 24, 2006 04:08 > To: Discussion of IronPython > Subject: Re: [IronPython] clr.AddRefernce* woes > > There were a couple of bugs w/ assembly loading in beta 3. > > As a work around you should be able to do: > > import System > clr.AddReference(System.Reflection.Assembly.Load('System.Xml')) > > clr.AddReference(System.Reflection.Assembly.LoadFrom('System.Xml')) > > clr.AddReference(System.Reflection.Assembly.LoadWithPartialName('System.Xml' > )) > > > Obviously we'll have it fixed in beta 4. > > > Do you want to help develop Dynamic languages on CLR? > (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F > 0-45DF-8B78-DC1B43134038) > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Shechter > Sent: Thursday, February 23, 2006 4:19 PM > To: users at lists.ironpython.com > Subject: [IronPython] clr.AddRefernce* woes > > Hi, > I've just installed beta 3 drop but I can't use clr.AddReference to anything > that isn't part of .NET 2.0 core libraries. > I'm trying to load a .NET 2.0 compiled assembly. "PERWAPI.dll", I have a > test.exe console c# program > which does invoke methods and instantiate classes defined within that DLL. > I'm also having problems with the tutorial "demo" using mapack.dll., I've > provided a transcript below: > ---------------------------------------- CUT HERE > ---------------------------- > >>> import clr > >>> clr.AddReference("System.XML") > - Crashed > > >>> import clr > >>> clr.AddReferenceByPartialName("System.XML") > - works > > >>> clr.AddReferenceByPartialName("Mapack") > Traceback (most recent call last): > File , line 0, in input##152 > File , line 0, in AddReferenceByPartialName##81 > RuntimeError: Could not add reference to assembly Mapack > > >>> clr.Path > [] > > >>> clr.Path.append(System.Environment.CurrentDirectory) > > >>> clr.Path > ['C:\\Development\\IronPython\\Tutorial'] > > >>> clr.AddReferenceByPartialName("Mapack") > - Crashed > ---------------------------------------- CUT HERE > ---------------------------- > > Naturally the same happens for PERWAPI.dll (which I'm really interested in > getting to work) and naturally, > Both .DLLs (PERWAPI.DLL & MAPACK.DLL) are in the ' > C:\Development\IronPython\Tutorial'' on my machine... > > Any ideas? > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 dans at houmus.org Fri Feb 24 13:00:47 2006 From: dans at houmus.org (Dan Shechter) Date: Fri, 24 Feb 2006 14:00:47 +0200 Subject: [IronPython] clr.AddRefernce* woes In-Reply-To: <1140775341.43fed9ae04026@webmail.raincode.com> Message-ID: <003901c63939$f8700d90$0200a8c0@cartman> Worked like a charm! Thanks! Just one note, if you want to make this completely "generic" You need to >>>clr.AddAssembly(System.Reflection.Assembly.LoadFrom( System.Environment.CurrentDirectory + System.IO.Path.DirectorySeparatorChar + "MYDLL.DLL")) Danke! -----Original Message----- From: Stanislas Pinte [mailto:stan at phidani.be] Sent: Friday, February 24, 2006 12:02 To: Discussion of IronPython; Dan Shechter Cc: 'Discussion of IronPython' Subject: Re: [IronPython] clr.AddRefernce* woes Selon Dan Shechter : > Perhaps I wasn't being clear: > I have been able to use your suggested workaround to load .NET "Core" > assemblies such as System.Xml etc. I am able to do that with the following code: (don't know if it is the recommended way) ClrModule.AddAssembly(Assembly.LoadFrom(currentDirName + Path.DirectorySeparatorChar + "MyPackage.dll")); --> all namespaces inside MyPackage.dll are then magically available in the python engine. > > My problem is that I don't have a working workaround for Assemblies like > mapack.dll or my own assemblies which reside in some other directory (like > the IronPython tutorial directory). > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland > Sent: Friday, February 24, 2006 04:08 > To: Discussion of IronPython > Subject: Re: [IronPython] clr.AddRefernce* woes > > There were a couple of bugs w/ assembly loading in beta 3. > > As a work around you should be able to do: > > import System > clr.AddReference(System.Reflection.Assembly.Load('System.Xml')) > > clr.AddReference(System.Reflection.Assembly.LoadFrom('System.Xml')) > > clr.AddReference(System.Reflection.Assembly.LoadWithPartialName('System.Xml' > )) > > > Obviously we'll have it fixed in beta 4. > > > Do you want to help develop Dynamic languages on CLR? > (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F > 0-45DF-8B78-DC1B43134038) > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Shechter > Sent: Thursday, February 23, 2006 4:19 PM > To: users at lists.ironpython.com > Subject: [IronPython] clr.AddRefernce* woes > > Hi, > I've just installed beta 3 drop but I can't use clr.AddReference to anything > that isn't part of .NET 2.0 core libraries. > I'm trying to load a .NET 2.0 compiled assembly. "PERWAPI.dll", I have a > test.exe console c# program > which does invoke methods and instantiate classes defined within that DLL. > I'm also having problems with the tutorial "demo" using mapack.dll., I've > provided a transcript below: > ---------------------------------------- CUT HERE > ---------------------------- > >>> import clr > >>> clr.AddReference("System.XML") > - Crashed > > >>> import clr > >>> clr.AddReferenceByPartialName("System.XML") > - works > > >>> clr.AddReferenceByPartialName("Mapack") > Traceback (most recent call last): > File , line 0, in input##152 > File , line 0, in AddReferenceByPartialName##81 > RuntimeError: Could not add reference to assembly Mapack > > >>> clr.Path > [] > > >>> clr.Path.append(System.Environment.CurrentDirectory) > > >>> clr.Path > ['C:\\Development\\IronPython\\Tutorial'] > > >>> clr.AddReferenceByPartialName("Mapack") > - Crashed > ---------------------------------------- CUT HERE > ---------------------------- > > Naturally the same happens for PERWAPI.dll (which I'm really interested in > getting to work) and naturally, > Both .DLLs (PERWAPI.DLL & MAPACK.DLL) are in the ' > C:\Development\IronPython\Tutorial'' on my machine... > > Any ideas? > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 etienne.fortin at sympatico.ca Sun Feb 26 05:45:01 2006 From: etienne.fortin at sympatico.ca (Etienne Fortin) Date: Sat, 25 Feb 2006 23:45:01 -0500 Subject: [IronPython] Panda3D Message-ID: <000001c63a8f$67a615f0$6400a8c0@SIRIUS> Is there a way to make Panda3D work with IronPython? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist.account at gmail.com Sun Feb 26 17:03:12 2006 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Sun, 26 Feb 2006 17:03:12 +0100 Subject: [IronPython] WCF Service Contracts implemented using IronPython Message-ID: Hi, I just downloaded the Feb CTP WinFx SDK and I was working my way through the WCF documentation. My goal is to create a WCF service using IronPython. >From the tutorial they show the following C# code as an example of a ServiceContract. namespace Microsoft.ServiceModel.Samples { using System; using System.ServiceModel; [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples")] public interface ICalculator { [OperationContract] double Add(double n1, double n2); [OperationContract] double Subtract(double n1, double n2); [OperationContract] double Multiply(double n1, double n2); [OperationContract] double Divide(double n1, double n2); } } I used csc to compile it into a DLL assembly, successfully used the clr.Add.. methods to access the interface, and Implemented the operations in python. But what I would really like to do next is translate the service contract code from above and use a python class and skip the step of using C# to define my WCF ServiceContracts and the csc compiler. My question to the group is how would I add the ServiceContract and OperationContract declarative attributes to a python class? Thanks, A. From mailinglist.account at gmail.com Sun Feb 26 18:10:53 2006 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Sun, 26 Feb 2006 18:10:53 +0100 Subject: [IronPython] bug: Subclassing str fails Message-ID: Subclassing str in IronPython fails, this behavior is different then CPython. See the following: ------ CPython (success) Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> class MyString(str): ... pass ... >>> s = MyString() >>> s '' >>> ------ IronPython (failure) IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> class MyString(str): ... pass ... >>> s = MyString() Traceback (most recent call last): File , line 0, in input##572 File , line 0, in Make##440 TypeError: MakeNew$$() takes exactly 2 argument (1 given) >>> From stan at ertmssolutions.com Fri Feb 24 16:58:56 2006 From: stan at ertmssolutions.com (Stanislas Pinte) Date: Fri, 24 Feb 2006 16:58:56 +0100 Subject: [IronPython] Bug in engine.LoadAssembly(...) -> PythonImportError In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F50169CF1B@df-foxhound-msg.exchange.corp.microsoft.com> References: <5C0A6F919D675745BB1DBA7412DB68F50169CF1B@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <1140796736.43ff2d408ac04@webmail.raincode.com> Selon Martin Maly : > Your TestOther class is not public so IronPython can't access it, hence the exception. > > Martin Indeed. Thanks for the help! Stan. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of > Stanislas Pinte > Sent: Friday, February 10, 2006 4:10 AM > To: users at lists.ironpython.com > Subject: [IronPython] Bug in engine.LoadAssembly(...) -> PythonImportError > > Hello, > > I have troubles importing classes defined in my own assembly: > > [Release]> ./TestImport.exe > > Unhandled Exception: IronPython.Runtime.PythonImportError: No module named Other > > at IronPython.Runtime.ReflectedMethodBase.Invoke(MethodBinding binding) > . > at TestAccessOtherNamespace.Initialize() in c:TempTestImportTestImportbin > ReleaseTestAccessOtherNamespace.py:line 1 > > I am actually trying to give access to all the namespaces defined in the main assembly, like > that: > > > class Program > { > static void Main(string[] args) > { > PythonEngine engine = new PythonEngine(); > //allow python scrupts to import all classes of my assembly > engine.LoadAssembly(Assembly.GetAssembly(typeof(Program))); > engine.AddToPath(@"."); > engine.Import("TestAccessOtherNamespace"); > } > } > > Am I missing anything? > > See attached full source code (c# program, and python script). > > Thanks a lot, > > Stan. > > > > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > -- ----------------------------------------------------------------- Stanislas Pinte e-mail: stan at ertmssolutions.com ERTMS Solutions http://www.ertmssolutions.com Rue de l'Autonomie, 1 Tel: + 322 - 522.06.63 1070 Bruxelles Fax: + 322 - 522.09.30 ----------------------------------------------------------------- From inhahe at gmail.com Sun Feb 26 20:33:58 2006 From: inhahe at gmail.com (inhahe) Date: Sun, 26 Feb 2006 14:33:58 -0500 Subject: [IronPython] the application failed to initialize properly Message-ID: I unzipped ironpython 0.6, put the bin directory in my path, and ran IronPythonConsole.exe, and got this: The application failed to initialize properly (0xc0000135). Click on OK to terminate the application. While I'm here, I'll ask the question which was the reason I was trying to run IronPython anyway-- does it support List Comprehension? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglist.account at gmail.com Sun Feb 26 21:23:08 2006 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Sun, 26 Feb 2006 21:23:08 +0100 Subject: [IronPython] the application failed to initialize properly In-Reply-To: References: Message-ID: The 0.6 version is very old, you should use the latest version 1.0 beta 3. Here is the download link http://www.microsoft.com/downloads/details.aspx?FamilyId=F22E51E5-B82E-4A54-9CCC-3418E0BF5639&displaylang=en On 2/26/06, inhahe wrote: > I unzipped ironpython 0.6, put the bin directory in my path, and ran > IronPythonConsole.exe, and got this: > > The application failed to initialize properly (0xc0000135). Click on OK to > terminate the application. > > While I'm here, I'll ask the question which was the reason I was trying to > run IronPython anyway-- does it support List Comprehension? > > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From sanxiyn at gmail.com Mon Feb 27 01:17:42 2006 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 27 Feb 2006 09:17:42 +0900 Subject: [IronPython] the application failed to initialize properly In-Reply-To: References: Message-ID: <5b0248170602261617m5cbfe4f5o@mail.gmail.com> 2006/2/27, inhahe : > While I'm here, I'll ask the question which was the reason I was trying to > run IronPython anyway-- does it support List Comprehension? Yes. Seo Sanghyeon From ironpython at bobs.org Mon Feb 27 02:21:38 2006 From: ironpython at bobs.org (Bob Arnson) Date: Sun, 26 Feb 2006 17:21:38 -0800 Subject: [IronPython] the application failed to initialize properly In-Reply-To: References: Message-ID: <44025422.3000200@bobs.org> inhahe wrote: > The application failed to initialize properly (0xc0000135). Click on > OK to terminate the application. That usually means you don't have .NET Framework 2.0 installed. You can get it from http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en . -- sig://boB http://bobs.org From dinov at exchange.microsoft.com Mon Feb 27 17:56:59 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 27 Feb 2006 08:56:59 -0800 Subject: [IronPython] Panda3D In-Reply-To: <000001c63a8f$67a615f0$6400a8c0@SIRIUS> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01B474E7@df-foxhound-msg.exchange.corp.microsoft.com> Because it's written in C++ they'd need to provide bindings for IronPython in addition to CPython. We don't support the CPython plug-in interface so we wouldn't just work w/ it. That means that basically there's no way it'll work right now. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Etienne Fortin Sent: Saturday, February 25, 2006 8:45 PM To: users at lists.ironpython.com Subject: [IronPython] Panda3D Is there a way to make Panda3D work with IronPython? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Mon Feb 27 17:58:55 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 27 Feb 2006 08:58:55 -0800 Subject: [IronPython] bug: Subclassing str fails In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E01B474E9@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the bug report - I've filed this one and we should be able to get it fixed for beta 4. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano Sent: Sunday, February 26, 2006 9:11 AM To: Discussion of IronPython Subject: [IronPython] bug: Subclassing str fails Subclassing str in IronPython fails, this behavior is different then CPython. See the following: ------ CPython (success) Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> class MyString(str): ... pass ... >>> s = MyString() >>> s '' >>> ------ IronPython (failure) IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> class MyString(str): ... pass ... >>> s = MyString() Traceback (most recent call last): File , line 0, in input##572 File , line 0, in Make##440 TypeError: MakeNew$$() takes exactly 2 argument (1 given) >>> _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Mon Feb 27 17:58:55 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 27 Feb 2006 08:58:55 -0800 Subject: [IronPython] bug: Subclassing str fails In-Reply-To: Message-ID: <4039D552ADAB094BB1EA670F3E96214E01B474E9@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the bug report - I've filed this one and we should be able to get it fixed for beta 4. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano Sent: Sunday, February 26, 2006 9:11 AM To: Discussion of IronPython Subject: [IronPython] bug: Subclassing str fails Subclassing str in IronPython fails, this behavior is different then CPython. See the following: ------ CPython (success) Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> class MyString(str): ... pass ... >>> s = MyString() >>> s '' >>> ------ IronPython (failure) IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> class MyString(str): ... pass ... >>> s = MyString() Traceback (most recent call last): File , line 0, in input##572 File , line 0, in Make##440 TypeError: MakeNew$$() takes exactly 2 argument (1 given) >>> _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Mon Feb 27 22:01:57 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 27 Feb 2006 13:01:57 -0800 Subject: [IronPython] WCF Service Contracts implemented using IronPython In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501A1129C@df-foxhound-msg.exchange.corp.microsoft.com> Right now, you can't do that in IronPython. We don't support adding attributes yet. As for the February CTP. Were you able to register your server object without a problem and talk to it from Python client (after generating the proxy)? With the February CTP I hit the problem that if I have singleton server, another custom attribute is required on it. It is not true for January CTP. How did you get that working on Feb CTP? I am really curious :) Thanks! Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano Sent: Sunday, February 26, 2006 8:03 AM To: Discussion of IronPython Subject: [IronPython] WCF Service Contracts implemented using IronPython Hi, I just downloaded the Feb CTP WinFx SDK and I was working my way through the WCF documentation. My goal is to create a WCF service using IronPython. >From the tutorial they show the following C# code as an example of a ServiceContract. namespace Microsoft.ServiceModel.Samples { using System; using System.ServiceModel; [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples")] public interface ICalculator { [OperationContract] double Add(double n1, double n2); [OperationContract] double Subtract(double n1, double n2); [OperationContract] double Multiply(double n1, double n2); [OperationContract] double Divide(double n1, double n2); } } I used csc to compile it into a DLL assembly, successfully used the clr.Add.. methods to access the interface, and Implemented the operations in python. But what I would really like to do next is translate the service contract code from above and use a python class and skip the step of using C# to define my WCF ServiceContracts and the csc compiler. My question to the group is how would I add the ServiceContract and OperationContract declarative attributes to a python class? Thanks, A. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Martin.Maly at microsoft.com Mon Feb 27 22:01:57 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 27 Feb 2006 13:01:57 -0800 Subject: [IronPython] WCF Service Contracts implemented using IronPython In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501A1129C@df-foxhound-msg.exchange.corp.microsoft.com> Right now, you can't do that in IronPython. We don't support adding attributes yet. As for the February CTP. Were you able to register your server object without a problem and talk to it from Python client (after generating the proxy)? With the February CTP I hit the problem that if I have singleton server, another custom attribute is required on it. It is not true for January CTP. How did you get that working on Feb CTP? I am really curious :) Thanks! Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano Sent: Sunday, February 26, 2006 8:03 AM To: Discussion of IronPython Subject: [IronPython] WCF Service Contracts implemented using IronPython Hi, I just downloaded the Feb CTP WinFx SDK and I was working my way through the WCF documentation. My goal is to create a WCF service using IronPython. >From the tutorial they show the following C# code as an example of a ServiceContract. namespace Microsoft.ServiceModel.Samples { using System; using System.ServiceModel; [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples")] public interface ICalculator { [OperationContract] double Add(double n1, double n2); [OperationContract] double Subtract(double n1, double n2); [OperationContract] double Multiply(double n1, double n2); [OperationContract] double Divide(double n1, double n2); } } I used csc to compile it into a DLL assembly, successfully used the clr.Add.. methods to access the interface, and Implemented the operations in python. But what I would really like to do next is translate the service contract code from above and use a python class and skip the step of using C# to define my WCF ServiceContracts and the csc compiler. My question to the group is how would I add the ServiceContract and OperationContract declarative attributes to a python class? Thanks, A. _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From mailinglist.account at gmail.com Mon Feb 27 22:38:35 2006 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Mon, 27 Feb 2006 22:38:35 +0100 Subject: [IronPython] WCF Service Contracts implemented using IronPython In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F501A1129C@df-foxhound-msg.exchange.corp.microsoft.com> References: <5C0A6F919D675745BB1DBA7412DB68F501A1129C@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: Martin, I haven't registered the server object with the IIS hosting container. I will keep you posted ;o) A. On 2/27/06, Martin Maly wrote: > Right now, you can't do that in IronPython. We don't support adding attributes yet. > > As for the February CTP. Were you able to register your server object without a problem and talk to it from Python client (after generating the proxy)? With the February CTP I hit the problem that if I have singleton server, another custom attribute is required on it. It is not true for January CTP. How did you get that working on Feb CTP? I am really curious :) > > Thanks! > Martin > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano > Sent: Sunday, February 26, 2006 8:03 AM > To: Discussion of IronPython > Subject: [IronPython] WCF Service Contracts implemented using IronPython > > Hi, > > I just downloaded the Feb CTP WinFx SDK and I was working my way > through the WCF documentation. My goal is to create a WCF service > using IronPython. > > >From the tutorial they show the following C# code as an example of a > ServiceContract. > > namespace Microsoft.ServiceModel.Samples > { > using System; > using System.ServiceModel; > [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples")] > public interface ICalculator > { > [OperationContract] > double Add(double n1, double n2); > [OperationContract] > double Subtract(double n1, double n2); > [OperationContract] > double Multiply(double n1, double n2); > [OperationContract] > double Divide(double n1, double n2); > } > } > > I used csc to compile it into a DLL assembly, successfully used the > clr.Add.. methods to access the interface, and Implemented the > operations in python. > > But what I would really like to do next is translate the service > contract code from above and use a python class and skip the step of > using C# to define my WCF ServiceContracts and the csc compiler. > > My question to the group is how would I add the ServiceContract and > OperationContract declarative attributes to a python class? > > Thanks, > > A. > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 mailinglist.account at gmail.com Mon Feb 27 22:38:35 2006 From: mailinglist.account at gmail.com (Anthony Tarlano) Date: Mon, 27 Feb 2006 22:38:35 +0100 Subject: [IronPython] WCF Service Contracts implemented using IronPython In-Reply-To: <5C0A6F919D675745BB1DBA7412DB68F501A1129C@df-foxhound-msg.exchange.corp.microsoft.com> References: <5C0A6F919D675745BB1DBA7412DB68F501A1129C@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: Martin, I haven't registered the server object with the IIS hosting container. I will keep you posted ;o) A. On 2/27/06, Martin Maly wrote: > Right now, you can't do that in IronPython. We don't support adding attributes yet. > > As for the February CTP. Were you able to register your server object without a problem and talk to it from Python client (after generating the proxy)? With the February CTP I hit the problem that if I have singleton server, another custom attribute is required on it. It is not true for January CTP. How did you get that working on Feb CTP? I am really curious :) > > Thanks! > Martin > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano > Sent: Sunday, February 26, 2006 8:03 AM > To: Discussion of IronPython > Subject: [IronPython] WCF Service Contracts implemented using IronPython > > Hi, > > I just downloaded the Feb CTP WinFx SDK and I was working my way > through the WCF documentation. My goal is to create a WCF service > using IronPython. > > >From the tutorial they show the following C# code as an example of a > ServiceContract. > > namespace Microsoft.ServiceModel.Samples > { > using System; > using System.ServiceModel; > [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples")] > public interface ICalculator > { > [OperationContract] > double Add(double n1, double n2); > [OperationContract] > double Subtract(double n1, double n2); > [OperationContract] > double Multiply(double n1, double n2); > [OperationContract] > double Divide(double n1, double n2); > } > } > > I used csc to compile it into a DLL assembly, successfully used the > clr.Add.. methods to access the interface, and Implemented the > operations in python. > > But what I would really like to do next is translate the service > contract code from above and use a python class and skip the step of > using C# to define my WCF ServiceContracts and the csc compiler. > > My question to the group is how would I add the ServiceContract and > OperationContract declarative attributes to a python class? > > Thanks, > > A. > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 Martin.Maly at microsoft.com Mon Feb 27 22:56:43 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 27 Feb 2006 13:56:43 -0800 Subject: [IronPython] WCF Service Contracts implemented using IronPython In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501A11360@df-foxhound-msg.exchange.corp.microsoft.com> I didn't do the IIS part either, I only registered the object directly with WCF server and had it listen on an http port, listening for soap messages and that works great with Jan CTP, but not Feb. M. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano Sent: Monday, February 27, 2006 1:39 PM To: Discussion of IronPython Cc: Discussion of IronPython Subject: Re: [IronPython] WCF Service Contracts implemented using IronPython Martin, I haven't registered the server object with the IIS hosting container. I will keep you posted ;o) A. On 2/27/06, Martin Maly wrote: > Right now, you can't do that in IronPython. We don't support adding attributes yet. > > As for the February CTP. Were you able to register your server object without a problem and talk to it from Python client (after generating the proxy)? With the February CTP I hit the problem that if I have singleton server, another custom attribute is required on it. It is not true for January CTP. How did you get that working on Feb CTP? I am really curious :) > > Thanks! > Martin > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano > Sent: Sunday, February 26, 2006 8:03 AM > To: Discussion of IronPython > Subject: [IronPython] WCF Service Contracts implemented using IronPython > > Hi, > > I just downloaded the Feb CTP WinFx SDK and I was working my way > through the WCF documentation. My goal is to create a WCF service > using IronPython. > > >From the tutorial they show the following C# code as an example of a > ServiceContract. > > namespace Microsoft.ServiceModel.Samples > { > using System; > using System.ServiceModel; > [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples")] > public interface ICalculator > { > [OperationContract] > double Add(double n1, double n2); > [OperationContract] > double Subtract(double n1, double n2); > [OperationContract] > double Multiply(double n1, double n2); > [OperationContract] > double Divide(double n1, double n2); > } > } > > I used csc to compile it into a DLL assembly, successfully used the > clr.Add.. methods to access the interface, and Implemented the > operations in python. > > But what I would really like to do next is translate the service > contract code from above and use a python class and skip the step of > using C# to define my WCF ServiceContracts and the csc compiler. > > My question to the group is how would I add the ServiceContract and > OperationContract declarative attributes to a python class? > > Thanks, > > A. > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 Martin.Maly at microsoft.com Mon Feb 27 22:56:43 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Mon, 27 Feb 2006 13:56:43 -0800 Subject: [IronPython] WCF Service Contracts implemented using IronPython In-Reply-To: Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501A11360@df-foxhound-msg.exchange.corp.microsoft.com> I didn't do the IIS part either, I only registered the object directly with WCF server and had it listen on an http port, listening for soap messages and that works great with Jan CTP, but not Feb. M. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano Sent: Monday, February 27, 2006 1:39 PM To: Discussion of IronPython Cc: Discussion of IronPython Subject: Re: [IronPython] WCF Service Contracts implemented using IronPython Martin, I haven't registered the server object with the IIS hosting container. I will keep you posted ;o) A. On 2/27/06, Martin Maly wrote: > Right now, you can't do that in IronPython. We don't support adding attributes yet. > > As for the February CTP. Were you able to register your server object without a problem and talk to it from Python client (after generating the proxy)? With the February CTP I hit the problem that if I have singleton server, another custom attribute is required on it. It is not true for January CTP. How did you get that working on Feb CTP? I am really curious :) > > Thanks! > Martin > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Anthony Tarlano > Sent: Sunday, February 26, 2006 8:03 AM > To: Discussion of IronPython > Subject: [IronPython] WCF Service Contracts implemented using IronPython > > Hi, > > I just downloaded the Feb CTP WinFx SDK and I was working my way > through the WCF documentation. My goal is to create a WCF service > using IronPython. > > >From the tutorial they show the following C# code as an example of a > ServiceContract. > > namespace Microsoft.ServiceModel.Samples > { > using System; > using System.ServiceModel; > [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples")] > public interface ICalculator > { > [OperationContract] > double Add(double n1, double n2); > [OperationContract] > double Subtract(double n1, double n2); > [OperationContract] > double Multiply(double n1, double n2); > [OperationContract] > double Divide(double n1, double n2); > } > } > > I used csc to compile it into a DLL assembly, successfully used the > clr.Add.. methods to access the interface, and Implemented the > operations in python. > > But what I would really like to do next is translate the service > contract code from above and use a python class and skip the step of > using C# to define my WCF ServiceContracts and the csc compiler. > > My question to the group is how would I add the ServiceContract and > OperationContract declarative attributes to a python class? > > Thanks, > > A. > _______________________________________________ > users mailing list > users at lists.ironpython.com > http://lists.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 paul.clinch at cybview.com Tue Feb 28 11:20:20 2006 From: paul.clinch at cybview.com (Paul Clinch) Date: Tue, 28 Feb 2006 10:20:20 -0000 Subject: [IronPython] Remoting Message-ID: <000001c63c50$94a83660$aa02a8c0@cyberview.local> Is it possible to use a remote object in ironpython? I have 1.0 beta1 and get the following:- >>> import RemoteDiagnostic >>> dir( RemoteDiagnostic ) ['IRemoteDiagnostic', '__builtins__', '__dict__', '__name__'] >>> rd = System.Activator.GetObject( System.Type.GetType(RemoteDiagnostic.IRemoteDiagnostic), "tcp://192.168.2.155:8490/ShellDiagnostic" ) Traceback (most recent call last): File , line 0, in input##64 File , line 0, in GetObject File , line 0, in GetObject Exception: Trying to create a proxy to an unbound type. I am able to use the following C# code:- using RemoteDiagnostic; ... IRemoteDiagnostic m_Diagnostic; m_Diagnostic = (IRemoteDiagnostic)Activator.GetObject( typeof(IRemoteDiagnostic), "tcp://192.168.2.155:8490/ShellDiagnostic"); Regards, Paul. From giles.thomas at resolversystems.com Tue Feb 28 14:19:31 2006 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Tue, 28 Feb 2006 13:19:31 +0000 Subject: [IronPython] Possible bug with exec(code, dict) when using lambdas Message-ID: <44044DE3.4000302@resolversystems.com> Hi all, It looks like there may still be outstanding problems with exec(code, dict) in beta 3; while the context in the dictionary is available to normal code, anything deferred into a function can't see it. An example might clarify: IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> context = {} >>> exec("a = 1", context) >>> exec("print a", context) 1 >>> exec("b = lambda x : x + a", context) >>> exec("c = b(5)", context) Traceback (most recent call last): File , line 0, in input##105 File , line 0, in ##106 File , line 0, in lambda You get the same problem if you use a regular function rather than a lambda: >>> context = {} >>> exec("a = 1", context) >>> exec("def b(x): return x + a", context) >>> exec("c = b(5)", context) Traceback (most recent call last): File , line 0, in input##80 File , line 0, in ##81 File , line 0, in b NameError: name 'a' not defined >>> The same code executes as expected in CPython. Hope this is of some help to someone! Cheers, Giles -- Giles Thomas Resolver Systems giles.thomas at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ From Martin.Maly at microsoft.com Tue Feb 28 16:36:14 2006 From: Martin.Maly at microsoft.com (Martin Maly) Date: Tue, 28 Feb 2006 07:36:14 -0800 Subject: [IronPython] Possible bug with exec(code, dict) when using lambdas In-Reply-To: <44044DE3.4000302@resolversystems.com> Message-ID: <5C0A6F919D675745BB1DBA7412DB68F501AD7D0E@df-foxhound-msg.exchange.corp.microsoft.com> Thanks for the repro, we'll look into it! Martin -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Giles Thomas Sent: Tuesday, February 28, 2006 5:20 AM To: Discussion of IronPython Subject: [IronPython] Possible bug with exec(code, dict) when using lambdas Hi all, It looks like there may still be outstanding problems with exec(code, dict) in beta 3; while the context in the dictionary is available to normal code, anything deferred into a function can't see it. An example might clarify: IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. All rights reserved. >>> context = {} >>> exec("a = 1", context) >>> exec("print a", context) 1 >>> exec("b = lambda x : x + a", context) >>> exec("c = b(5)", context) Traceback (most recent call last): File , line 0, in input##105 File , line 0, in ##106 File , line 0, in lambda You get the same problem if you use a regular function rather than a lambda: >>> context = {} >>> exec("a = 1", context) >>> exec("def b(x): return x + a", context) >>> exec("c = b(5)", context) Traceback (most recent call last): File , line 0, in input##80 File , line 0, in ##81 File , line 0, in b NameError: name 'a' not defined >>> The same code executes as expected in CPython. Hope this is of some help to someone! Cheers, Giles -- Giles Thomas Resolver Systems giles.thomas at resolversystems.com We're hiring! http://www.resolversystems.com/jobs/ _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From metch at daimi.au.dk Tue Feb 28 18:03:38 2006 From: metch at daimi.au.dk (Peter Mechlenborg) Date: Tue, 28 Feb 2006 18:03:38 +0100 Subject: [IronPython] CLS compliance Message-ID: <4404826A.9090105@daimi.au.dk> Hi I'm trying to find out how well CLR enables language interoperability for dynamic languages, and in that connection I have been looking a bit on IronPython (IP). Using Google and searching the archives of this mailing list, I get the impression that IP is capable of both consuming and producing CLS compliant code, is this correct? If so, I would be very interested in information describing how to do this as a programmer and also how it has been implemented. Does any such information exist? If any of you know of any sources that discuss language interoperability for other dynamic languages, I would also be interested in these. Kind regards, -- Peter From dinov at exchange.microsoft.com Tue Feb 28 18:09:08 2006 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 28 Feb 2006 09:09:08 -0800 Subject: [IronPython] CLS compliance In-Reply-To: <4404826A.9090105@daimi.au.dk> Message-ID: <4039D552ADAB094BB1EA670F3E96214E01BEA599@df-foxhound-msg.exchange.corp.microsoft.com> IronPython can consume CLS types and extend them, but cannot produce new CLS types. Unfortunately that last part is extremely tricky because CLR types are not dynamic, but Python types are. It is something that's on our radar but we don't yet have a solution for it. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Peter Mechlenborg Sent: Tuesday, February 28, 2006 9:04 AM To: users at lists.ironpython.com Subject: [IronPython] CLS compliance Hi I'm trying to find out how well CLR enables language interoperability for dynamic languages, and in that connection I have been looking a bit on IronPython (IP). Using Google and searching the archives of this mailing list, I get the impression that IP is capable of both consuming and producing CLS compliant code, is this correct? If so, I would be very interested in information describing how to do this as a programmer and also how it has been implemented. Does any such information exist? If any of you know of any sources that discuss language interoperability for other dynamic languages, I would also be interested in these. Kind regards, -- Peter _______________________________________________ users mailing list users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From metch at daimi.au.dk Tue Feb 28 22:00:28 2006 From: metch at daimi.au.dk (Peter Mechlenborg) Date: Tue, 28 Feb 2006 22:00:28 +0100 Subject: [IronPython] CLS compliance In-Reply-To: <4039D552ADAB094BB1EA670F3E96214E01BEA599@df-foxhound-msg.exchange.corp.microsoft.com> References: <4039D552ADAB094BB1EA670F3E96214E01BEA599@df-foxhound-msg.exchange.corp.microsoft.com> Message-ID: <4404B9EC.5020906@daimi.au.dk> Dino Viehland wrote: > IronPython can consume CLS types and extend them, but cannot produce > new CLS types. Unfortunately that last part is extremely tricky > because CLR types are not dynamic, but Python types are. It is > something that's on our radar but we don't yet have a solution for it. Thanks for the quick answer. Up front I must say that my knowledge about Python and CLR is limited, so I hope that the following is not completely wrong. My understanding is that the general way of targeting a dynamic language towards a static VM/language is to escape through the common root type, i.e., Object, and then use runtime casts to perform runtime type checks. The following code fragment should illustrate this through the use of a Point class, using Java-like syntax: class Point { Object x,y; void move(Object xx, Object yy) { x = (int)x + (int)xx; y = (int)y + (int)yy; } } The fields and arguments are qualified by Object, but cast to integer before the addition in the move method. I'm assuming that integers are objects and not primitive types, I'm not sure how it would look if integers were primitive. If the above code was generated from a untyped language, and we wanted to expose the move method and the Point class through the CLS, we need some extra type information. I'm not sure how to do this, but ideas could be optional type declarations, some kind of IDL, or type inference, and in my eyes this is the biggest problem when trying to produce CLS compliant code from a dynamic language. If we have the extra type information we can create wrapper methods with more specific type declarations: class Point { Object x,y; void cls_move(int xx, int yy) { this.move((Object) xx, (Object) yy); } void move (Object xx, Object yy) { ... } } Here cls_move should be used by foreign languages, while move should be use natively; in general giving objects two separate interfaces, one for foreign code, and one for native code (I'm regarding the fields as private). What I sketched above is properly too simplistic, but would the general idea work of wrapper methods work for code produced by IronPython? (Maybe the hardest problem is all the little details). I'm quite interested in how you have implemented consumption of CLS types, because I don't see an obvious way of doing this. If we reverse the Point example: class Point { int x,y; void move(int xx, int yy) { x = x + xx; y = y + yy; } } Point is now written in a static language, and we would like to use it from IronPython. In this case all arguments passed from the callee to the move method must be qualified as int, but in IronPython the type of the arguments are not known. One solution is to create wrapper objects around all foreign objects, and that way provide a single location that can translate dynamic calls into static calls. This however adds extra overhead, and also complicates inheritance because the wrapper would have to use delegation, which does not preserve the self/this reference, which again conflicts with overriding of methods. I think delegation would be needed because CLS only supports single inheritance for classes. It might also be possible to use reflection, and make all calls to foreign objects in a reflective way. Am I missing something obvious? What is your general strategy for consumption of CLS types in IronPython? > > Do you want to help develop Dynamic languages on CLR? > (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) It does seem like a very interesting job. Its nice to see some focus on dynamic languages. Have fun, -- Peter