From regmi.amit at gmail.com Sun Dec 2 01:15:05 2007 From: regmi.amit at gmail.com (amit) Date: Sat, 01 Dec 2007 19:15:05 -0500 Subject: [IronPython] mapping C# iterators to Python iterator Message-ID: <4751F909.2070801@gmail.com> Hi, I want to know how the "Iterators" in C# can be mapped to those in Python. What I tried was: say for ArrayList object def __iter__(self): self.index = self.Count return self def next(self): if self.index == 0: raise StopIteration self.index = self.index - 1 return ?? If I am creating python classes dynamically how would I map GetEnumerator() , MoveNext() , Current() , Reset() to python Class so as to make it iterable inside python. --Regmee From dave.niesman at ieee.org Mon Dec 3 05:15:38 2007 From: dave.niesman at ieee.org (Dave Niesman) Date: Sun, 2 Dec 2007 22:15:38 -0600 Subject: [IronPython] ipy.exe crashes after attempting import in VS 2008 command window In-Reply-To: <7AD436E4270DD54A94238001769C2227E4539A4C19@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227E4539A4C19@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Hi, Back to this after a bit of break: It is very strange, when I run from the command line, I do get the crash. The exception that I get is Problem signature: Problem Event Name: BEX Application Name: ipy.exe Application Version: 2.0.11102.0 Application Timestamp: 472b9636 Fault Module Name: ipy.exe Fault Module Version: 2.0.11102.0 Fault Module Timestamp: 472b9636 Exception Offset: 00002a2e Exception Code: c0000005 Exception Data: 00000008 OS Version: 6.0.6000.2.0.0.256.6 Locale ID: 1033 Additional Information 1: fd34 Additional Information 2: e3e44ca885a9c18b4c3311284cf007b1 Additional Information 3: de26 Additional Information 4: f3db6b6acd06f709d6e82bf62cb9ad3f Read our privacy statement: http://go.microsoft.com/fwlink/?linkid=50163&clcid=0x0409 I can launch vs2008 and debug it, but I don't get much of a stack. > ipy.exe!00c82a2e() [Frames below may be incorrect and/or missing, no symbols loaded for ipy.exe] kernel32.dll!76963833() ntdll.dll!77a1a9bd() Interestingly, I don't get the crash in cordbg ipy. I.E, c:\IronPython\IronPython-2.0A6>"c:\Program Files\Microsoft SDKs\Windows\v6.0A\bi n\cordbg.exe" ipy Microsoft (R) Common Language Runtime Test Debugger Shell Version 3.5.21022.8 (R TM.021022-0800) Copyright (C) Microsoft Corporation. All rights reserved. (cordbg) run ipy Process 4024/0xfb8 created. Warning: couldn't load symbols for C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__ b77a5c561934e089\mscorlib.dll [thread 0x1234] Thread created. Warning: couldn't load symbols for c:\IronPython\IronPython-2.0A6\ipy.exe Warning: couldn't load symbols for c:\IronPython\IronPython-2.0A6\Microsoft.Scri pting.dll Warning: couldn't load symbols for c:\IronPython\IronPython-2.0A6\IronPython.dll Warning: couldn't load symbols for C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__ b77a5c561934e089\System.dll Warning: couldn't load symbols for c:\IronPython\IronPython-2.0A6\IronPython.Mod ules.dll Warning: couldn't load symbols for snippets1 Warning: couldn't load symbols for snippets1 Warning: couldn't load symbols for Anonymously Hosted DynamicMethods Assembly Warning: couldn't load symbols for site Warning: couldn't load symbols for site Warning: couldn't load symbols for C:\Windows\assembly\GAC_32\ISymWrapper\2.0.0. 0__b03f5f7f11d50a3a\ISymWrapper.dll IronPython console: IronPython 2.0A6 (2.0.11102.00) on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> Any suggestions? Thanks, Dave On Nov 30, 2007 11:41 AM, Dino Viehland wrote: > This seems to work fine for me (same config apparently unless you're on 64-bit Vista - Vista, VS2008 RTM, .NET 3.5). Do you get an exception outputted or do you just get the Watson UI saying an application has crashed? > > One option might be to run under cordbg to see what the problem is, e.g.: cordbg .\ipy.exe -c "import os" > > If you can let us know what exception it seems to be crashing on then it'll help us repro it or fix it :). > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dave Niesman > Sent: Friday, November 30, 2007 7:23 AM > To: Iron Python Mailing List > Subject: [IronPython] ipy.exe crashes after attempting import in VS 2008 command window > > Hi, > > Can anyone else confirm this behavior? > > I can run ipy.exe fine from a command line. However, if I start a > Visual Studio 2008 command window, (this is just %comspec% /k > ""C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" > x86), and then "import os" ipy.exe crashes. Furthermore, all future > invocations of ipy.exe crash until the machine is rebooted! This is > repeatable on my machine. > > > Environment: .net35, Vista, VS2008 ipy 2.0a6. > > Thanks, > > Dave > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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 David.Lawler at franke.com Mon Dec 3 14:55:02 2007 From: David.Lawler at franke.com (David.Lawler at franke.com) Date: Mon, 3 Dec 2007 08:55:02 -0500 Subject: [IronPython] ipy.exe crashes after attempting import in VS 2008 command window In-Reply-To: Message-ID: Hi, just a user here - but I tried this to see if I could reproduce it and could not- sorry. My environment: Python 2.4.4 and Python 2.5.1, Windows XP SP2, Visual Studio Beta 2, the released version of .net 3.5 and IP 2A6. In the VS command line with either version of python I do not get a crash. To be clear I am going to the VS Beta2 Command Prompt, cd'ing to the IronPython 2A6 directory and launching ipy.exe. Then I import sys, sys.path.append either c:\python24\lib or c:\python25\lib and import os. Is that what you do when it crashes? What version(s) of python are you trying this with? Could it be that the length of the path after going to the VS command line might be causing issues somewhere? You might want to tell them what the results of entering 'path' at the VS command prompt are. Regards, David From dinov at exchange.microsoft.com Mon Dec 3 18:58:43 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 3 Dec 2007 09:58:43 -0800 Subject: [IronPython] mapping C# iterators to Python iterator In-Reply-To: <4751F909.2070801@gmail.com> References: <4751F909.2070801@gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227E4539A4E27@DF-GRTDANE-MSG.exchange.corp.microsoft.com> To map these to .NET's IEnumerator/IEnumerable you just need to define __iter__ or __getitem__. If you define __iter__ you should return something that is enumerable (implements IEnumerable or has a next method which we'll call until it throws to stop enumeration). If you define __getitem__ we'll try and index from 0 to infinity and stop at an index out of range or stop iteration exception. You explicitly mention "say for ArrayList object" and I'm not sure what that means - we won't convert an arbitrary enumerable into another type such as ArrayList. But we will convert it one of the enumeration interfaces. When we pass your object out it'll be wrapped in one of our PythonEnumerable/PythonEnumerator/ItemEnumerable/ItemEnumerator classes. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of amit Sent: Saturday, December 01, 2007 4:15 PM To: users at lists.ironpython.com Subject: [IronPython] mapping C# iterators to Python iterator Hi, I want to know how the "Iterators" in C# can be mapped to those in Python. What I tried was: say for ArrayList object def __iter__(self): self.index = self.Count return self def next(self): if self.index == 0: raise StopIteration self.index = self.index - 1 return ?? If I am creating python classes dynamically how would I map GetEnumerator() , MoveNext() , Current() , Reset() to python Class so as to make it iterable inside python. --Regmee _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Mon Dec 3 18:59:07 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 3 Dec 2007 09:59:07 -0800 Subject: [IronPython] ipy.exe crashes after attempting import in VS 2008 command window In-Reply-To: References: <7AD436E4270DD54A94238001769C2227E4539A4C19@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227E4539A4E29@DF-GRTDANE-MSG.exchange.corp.microsoft.com> You should be able to get a better stack trace by putting the MS public symbol server in your symbol path. In VS that's Tools->Options->Debugging->Symbols and then add: SRV*DownstreamStore*http://msdl.microsoft.com/download/symbols Where DownstreamStore is some directory like C:\Symbols. You might have better luck with windbg or cdb (http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx) though. If you start ipy.exe under windbg and then type in its command line: sxe clr sxe eh g (1st one enables CLR exceptions, 2nd one enables SEH exceptions, 3rd one runs). You'll break at an exception and then do: .symfix .loadby sos mscorwks !ClrStack kb30 !pe g (1st one will fix the symbol path to the public server, 2nd one loads "Son of Strike" the CLR debugging tool, 3rd one prints the clr stack, 4th one prints the native stack, 5th one prints the CLR exception (if it can), and the 5th one again continues execution) and do that for each exception until it exits. That'd give us the exceptions as they were happening instead of after they happen w/ Watson. Hopefully it'll repro under windbg... If that doesn't work then hopefully just getting symbols from the attach after Watson displays it's UI will be more helpful. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dave Niesman Sent: Sunday, December 02, 2007 8:16 PM To: Discussion of IronPython Subject: Re: [IronPython] ipy.exe crashes after attempting import in VS 2008 command window Hi, Back to this after a bit of break: It is very strange, when I run from the command line, I do get the crash. The exception that I get is Problem signature: Problem Event Name: BEX Application Name: ipy.exe Application Version: 2.0.11102.0 Application Timestamp: 472b9636 Fault Module Name: ipy.exe Fault Module Version: 2.0.11102.0 Fault Module Timestamp: 472b9636 Exception Offset: 00002a2e Exception Code: c0000005 Exception Data: 00000008 OS Version: 6.0.6000.2.0.0.256.6 Locale ID: 1033 Additional Information 1: fd34 Additional Information 2: e3e44ca885a9c18b4c3311284cf007b1 Additional Information 3: de26 Additional Information 4: f3db6b6acd06f709d6e82bf62cb9ad3f Read our privacy statement: http://go.microsoft.com/fwlink/?linkid=50163&clcid=0x0409 I can launch vs2008 and debug it, but I don't get much of a stack. > ipy.exe!00c82a2e() [Frames below may be incorrect and/or missing, no symbols loaded for ipy.exe] kernel32.dll!76963833() ntdll.dll!77a1a9bd() Interestingly, I don't get the crash in cordbg ipy. I.E, c:\IronPython\IronPython-2.0A6>"c:\Program Files\Microsoft SDKs\Windows\v6.0A\bi n\cordbg.exe" ipy Microsoft (R) Common Language Runtime Test Debugger Shell Version 3.5.21022.8 (R TM.021022-0800) Copyright (C) Microsoft Corporation. All rights reserved. (cordbg) run ipy Process 4024/0xfb8 created. Warning: couldn't load symbols for C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__ b77a5c561934e089\mscorlib.dll [thread 0x1234] Thread created. Warning: couldn't load symbols for c:\IronPython\IronPython-2.0A6\ipy.exe Warning: couldn't load symbols for c:\IronPython\IronPython-2.0A6\Microsoft.Scri pting.dll Warning: couldn't load symbols for c:\IronPython\IronPython-2.0A6\IronPython.dll Warning: couldn't load symbols for C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__ b77a5c561934e089\System.dll Warning: couldn't load symbols for c:\IronPython\IronPython-2.0A6\IronPython.Mod ules.dll Warning: couldn't load symbols for snippets1 Warning: couldn't load symbols for snippets1 Warning: couldn't load symbols for Anonymously Hosted DynamicMethods Assembly Warning: couldn't load symbols for site Warning: couldn't load symbols for site Warning: couldn't load symbols for C:\Windows\assembly\GAC_32\ISymWrapper\2.0.0. 0__b03f5f7f11d50a3a\ISymWrapper.dll IronPython console: IronPython 2.0A6 (2.0.11102.00) on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> Any suggestions? Thanks, Dave On Nov 30, 2007 11:41 AM, Dino Viehland wrote: > This seems to work fine for me (same config apparently unless you're on 64-bit Vista - Vista, VS2008 RTM, .NET 3.5). Do you get an exception outputted or do you just get the Watson UI saying an application has crashed? > > One option might be to run under cordbg to see what the problem is, e.g.: cordbg .\ipy.exe -c "import os" > > If you can let us know what exception it seems to be crashing on then it'll help us repro it or fix it :). > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dave Niesman > Sent: Friday, November 30, 2007 7:23 AM > To: Iron Python Mailing List > Subject: [IronPython] ipy.exe crashes after attempting import in VS 2008 command window > > Hi, > > Can anyone else confirm this behavior? > > I can run ipy.exe fine from a command line. However, if I start a > Visual Studio 2008 command window, (this is just %comspec% /k > ""C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"" > x86), and then "import os" ipy.exe crashes. Furthermore, all future > invocations of ipy.exe crash until the machine is rebooted! This is > repeatable on my machine. > > > Environment: .net35, Vista, VS2008 ipy 2.0a6. > > Thanks, > > Dave > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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 regmi.amit at gmail.com Tue Dec 4 01:02:17 2007 From: regmi.amit at gmail.com (amit) Date: Mon, 03 Dec 2007 19:02:17 -0500 Subject: [IronPython] mapping C# iterators to Python iterator In-Reply-To: <7AD436E4270DD54A94238001769C2227E4539A4E27@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4751F909.2070801@gmail.com> <7AD436E4270DD54A94238001769C2227E4539A4E27@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <47549909.3010709@gmail.com> thanks tonnes Dino. :) I did as you said and got it working for ArrayList class. Now I am struggling with another issue the problem is in the below code wherein I could return ArrayList values with __getitem__ For other classes say 'Stack' though it wont work because it wont have __getitem__ I think I am missing something here. May be some sort of method invocation to GetEnumerator(), MoveNext(), Current() could help. class Dummy(object): def __init__(self, iterObj): self.iterObj = iterObj self.index = 0 def next(self): temp = self.index if self.index == self.iterObj.Count: raise StopIteration self.index = self.index + 1 return self.iterObj.__getitem__(temp) class CliClassWrapper(object): # this is the class wrapper for on-the-fly class generation __slots__ = ('__cliobj__',) def __iter__(self): return Dummy(self) # this is where I pass the object - Regmee Dino Viehland wrote: > To map these to .NET's IEnumerator/IEnumerable you just need to define __iter__ or __getitem__. If you define __iter__ you should return something that is enumerable (implements IEnumerable or has a next method which we'll call until it throws to stop enumeration). If you define __getitem__ we'll try and index from 0 to infinity and stop at an index out of range or stop iteration exception. > > You explicitly mention "say for ArrayList object" and I'm not sure what that means - we won't convert an arbitrary enumerable into another type such as ArrayList. But we will convert it one of the enumeration interfaces. When we pass your object out it'll be wrapped in one of our PythonEnumerable/PythonEnumerator/ItemEnumerable/ItemEnumerator classes. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of amit > Sent: Saturday, December 01, 2007 4:15 PM > To: users at lists.ironpython.com > Subject: [IronPython] mapping C# iterators to Python iterator > > Hi, > > I want to know how the "Iterators" in C# can be mapped to those in Python. > What I tried was: > > say for ArrayList object > > def __iter__(self): > self.index = self.Count > return self > > def next(self): > if self.index == 0: > raise StopIteration > self.index = self.index - 1 > return ?? > > If I am creating python classes dynamically how would I map > GetEnumerator() , MoveNext() , Current() , Reset() > to python Class so as to make it iterable inside python. > > --Regmee > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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 regmi.amit at gmail.com Tue Dec 4 01:05:43 2007 From: regmi.amit at gmail.com (amit) Date: Mon, 03 Dec 2007 19:05:43 -0500 Subject: [IronPython] mapping C# iterators to Python iterator In-Reply-To: <47549909.3010709@gmail.com> References: <4751F909.2070801@gmail.com> <7AD436E4270DD54A94238001769C2227E4539A4E27@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <47549909.3010709@gmail.com> Message-ID: <475499D7.3060802@gmail.com> sorry for the bad indentation this should be more readable. class Dummy(object): def __init__(self, iterObj): self.iterObj = iterObj self.index = 0 def next(self): temp = self.index if self.index == self.iterObj.Count: raise StopIteration self.index = self.index + 1 return self.iterObj.__getitem__(temp) class CliClassWrapper(object): # this is the class wrapper for on-the-fly class generation __slots__ = ('__cliobj__',) def __iter__(self): return Dummy(self) # this is where I pass the object - Regmee amit wrote: > thanks tonnes Dino. > :) > > I did as you said and got it working for ArrayList class. > Now I am struggling with another issue > the problem is in the below code wherein I could return ArrayList > values with __getitem__ > For other classes say 'Stack' though it wont work because it wont have > __getitem__ > > I think I am missing something here. May be some sort of method > invocation to GetEnumerator(), MoveNext(), Current() could help. > > class Dummy(object): > def __init__(self, iterObj): > self.iterObj = iterObj > self.index = 0 > > def next(self): > temp = self.index > if self.index == self.iterObj.Count: > raise StopIteration > self.index = self.index + 1 > return self.iterObj.__getitem__(temp) > > > class CliClassWrapper(object): # this is the class wrapper for > on-the-fly class generation > __slots__ = ('__cliobj__',) > > def __iter__(self): > return Dummy(self) # this is where I pass > the object > > > - Regmee > > > Dino Viehland wrote: >> To map these to .NET's IEnumerator/IEnumerable you just need to >> define __iter__ or __getitem__. If you define __iter__ you should >> return something that is enumerable (implements IEnumerable or has a >> next method which we'll call until it throws to stop enumeration). >> If you define __getitem__ we'll try and index from 0 to infinity and >> stop at an index out of range or stop iteration exception. >> >> You explicitly mention "say for ArrayList object" and I'm not sure >> what that means - we won't convert an arbitrary enumerable into >> another type such as ArrayList. But we will convert it one of the >> enumeration interfaces. When we pass your object out it'll be >> wrapped in one of our >> PythonEnumerable/PythonEnumerator/ItemEnumerable/ItemEnumerator classes. >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com >> [mailto:users-bounces at lists.ironpython.com] On Behalf Of amit >> Sent: Saturday, December 01, 2007 4:15 PM >> To: users at lists.ironpython.com >> Subject: [IronPython] mapping C# iterators to Python iterator >> >> Hi, >> >> I want to know how the "Iterators" in C# can be mapped to those in >> Python. >> What I tried was: >> >> say for ArrayList object >> >> def __iter__(self): >> self.index = self.Count >> return self >> >> def next(self): >> if self.index == 0: >> raise StopIteration >> self.index = self.index - 1 >> return ?? >> >> If I am creating python classes dynamically how would I map >> GetEnumerator() , MoveNext() , Current() , Reset() >> to python Class so as to make it iterable inside python. >> >> --Regmee >> >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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 Tue Dec 4 01:19:39 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 3 Dec 2007 16:19:39 -0800 Subject: [IronPython] mapping C# iterators to Python iterator In-Reply-To: <47549909.3010709@gmail.com> References: <4751F909.2070801@gmail.com> <7AD436E4270DD54A94238001769C2227E4539A4E27@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <47549909.3010709@gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227E4539A4F88@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I think there's a bug here in that we're not defining __iter__ on Stack (it's enumerable but it doesn't support indexing it's items). There's not a whole lot of objects that are like that :) I've opened a bug to track this issue: http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=14196 My best advice to work around this is to call .GetEnumerator explicitly on the object and then use the resulting enumerator to access the values. Note you still won't get a __getitem__ method to call (and self.iterObj[temp] would be more Pythonic anyway) so you'll need to use a list comprehension or an old-fashioned loop to collect the objects if you want indexing. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of amit Sent: Monday, December 03, 2007 4:02 PM To: Discussion of IronPython Subject: Re: [IronPython] mapping C# iterators to Python iterator thanks tonnes Dino. :) I did as you said and got it working for ArrayList class. Now I am struggling with another issue the problem is in the below code wherein I could return ArrayList values with __getitem__ For other classes say 'Stack' though it wont work because it wont have __getitem__ I think I am missing something here. May be some sort of method invocation to GetEnumerator(), MoveNext(), Current() could help. class Dummy(object): def __init__(self, iterObj): self.iterObj = iterObj self.index = 0 def next(self): temp = self.index if self.index == self.iterObj.Count: raise StopIteration self.index = self.index + 1 return self.iterObj.__getitem__(temp) class CliClassWrapper(object): # this is the class wrapper for on-the-fly class generation __slots__ = ('__cliobj__',) def __iter__(self): return Dummy(self) # this is where I pass the object - Regmee Dino Viehland wrote: > To map these to .NET's IEnumerator/IEnumerable you just need to define __iter__ or __getitem__. If you define __iter__ you should return something that is enumerable (implements IEnumerable or has a next method which we'll call until it throws to stop enumeration). If you define __getitem__ we'll try and index from 0 to infinity and stop at an index out of range or stop iteration exception. > > You explicitly mention "say for ArrayList object" and I'm not sure what that means - we won't convert an arbitrary enumerable into another type such as ArrayList. But we will convert it one of the enumeration interfaces. When we pass your object out it'll be wrapped in one of our PythonEnumerable/PythonEnumerator/ItemEnumerable/ItemEnumerator classes. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of amit > Sent: Saturday, December 01, 2007 4:15 PM > To: users at lists.ironpython.com > Subject: [IronPython] mapping C# iterators to Python iterator > > Hi, > > I want to know how the "Iterators" in C# can be mapped to those in Python. > What I tried was: > > say for ArrayList object > > def __iter__(self): > self.index = self.Count > return self > > def next(self): > if self.index == 0: > raise StopIteration > self.index = self.index - 1 > return ?? > > If I am creating python classes dynamically how would I map > GetEnumerator() , MoveNext() , Current() , Reset() > to python Class so as to make it iterable inside python. > > --Regmee > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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 joshua.pearce at gmail.com Tue Dec 4 21:48:00 2007 From: joshua.pearce at gmail.com (Joshua J. Pearce) Date: Tue, 4 Dec 2007 15:48:00 -0500 Subject: [IronPython] Application.config Message-ID: <278e6e410712041248h2af9e007qe6787e39f751ae1f@mail.gmail.com> Our product, written in C#, has a Business Logic Layer project that gets compiled into a DLL. I can import the DLL and dependencies into IPY no problem, but where I run into trouble is that the Business layer code relies heavily on a configuration section within the web.config file. Does anyone know of a way for IronPython to load that web.config (or application.configwhen linked to a winforms app) file and make the IConfigurationSectionHandler available? Thanks, -- Joshua Pearce -------------- next part -------------- An HTML attachment was scrubbed... URL: From yan.lixin at gmail.com Wed Dec 5 02:15:44 2007 From: yan.lixin at gmail.com (=?GB2312?B?48Ygwabqvw==?=) Date: Tue, 4 Dec 2007 17:15:44 -0800 Subject: [IronPython] Application.config In-Reply-To: <278e6e410712041248h2af9e007qe6787e39f751ae1f@mail.gmail.com> References: <278e6e410712041248h2af9e007qe6787e39f751ae1f@mail.gmail.com> Message-ID: <174e07690712041715l6f115e8crf08764a1342fc027@mail.gmail.com> ipy.exe.config Here is my running very good ipy.exe.config (?????ipy.exe.config ?????)
?????????????. -------------- next part -------------- An HTML attachment was scrubbed... URL: From giles.thomas at resolversystems.com Thu Dec 6 18:59:59 2007 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Thu, 06 Dec 2007 17:59:59 +0000 Subject: [IronPython] ANNOUNCE: Resolver One public Beta now live Message-ID: <4758389F.1060000@resolversystems.com> We're proud to announce that today Resolver One, our flagship application, entered its public Beta phase. It can be downloaded from (free registration required), and we would very much welcome feedback from the Python community. Resolver One is a Rapid Application Development tool for analysing and presenting business data using a familiar spreadsheet interface - or, to put it another way, it is a mash-up of a spreadsheet and an IDE. As you enter formulae on the grid, it writes the equivalent IronPython code for you. As you add your own IronPython code, the grid is updated. This allows you to build applications that are much more complex but better-structured than a traditional spreadsheet, much more quickly than you could if you were using a regular programming language. You can then export the code and re-use it elsewhere in your own programs. It's primarily targetted at heavy users of number-crunching software, such as financial firms and the biotech industry, but we use it internally for all kinds of scripts, so we think any Python programmer will be able to do fun stuff with it. If you're interested in taking a look, please do download it or drop us a line! Best regards, Giles -- Giles Thomas MD & CTO, Resolver Systems Ltd. giles.thomas at resolversystems.com +44 (0) 20 7253 6372 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK From Sathish.Kaveripakam at phonak.com Mon Dec 10 14:54:08 2007 From: Sathish.Kaveripakam at phonak.com (Kaveripakam, Sathish) Date: Mon, 10 Dec 2007 14:54:08 +0100 Subject: [IronPython] Libraries: python and iron python Message-ID: Hi All, I am trying to port some of the python scripts to Iron python. In this regard, I found that some of the libraries in python: traceback, pprint, string, types etc., are not present with the same name in Iron python. I was wondering, is there any URL, which tells about the names given to them in Iron Python. Any information regarding the name of the changed libraries is appreciated. Regards ******************** Legal Notice: The information in this electronic transmission may contain confidential or legally privileged information and is intended solely for the individual(s) named above. If you are not an intended recipient or an authorized agent, you are hereby notified that reading, distributing, or otherwise disseminating, copying or taking any action based on the contents of this transmission is strictly prohibited. Any unauthorized interception of this transmission is illegal under law. If you have received this transmission in error, please notify the sender by telephone [at the number indicated above/ on +41 58 928 0101] as soon as possible and then destroy all copies of this transmission. ******************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Mon Dec 10 16:18:21 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 11 Dec 2007 00:18:21 +0900 Subject: [IronPython] Libraries: python and iron python In-Reply-To: References: Message-ID: <5b0248170712100718w350aaa4fpf42fe4c7db44e013@mail.gmail.com> 2007/12/10, Kaveripakam, Sathish : > I am trying to port some of the python scripts to Iron python. In this > regard, I found that some of the libraries in python: traceback, pprint, > string, types etc., are not present with the same name in Iron python. I was > wondering, is there any URL, which tells about the names given to them in > Iron Python. You can simply copy these libraries from Python. -- Seo Sanghyeon From vkhaskel at hotmail.com Mon Dec 10 19:17:27 2007 From: vkhaskel at hotmail.com (Vadim Khaskel) Date: Mon, 10 Dec 2007 18:17:27 +0000 Subject: [IronPython] IronPython in VisualStudio 2005 Message-ID: Hi All, I just started with IronPython in Visual Studio 2005 and I?m having problem to understand some basic things. I encountered with the following problem: simple app - user presses Button1 on Form1 and Form2 pops up. I have Button1 on Form1, Form2 in the same namespace with Form1. def _button1_Click(self, sender, e): f2=Form2() Error I get is this: name 'Form2' not defined Since Form2 in the same namespace I assume that there is no need to import anything to Form1.py, but I?m getting the same error regardless if I?m importing Form2.py or not. Thanks for help, Vadim _________________________________________________________________ Your smile counts. The more smiles you share, the more we donate.? Join in. www.windowslive.com/smile?ocid=TXT_TAGLM_Wave2_oprsmilewlhmtagline -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Dec 10 19:26:22 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 10 Dec 2007 18:26:22 +0000 Subject: [IronPython] [admin] IronPython in VisualStudio 2005 In-Reply-To: References: Message-ID: <475D84CE.4030803@voidspace.org.uk> Vadim Khaskel wrote: > > Hi All, > > > > I just started with IronPython in Visual Studio 2005 and I?m having > problem to understand some > > basic things. > > > > I encountered with the following problem: simple app - user presses > Button1 on Form1 and > > Form2 pops up. > > > > I have Button1 on Form1, Form2 in the same namespace with Form1. > > > > def _button1_Click(self, sender, e): > > f2=Form2() > > > > Error I get is this: > > > > name 'Form2' not defined > > > > Since Form2 in the same namespace I assume that there is no need to > import anything to Form1.py, but > > I?m getting the same error regardless if I?m importing Form2.py or not. > I'm afraid that this error means that you *don't* have the name 'Form2' in your namespace when this code is called. You need to include something like: from form2_module import Form2 Python will only let you use names that you have either defined or imported into the current namespace. Just importing the *module* that contains a definition doesn't give you access to all the names defined in the module (Python differs from the C# 'using' directive in this respect). Michael http://www.manning.com/foord > > > Thanks for help, > > > > Vadim > > > > > > ------------------------------------------------------------------------ > Your smile counts. The more smiles you share, the more we donate. Join > in! > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From pdubroy at gmail.com Tue Dec 11 04:34:41 2007 From: pdubroy at gmail.com (Patrick Dubroy) Date: Mon, 10 Dec 2007 22:34:41 -0500 Subject: [IronPython] Libraries: python and iron python In-Reply-To: References: Message-ID: <95294eec0712101934k762c5a20tceb56982cadf92d9@mail.gmail.com> You might want to check out Seo's FePy/IPCE project (http://fepy.sourceforge.net/), which is a distribution of IronPython that comes bundled with most of the standard CPython libraries. As Seo said, some of them are just copied directly from CPython, but others (e.g. socket, threading) have been re-implemented on top of the .NET classes. That's probably the best route to go if you are trying to run a bunch of unmodified Python code. Pat On Dec 10, 2007 8:54 AM, Kaveripakam, Sathish wrote: > > > Hi All, > > I am trying to port some of the python scripts to Iron python. In this > regard, I found that some of the libraries in python: traceback, pprint, > string, types etc., are not present with the same name in Iron python. I was > wondering, is there any URL, which tells about the names given to them in > Iron Python. > > Any information regarding the name of the changed libraries is appreciated. > > Regards > > ________________________________ > Legal Notice: > The information in this electronic transmission may contain confidential or > legally privileged information and is intended solely for the individual(s) > named above. If you are not an intended recipient or an authorized agent, > you are hereby notified that reading, distributing, or otherwise > disseminating, copying or taking any action based on the contents of this > transmission is strictly prohibited. Any unauthorized interception of this > transmission is illegal under law. If you have received this transmission in > error, please notify the sender by telephone [at the number indicated > above/on +41 58 928 0101] as soon as possible and then destroy all copies of > this transmission. > ________________________________ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From dinov at exchange.microsoft.com Tue Dec 11 04:40:53 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 10 Dec 2007 19:40:53 -0800 Subject: [IronPython] Mailing list vs. Web discussions on CodePlex Message-ID: <7AD436E4270DD54A94238001769C2227E6D67D688A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Just thought I'd collect some opinions here. Internally we discussed this sometime ago but never made any decisions and haven't done much to push this forward... On CodePlex we have the ability to enable a discussion forum (which would look like http://www.codeplex.com/CodePlex/Thread/List.aspx) where people could post questions, discuss issues, etc... CodePlex is heavily RSS-enabled so you could also get RSS feeds to track the discussions in RSS form. There've been some requests on the main page (http://www.codeplex.com/IronPython) and at least one person who didn't like the mailing list. But obviously we don't want to get rid of the mailing list format - personally it's the format I prefer (and find the least overhead for replying). But I've started to use RSS a lot recently so I can certainly see the appeal there, and maybe others here do as well... Overall my own personal worry is that we'll be fragmenting the two discussions and actually hinder some discussion. So, thoughts? Should we: Very easy: just open the flood gates on the discussions and everyone can go where they want - let the search engines sort it out! vs Requires some work: open up the RSS feed but setup some thread-propagation-bot? open up the RSS feed but send out regular digests? vs the unknown: something completely different? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Dec 11 04:47:03 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 10 Dec 2007 19:47:03 -0800 Subject: [IronPython] Libraries: python and iron python In-Reply-To: <95294eec0712101934k762c5a20tceb56982cadf92d9@mail.gmail.com> References: , <95294eec0712101934k762c5a20tceb56982cadf92d9@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227E6D67D688B@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Given I mentioned it before, I may as well mention it again... :) We are still trying to get our ducks in order to include the std lib ourselves. Hopefully we'll have more to say soon. ________________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Patrick Dubroy [pdubroy at gmail.com] Sent: Monday, December 10, 2007 7:34 PM To: Discussion of IronPython Subject: Re: [IronPython] Libraries: python and iron python You might want to check out Seo's FePy/IPCE project (http://fepy.sourceforge.net/), which is a distribution of IronPython that comes bundled with most of the standard CPython libraries. As Seo said, some of them are just copied directly from CPython, but others (e.g. socket, threading) have been re-implemented on top of the .NET classes. That's probably the best route to go if you are trying to run a bunch of unmodified Python code. Pat On Dec 10, 2007 8:54 AM, Kaveripakam, Sathish wrote: > > > Hi All, > > I am trying to port some of the python scripts to Iron python. In this > regard, I found that some of the libraries in python: traceback, pprint, > string, types etc., are not present with the same name in Iron python. I was > wondering, is there any URL, which tells about the names given to them in > Iron Python. > > Any information regarding the name of the changed libraries is appreciated. > > Regards > > ________________________________ > Legal Notice: > The information in this electronic transmission may contain confidential or > legally privileged information and is intended solely for the individual(s) > named above. If you are not an intended recipient or an authorized agent, > you are hereby notified that reading, distributing, or otherwise > disseminating, copying or taking any action based on the contents of this > transmission is strictly prohibited. Any unauthorized interception of this > transmission is illegal under law. If you have received this transmission in > error, please notify the sender by telephone [at the number indicated > above/on +41 58 928 0101] as soon as possible and then destroy all copies of > this transmission. > ________________________________ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From sh at defuze.org Tue Dec 11 10:38:51 2007 From: sh at defuze.org (Sylvain Hellegouarch) Date: Tue, 11 Dec 2007 10:38:51 +0100 Subject: [IronPython] Mailing list vs. Web discussions on CodePlex In-Reply-To: <7AD436E4270DD54A94238001769C2227E6D67D688A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227E6D67D688A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <475E5AAB.2030102@defuze.org> Personally I don't think the IP-list has enough volume to justify a split and that would be detrimental. If people don't want to subscribe to a list for fear of spam it's fair enough but the list has been working just fine until now and I personally would not pay attention to a forum per se myself. Anyway, just my 2 cents. - Sylvain Dino Viehland wrote: > Just thought I'd collect some opinions here. Internally we discussed > this sometime ago but never made any decisions and haven't done much > to push this forward... On CodePlex we have the ability to enable a > discussion forum (which would look like > http://www.codeplex.com/CodePlex/Thread/List.aspx) where people could > post questions, discuss issues, etc... CodePlex is heavily > RSS-enabled so you could also get RSS feeds to track the discussions > in RSS form. There've been some requests on the main page > (http://www.codeplex.com/IronPython) and at least one person who > didn't like the mailing list. > > But obviously we don't want to get rid of the mailing list format - > personally it's the format I prefer (and find the least overhead for > replying). But I've started to use RSS a lot recently so I can > certainly see the appeal there, and maybe others here do as well... > Overall my own personal worry is that we'll be fragmenting the two > discussions and actually hinder some discussion. > > So, thoughts? Should we: > Very easy: > just open the flood gates on the discussions and everyone can > go where they want - let the search engines sort it out! > vs Requires some work: > open up the RSS feed but setup some thread-propagation-bot? > open up the RSS feed but send out regular digests? > vs the unknown: > something completely different? > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From fuzzyman at voidspace.org.uk Tue Dec 11 10:45:26 2007 From: fuzzyman at voidspace.org.uk (Fuzzyman) Date: Tue, 11 Dec 2007 09:45:26 +0000 Subject: [IronPython] Mailing list vs. Web discussions on CodePlex In-Reply-To: <475E5AAB.2030102@defuze.org> References: <7AD436E4270DD54A94238001769C2227E6D67D688A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <475E5AAB.2030102@defuze.org> Message-ID: <475E5C36.6080601@voidspace.org.uk> Sylvain Hellegouarch wrote: >Personally I don't think the IP-list has enough volume to justify a >split and that would be detrimental. > >If people don't want to subscribe to a list for fear of spam it's fair >enough but the list has been working just fine until now and I >personally would not pay attention to a forum per se myself. > > I agree. I abhor forums and prefer mailing lists. Michael Foord http://www.manning.com/foord >Anyway, just my 2 cents. >- Sylvain > >Dino Viehland wrote: > > >>Just thought I'd collect some opinions here. Internally we discussed >>this sometime ago but never made any decisions and haven't done much >>to push this forward... On CodePlex we have the ability to enable a >>discussion forum (which would look like >>http://www.codeplex.com/CodePlex/Thread/List.aspx) where people could >>post questions, discuss issues, etc... CodePlex is heavily >>RSS-enabled so you could also get RSS feeds to track the discussions >>in RSS form. There've been some requests on the main page >>(http://www.codeplex.com/IronPython) and at least one person who >>didn't like the mailing list. >> >>But obviously we don't want to get rid of the mailing list format - >>personally it's the format I prefer (and find the least overhead for >>replying). But I've started to use RSS a lot recently so I can >>certainly see the appeal there, and maybe others here do as well... >>Overall my own personal worry is that we'll be fragmenting the two >>discussions and actually hinder some discussion. >> >>So, thoughts? Should we: >> Very easy: >> just open the flood gates on the discussions and everyone can >>go where they want - let the search engines sort it out! >> vs Requires some work: >> open up the RSS feed but setup some thread-propagation-bot? >> open up the RSS feed but send out regular digests? >> vs the unknown: >> something completely different? >> >> >>------------------------------------------------------------------------ >> >>_______________________________________________ >>Users mailing list >>Users at lists.ironpython.com >>http://lists.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 hfoffani at gmail.com Tue Dec 11 10:59:52 2007 From: hfoffani at gmail.com (Hernan M Foffani) Date: Tue, 11 Dec 2007 10:59:52 +0100 Subject: [IronPython] Mailing list vs. Web discussions on CodePlex In-Reply-To: <475E5C36.6080601@voidspace.org.uk> References: <7AD436E4270DD54A94238001769C2227E6D67D688A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <475E5AAB.2030102@defuze.org> <475E5C36.6080601@voidspace.org.uk> Message-ID: <11fab4bc0712110159i1bf4c779m273ac39423f21633@mail.gmail.com> > >Personally I don't think the IP-list has enough volume to justify a > >split and that would be detrimental. > > > >If people don't want to subscribe to a list for fear of spam it's fair > >enough but the list has been working just fine until now and I > >personally would not pay attention to a forum per se myself. > > > > > > I agree. I abhor forums and prefer mailing lists. Me either. BTW, are there any way to enable gmane for this list again? I've only found this: http://dir.gmane.org/gmane.comp.python.ironpython.user which seems outdated. I guess that a gateway to gmane would bring readers enough options to choose from. -H. From fuzzyman at voidspace.org.uk Tue Dec 11 11:32:19 2007 From: fuzzyman at voidspace.org.uk (Fuzzyman) Date: Tue, 11 Dec 2007 10:32:19 +0000 Subject: [IronPython] IronPython Studio Message-ID: <475E6733.4000203@voidspace.org.uk> Hello all, My apologies if this has been announced on the list before - but I wasn't aware of it. http://www.codeplex.com/IronPythonStudio IronPython Studio is a free full IDE (Integrated Development Environment) for the Python programming language. It is based on the existing IronPython example that is included in the VS SDK. IronPython Studio is based on the Visual Studio 2008 Shell runtime (royalty free) and can be installed without requiring any version of Visual Studio. Very interesting... Michael Foord http://www.manning.com/foord From fuzzyman at voidspace.org.uk Tue Dec 11 13:32:59 2007 From: fuzzyman at voidspace.org.uk (Fuzzyman) Date: Tue, 11 Dec 2007 12:32:59 +0000 Subject: [IronPython] Mailing list vs. Web discussions on CodePlex In-Reply-To: <11fab4bc0712110159i1bf4c779m273ac39423f21633@mail.gmail.com> References: <7AD436E4270DD54A94238001769C2227E6D67D688A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <475E5AAB.2030102@defuze.org> <475E5C36.6080601@voidspace.org.uk> <11fab4bc0712110159i1bf4c779m273ac39423f21633@mail.gmail.com> Message-ID: <475E837B.9000900@voidspace.org.uk> Hernan M Foffani wrote: >>>Personally I don't think the IP-list has enough volume to justify a >>>split and that would be detrimental. >>> >>>If people don't want to subscribe to a list for fear of spam it's fair >>>enough but the list has been working just fine until now and I >>>personally would not pay attention to a forum per se myself. >>> >>> >>> >>> >>I agree. I abhor forums and prefer mailing lists. >> >> > >Me either. >BTW, are there any way to enable gmane for this list again? >I've only found this: >http://dir.gmane.org/gmane.comp.python.ironpython.user >which seems outdated. >I guess that a gateway to gmane would bring readers enough >options to choose from. > > There is already a google groups gateway - but it doesn't allow posting unless your google login email address is registered as an IronPython list member: http://groups.google.com/group/ironpy Michael http://www.manning.com/foord >-H. >_______________________________________________ >Users mailing list >Users at lists.ironpython.com >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From joesox at gmail.com Tue Dec 11 16:25:59 2007 From: joesox at gmail.com (JoeSox) Date: Tue, 11 Dec 2007 07:25:59 -0800 Subject: [IronPython] Mailing list vs. Web discussions on CodePlex In-Reply-To: <7AD436E4270DD54A94238001769C2227E6D67D688A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227E6D67D688A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <785694cd0712110725r8cd11a1pdb0d29a3af942fd6@mail.gmail.com> On 12/10/07, Dino Viehland wrote: > > Just thought I'd collect some opinions here. Internally we discussed this > sometime ago but never made any decisions and haven't done much to push this > forward... On CodePlex we have the ability to enable a discussion forum > (which would look like > http://www.codeplex.com/CodePlex/Thread/List.aspx) where > people could post questions, discuss issues, etc... CodePlex is heavily > RSS-enabled so you could also get RSS feeds to track the discussions in RSS > form. There've been some requests on the main page > (http://www.codeplex.com/IronPython) and at least one > person who didn't like the mailing list. > > But obviously we don't want to get rid of the mailing list format - > personally it's the format I prefer (and find the least overhead for > replying). But I've started to use RSS a lot recently so I can certainly > see the appeal there, and maybe others here do as well... Overall my own > personal worry is that we'll be fragmenting the two discussions and actually > hinder some discussion. > > So, thoughts? Should we: > Very easy: > just open the flood gates on the discussions and everyone can go > where they want - let the search engines sort it out! > vs Requires some work: > open up the RSS feed but setup some thread-propagation-bot? > open up the RSS feed but send out regular digests? > vs the unknown: > something completely different? I think an email and forum combination sounds like the most obvious solution. For example, some online groups you can just reply to an email and it gets sent to the distribution list and also posts to the message board. Isn't the Microsoft Robotics Studio forum already using a solution like this? I forget it has been a few months since being on that forum but I like the user interface on that forum and the threading. -- Later, Joe From joesox at gmail.com Tue Dec 11 20:16:15 2007 From: joesox at gmail.com (JoeSox) Date: Tue, 11 Dec 2007 11:16:15 -0800 Subject: [IronPython] IronPython Studio In-Reply-To: <475E6733.4000203@voidspace.org.uk> References: <475E6733.4000203@voidspace.org.uk> Message-ID: <785694cd0712111116n65f0bf4dr9d85bf31d99adb5f@mail.gmail.com> On 12/11/07, Fuzzyman wrote: > Hello all, > > My apologies if this has been announced on the list before - but I > wasn't aware of it. > > http://www.codeplex.com/IronPythonStudio > > IronPython Studio is a free full IDE (Integrated Development > Environment) for the Python programming language. It is based on the > existing IronPython example that is included in the VS SDK. IronPython > Studio is based on the Visual Studio 2008 Shell runtime (royalty free) > and can be installed without requiring any version of Visual Studio. > > Very interesting... I just downloaded and installed the Visual Studio 2008 Shell (Isolated)redistributable package and the IronPython Studio setup does not detect that I have installed it. arrrg :( -- Later, JoeSox From pdubroy at gmail.com Tue Dec 11 20:32:02 2007 From: pdubroy at gmail.com (Patrick Dubroy) Date: Tue, 11 Dec 2007 14:32:02 -0500 Subject: [IronPython] Mailing list vs. Web discussions on CodePlex In-Reply-To: <7AD436E4270DD54A94238001769C2227E6D67D688A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227E6D67D688A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <95294eec0712111132q20f30b96o95c41524d249b825@mail.gmail.com> I also think it would be confusing to have both the mailing list and the forum, considering the traffic is pretty low on the mailing list. Pat On Dec 10, 2007 10:40 PM, Dino Viehland wrote: > > > Just thought I'd collect some opinions here. Internally we discussed this > sometime ago but never made any decisions and haven't done much to push this > forward... On CodePlex we have the ability to enable a discussion forum > (which would look like http://www.codeplex.com/CodePlex/Thread/List.aspx) > where people could post questions, discuss issues, etc... CodePlex is > heavily RSS-enabled so you could also get RSS feeds to track the discussions > in RSS form. There've been some requests on the main page > (http://www.codeplex.com/IronPython) and at least one person who didn't like > the mailing list. > > But obviously we don't want to get rid of the mailing list format - > personally it's the format I prefer (and find the least overhead for > replying). But I've started to use RSS a lot recently so I can certainly > see the appeal there, and maybe others here do as well... Overall my own > personal worry is that we'll be fragmenting the two discussions and actually > hinder some discussion. > > So, thoughts? Should we: > Very easy: > just open the flood gates on the discussions and everyone can go > where they want - let the search engines sort it out! > vs Requires some work: > open up the RSS feed but setup some thread-propagation-bot? > open up the RSS feed but send out regular digests? > vs the unknown: > something completely different? > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From pdubroy at gmail.com Tue Dec 11 20:37:40 2007 From: pdubroy at gmail.com (Patrick Dubroy) Date: Tue, 11 Dec 2007 14:37:40 -0500 Subject: [IronPython] Problem with System.Diagnostics.Process.Start Message-ID: <95294eec0712111137l69434825s55496dcb01cde1e8@mail.gmail.com> I've got a .swf file that I am trying to launch in the registered application, using System.Diagnostics.Process.Start(). I am trying the following: >>> os.path.exists(r'C:\dubroy\nb-reusable.swf') True >>> System.Diagnostics.Process.Start(r'C:\dubroy\nb-reusable.swf') Traceback (most recent call last): File , line 0, in ##148 File , line 0, in _stub_##136 File System, line unknown, in Start File System, line unknown, in Start File System, line unknown, in Start File System, line unknown, in StartWithShellExecuteEx WindowsError: Application not found The weird thing is that if I double-click on the file in explorer, it properly launches the file in the Flash player. Does explorer do something different than ShellExecute? Any idea why StartWithShellExecuteEx can't find the registered application, but explorer can? Thanks, Pat From riltim at gmail.com Tue Dec 11 23:22:55 2007 From: riltim at gmail.com (Tim Riley) Date: Tue, 11 Dec 2007 17:22:55 -0500 Subject: [IronPython] IronPython Studio In-Reply-To: <785694cd0712111116n65f0bf4dr9d85bf31d99adb5f@mail.gmail.com> References: <475E6733.4000203@voidspace.org.uk> <785694cd0712111116n65f0bf4dr9d85bf31d99adb5f@mail.gmail.com> Message-ID: I just tried and am having the same problem. On Dec 11, 2007 2:16 PM, JoeSox wrote: > On 12/11/07, Fuzzyman wrote: > > Hello all, > > > > My apologies if this has been announced on the list before - but I > > wasn't aware of it. > > > > http://www.codeplex.com/IronPythonStudio > > > > IronPython Studio is a free full IDE (Integrated Development > > Environment) for the Python programming language. It is based on the > > existing IronPython example that is included in the VS SDK. IronPython > > Studio is based on the Visual Studio 2008 Shell runtime (royalty free) > > and can be installed without requiring any version of Visual Studio. > > > > Very interesting... > > I just downloaded and installed the Visual Studio 2008 Shell > (Isolated)redistributable package and the IronPython Studio setup does > not detect that I have installed it. arrrg :( > > -- > Later, JoeSox > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From twclark at bellsouth.net Tue Dec 11 23:28:54 2007 From: twclark at bellsouth.net (Tom Clark) Date: Tue, 11 Dec 2007 17:28:54 -0500 Subject: [IronPython] IronPython Studio In-Reply-To: References: <475E6733.4000203@voidspace.org.uk><785694cd0712111116n65f0bf4dr9d85bf31d99adb5f@mail.gmail.com> Message-ID: <001b01c83c45$36b4aec0$640fa8c0@D63K8181> I had the same problem. I figured out that after installing the redistributable, you must go to the folder on your hard drive (on mine it is: C:\VS 2008 Shell Redist\Isolated Mode) once there, run: vs_shell_isolated_enu.exe. That actually installs the runtime on your PC. Then the IronPython Studio .msi will detect it. Tom Clark -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tim Riley Sent: Tuesday, December 11, 2007 5:23 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython Studio I just tried and am having the same problem. On Dec 11, 2007 2:16 PM, JoeSox wrote: > On 12/11/07, Fuzzyman wrote: > > Hello all, > > > > My apologies if this has been announced on the list before - but I > > wasn't aware of it. > > > > http://www.codeplex.com/IronPythonStudio > > > > IronPython Studio is a free full IDE (Integrated Development > > Environment) for the Python programming language. It is based on the > > existing IronPython example that is included in the VS SDK. > > IronPython Studio is based on the Visual Studio 2008 Shell runtime > > (royalty free) and can be installed without requiring any version of Visual Studio. > > > > Very interesting... > > I just downloaded and installed the Visual Studio 2008 Shell > (Isolated)redistributable package and the IronPython Studio setup does > not detect that I have installed it. arrrg :( > > -- > Later, JoeSox > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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 tcronin at co.riverside.ca.us Wed Dec 12 00:03:42 2007 From: tcronin at co.riverside.ca.us (Ted Cronin) Date: Tue, 11 Dec 2007 15:03:42 -0800 Subject: [IronPython] IronPython Studio In-Reply-To: References: <475E6733.4000203@voidspace.org.uk> <785694cd0712111116n65f0bf4dr9d85bf31d99adb5f@mail.gmail.com> Message-ID: <475EA6CE0200000A000F0ECC@gwvs01.co.riverside.ca.us> Just go to http://www.codeplex.com/IronPythonStudio/Thread/List.aspx Ted >>> "Tim Riley" 12/11/2007 2:22 PM >>> I just tried and am having the same problem. On Dec 11, 2007 2:16 PM, JoeSox wrote: > On 12/11/07, Fuzzyman wrote: > > Hello all, > > > > My apologies if this has been announced on the list before - but I > > wasn't aware of it. > > > > http://www.codeplex.com/IronPythonStudio > > > > IronPython Studio is a free full IDE (Integrated Development > > Environment) for the Python programming language. It is based on the > > existing IronPython example that is included in the VS SDK. IronPython > > Studio is based on the Visual Studio 2008 Shell runtime (royalty free) > > and can be installed without requiring any version of Visual Studio. > > > > Very interesting... > > I just downloaded and installed the Visual Studio 2008 Shell > (Isolated)redistributable package and the IronPython Studio setup does > not detect that I have installed it. arrrg :( > > -- > Later, JoeSox > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnfinch at mac.com Wed Dec 12 02:20:17 2007 From: johnfinch at mac.com (John Finch) Date: Tue, 11 Dec 2007 20:20:17 -0500 Subject: [IronPython] IronPython Studio In-Reply-To: <001b01c83c45$36b4aec0$640fa8c0@D63K8181> References: <475E6733.4000203@voidspace.org.uk> <785694cd0712111116n65f0bf4dr9d85bf31d99adb5f@mail.gmail.com> <001b01c83c45$36b4aec0$640fa8c0@D63K8181> Message-ID: <22A1CC4577B747E6B8467BF6C7B1B777@JohnsPC> Tom Just went to the IPY Studio website to add your finding s and found you have already done it. Nice touch. Thanks. ----- Original Message ----- From: "Tom Clark" To: "'Discussion of IronPython'" Sent: Tuesday, December 11, 2007 5:28 PM Subject: Re: [IronPython] IronPython Studio >I had the same problem. I figured out that after installing the > redistributable, you must go to the folder on your hard drive (on mine it > is: C:\VS 2008 Shell Redist\Isolated Mode) once there, run: > vs_shell_isolated_enu.exe. > That actually installs the runtime on your PC. Then the IronPython Studio > .msi will detect it. > > Tom Clark > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tim Riley > Sent: Tuesday, December 11, 2007 5:23 PM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython Studio > > I just tried and am having the same problem. > > On Dec 11, 2007 2:16 PM, JoeSox wrote: >> On 12/11/07, Fuzzyman wrote: >> > Hello all, >> > >> > My apologies if this has been announced on the list before - but I >> > wasn't aware of it. >> > >> > http://www.codeplex.com/IronPythonStudio >> > >> > IronPython Studio is a free full IDE (Integrated Development >> > Environment) for the Python programming language. It is based on the >> > existing IronPython example that is included in the VS SDK. >> > IronPython Studio is based on the Visual Studio 2008 Shell runtime >> > (royalty free) and can be installed without requiring any version of > Visual Studio. >> > >> > Very interesting... >> >> I just downloaded and installed the Visual Studio 2008 Shell >> (Isolated)redistributable package and the IronPython Studio setup does >> not detect that I have installed it. arrrg :( >> >> -- >> Later, JoeSox >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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 kf9150 at gmail.com Wed Dec 12 09:30:30 2007 From: kf9150 at gmail.com (Kelie) Date: Wed, 12 Dec 2007 00:30:30 -0800 (PST) Subject: [IronPython] IronPython Studio In-Reply-To: <475EA6CE0200000A000F0ECC@gwvs01.co.riverside.ca.us> References: <475E6733.4000203@voidspace.org.uk> <785694cd0712111116n65f0bf4dr9d85bf31d99adb5f@mail.gmail.com> <475EA6CE0200000A000F0ECC@gwvs01.co.riverside.ca.us> Message-ID: <57fc11c1-4118-4a8e-aa50-3dea0b0d0328@j20g2000hsi.googlegroups.com> Hello, Does anyone know where to specify library path for standard python modules? In IronPython installation, there is a Lib folder which has a file named site.py. It can be used to specify the library path. In IronPython Studio, I could not figure out how to solve this problem. Thank you! From Sathish.Kaveripakam at phonak.com Wed Dec 12 11:50:23 2007 From: Sathish.Kaveripakam at phonak.com (Kaveripakam, Sathish) Date: Wed, 12 Dec 2007 11:50:23 +0100 Subject: [IronPython] Win32pipe, win32File, Win32api Message-ID: HI All, I am trying to port python code to the .NET environment using iron python. In my existing python code, I have calls to the WIn applications: import win32pipe import win32File import Win32api When I try to execute the above code, it complains "No module named win32xxx". In my system append path, I have also given link to pick the libraries from the "../IPCE-r7/Lib" (i.e python stub for ironpython). But it didnt help me much. Could anyone let me know, how to handle the win32xxx imports for iron python ? Regards ******************** Legal Notice: The information in this electronic transmission may contain confidential or legally privileged information and is intended solely for the individual(s) named above. If you are not an intended recipient or an authorized agent, you are hereby notified that reading, distributing, or otherwise disseminating, copying or taking any action based on the contents of this transmission is strictly prohibited. Any unauthorized interception of this transmission is illegal under law. If you have received this transmission in error, please notify the sender by telephone [at the number indicated above/ on +41 58 928 0101] as soon as possible and then destroy all copies of this transmission. ******************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.john.rees at gmail.com Wed Dec 12 12:00:56 2007 From: mark.john.rees at gmail.com (Mark Rees) Date: Wed, 12 Dec 2007 22:00:56 +1100 Subject: [IronPython] Win32pipe, win32File, Win32api In-Reply-To: References: Message-ID: The win32 modules are Python C extension modules that provide access to various windows api's. Currently IronPython can not use CPython C extensions. But since IronPython has full access to .NET assemblies, there will be calls you would be able to utilise. Mark On Dec 12, 2007 9:50 PM, Kaveripakam, Sathish wrote: > > > HI All, > > I am trying to port python code to the .NET environment using iron python. > > In my existing python code, I have calls to the WIn applications: > > import win32pipe > import win32File > import Win32api > > When I try to execute the above code, it complains "No module named > win32xxx". In my system append path, I have also given link to pick the > libraries from the "../IPCE-r7/Lib" (i.e python stub for ironpython). But > it didnt help me much. > > Could anyone let me know, how to handle the win32xxx imports for iron python > ? > > Regards > > > ________________________________ > Legal Notice: > The information in this electronic transmission may contain confidential or > legally privileged information and is intended solely for the individual(s) > named above. If you are not an intended recipient or an authorized agent, > you are hereby notified that reading, distributing, or otherwise > disseminating, copying or taking any action based on the contents of this > transmission is strictly prohibited. Any unauthorized interception of this > transmission is illegal under law. If you have received this transmission in > error, please notify the sender by telephone [at the number indicated > above/on +41 58 928 0101] as soon as possible and then destroy all copies of > this transmission. > ________________________________ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From fuzzyman at voidspace.org.uk Wed Dec 12 12:04:58 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 12 Dec 2007 11:04:58 +0000 Subject: [IronPython] [python] Win32pipe, win32File, Win32api In-Reply-To: References: Message-ID: <475FC05A.5040003@voidspace.org.uk> Kaveripakam, Sathish wrote: > HI All, > > I am trying to port python code to the .NET environment using iron python. > > In my existing python code, I have calls to the WIn applications: > > import win32pipe > import win32File > import Win32api Those modules are C extensions compiled for CPython. To run the code with IronPython you will have to replace those modules with .NET equivalents. Michael http://www.manning.com/foord > > When I try to execute the above code, it complains "No module named > win32xxx". In my system append path, I have also given link to pick > the libraries from the "../IPCE-r7/Lib" (i.e python stub for > ironpython). But it didnt help me much. > > Could anyone let me know, how to handle the win32xxx imports for iron > python ? > > Regards > > > ------------------------------------------------------------------------ > _Legal Notice:_ > The information in this electronic transmission may contain > confidential or legally privileged information and is intended solely > for the individual(s) named above. If you are not an intended > recipient or an authorized agent, you are hereby notified that > reading, distributing, or otherwise disseminating, copying or taking > any action based on the contents of this transmission is strictly > prohibited. Any unauthorized interception of this transmission is > illegal under law. If you have received this transmission in error, > please notify the sender by telephone [at the number indicated > above/on +41 58 928 0101] as soon as possible and then destroy all > copies of this transmission. > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From fuzzyman at voidspace.org.uk Thu Dec 13 15:37:26 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 13 Dec 2007 14:37:26 +0000 Subject: [IronPython] Loading Images from XAML with XamlReader (WPF) Message-ID: <476143A6.2050202@voidspace.org.uk> Hello guys, I'm struggling to load images from XAML using the XamlReader with IronPython. The equivalent with compiled XAML and C# works fine - however this doesn't directly use the XamlReader so I wonder if it is an issue with that? The Python code is: import clr clr.AddReference("PresentationFramework") clr.AddReference("PresentationCore") from System.IO import File from System.Windows.Markup import XamlReader from System.Windows import ( Application, Window ) class HelloWorld(Window): def __init__(self): stream = File.OpenRead("HelloWorld.xaml") self.Content = XamlReader.Load(stream) hello = HelloWorld() app = Application() app.Run(hello) The XAML is: The image stubbornly refuses to appear and reports an ActualHeight and ActualWidth of 0.0 if I inspect it. I've even tried instantiating a BitmapImage directly from code and setting it as the Source on the image: image = root.FindName("image") bi = BitmapImage() bi.BeginInit() bi.UriSource = Uri("/images/image.jpg", UriKind.RelativeOrAbsolute); bi.EndInit() image.Source = bi Same problem - the image doesn't show. Anyone got any clues? Michael Foord http://www.voidspace.org.uk/python/weblog/index.shtml From fuzzyman at voidspace.org.uk Thu Dec 13 16:19:42 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 13 Dec 2007 15:19:42 +0000 Subject: [IronPython] [python] Loading Images from XAML with XamlReader (WPF) In-Reply-To: <476143A6.2050202@voidspace.org.uk> References: <476143A6.2050202@voidspace.org.uk> Message-ID: <47614D8E.9000505@voidspace.org.uk> Just to clarify - creating an image directly from code *does* work. But I still want (need?) to know why it doesn't work when loaded from XAML? This is the working code: import clr clr.AddReference("PresentationFramework") clr.AddReference("PresentationCore") from System import Uri, UriKind from System.Windows.Markup import XamlReader from System.Windows import ( Application, Window ) from System.Windows.Controls import Image from System.Windows.Media.Imaging import BitmapImage class HelloWorld(Window): def __init__(self): self.Width = 500 self.Height = 500 self.Title = 'Example' image = Image() bi = BitmapImage() bi.BeginInit() bi.UriSource = Uri("images/image.jpg", UriKind.RelativeOrAbsolute); bi.EndInit() image.Source = bi print image.ActualHeight, image.ActualWidth self.Content = image hello = HelloWorld() app = Application() app.Run(hello) Michael Michael Foord wrote: > Hello guys, > > I'm struggling to load images from XAML using the XamlReader with > IronPython. The equivalent with compiled XAML and C# works fine - > however this doesn't directly use the XamlReader so I wonder if it is an > issue with that? > > The Python code is: > > import clr > clr.AddReference("PresentationFramework") > clr.AddReference("PresentationCore") > > from System.IO import File > from System.Windows.Markup import XamlReader > > from System.Windows import ( > Application, Window > ) > > class HelloWorld(Window): > def __init__(self): > stream = File.OpenRead("HelloWorld.xaml") > self.Content = XamlReader.Load(stream) > > hello = HelloWorld() > > app = Application() > app.Run(hello) > > > The XAML is: > > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> > > > HorizontalAlignment="Center" VerticalAlignment="Center"/> > > > > > The image stubbornly refuses to appear and reports an ActualHeight and > ActualWidth of 0.0 if I inspect it. > > I've even tried instantiating a BitmapImage directly from code and > setting it as the Source on the image: > > image = root.FindName("image") > > bi = BitmapImage() > bi.BeginInit() > bi.UriSource = Uri("/images/image.jpg", UriKind.RelativeOrAbsolute); > bi.EndInit() > image.Source = bi > > Same problem - the image doesn't show. Anyone got any clues? > > Michael Foord > http://www.voidspace.org.uk/python/weblog/index.shtml > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From fuzzyman at voidspace.org.uk Thu Dec 13 19:21:07 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 13 Dec 2007 18:21:07 +0000 Subject: [IronPython] [python] Loading Images from XAML with XamlReader (WPF) In-Reply-To: <476143A6.2050202@voidspace.org.uk> References: <476143A6.2050202@voidspace.org.uk> Message-ID: <47617813.5020100@voidspace.org.uk> Hmmm... providing the full path to the image works fine. But that is a problem as I don't want to do that... *sigh* Michael Michael Foord wrote: > Hello guys, > > I'm struggling to load images from XAML using the XamlReader with > IronPython. The equivalent with compiled XAML and C# works fine - > however this doesn't directly use the XamlReader so I wonder if it is an > issue with that? > > The Python code is: > > import clr > clr.AddReference("PresentationFramework") > clr.AddReference("PresentationCore") > > from System.IO import File > from System.Windows.Markup import XamlReader > > from System.Windows import ( > Application, Window > ) > > class HelloWorld(Window): > def __init__(self): > stream = File.OpenRead("HelloWorld.xaml") > self.Content = XamlReader.Load(stream) > > hello = HelloWorld() > > app = Application() > app.Run(hello) > > > The XAML is: > > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> > > > HorizontalAlignment="Center" VerticalAlignment="Center"/> > > > > > The image stubbornly refuses to appear and reports an ActualHeight and > ActualWidth of 0.0 if I inspect it. > > I've even tried instantiating a BitmapImage directly from code and > setting it as the Source on the image: > > image = root.FindName("image") > > bi = BitmapImage() > bi.BeginInit() > bi.UriSource = Uri("/images/image.jpg", UriKind.RelativeOrAbsolute); > bi.EndInit() > image.Source = bi > > Same problem - the image doesn't show. Anyone got any clues? > > Michael Foord > http://www.voidspace.org.uk/python/weblog/index.shtml > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From fuzzyman at voidspace.org.uk Thu Dec 13 19:41:21 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 13 Dec 2007 18:41:21 +0000 Subject: [IronPython] [python] Loading Images from XAML with XamlReader (WPF) In-Reply-To: <476143A6.2050202@voidspace.org.uk> References: <476143A6.2050202@voidspace.org.uk> Message-ID: <47617CD1.2050204@voidspace.org.uk> Sorry about the noise guys, but having found the solution I guess I ought to share it. The answer is (wait for it...)... use site of origin relative syntax for the Source tag. Source="pack://siteoforigin:,,,/image.jpg" And its such an obvious syntax, how could I have missed it. :-) Gory details here: http://msdn2.microsoft.com/en-us/library/aa970069.aspx Michael Michael Foord wrote: > Hello guys, > > I'm struggling to load images from XAML using the XamlReader with > IronPython. The equivalent with compiled XAML and C# works fine - > however this doesn't directly use the XamlReader so I wonder if it is an > issue with that? > > The Python code is: > > import clr > clr.AddReference("PresentationFramework") > clr.AddReference("PresentationCore") > > from System.IO import File > from System.Windows.Markup import XamlReader > > from System.Windows import ( > Application, Window > ) > > class HelloWorld(Window): > def __init__(self): > stream = File.OpenRead("HelloWorld.xaml") > self.Content = XamlReader.Load(stream) > > hello = HelloWorld() > > app = Application() > app.Run(hello) > > > The XAML is: > > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> > > > HorizontalAlignment="Center" VerticalAlignment="Center"/> > > > > > The image stubbornly refuses to appear and reports an ActualHeight and > ActualWidth of 0.0 if I inspect it. > > I've even tried instantiating a BitmapImage directly from code and > setting it as the Source on the image: > > image = root.FindName("image") > > bi = BitmapImage() > bi.BeginInit() > bi.UriSource = Uri("/images/image.jpg", UriKind.RelativeOrAbsolute); > bi.EndInit() > image.Source = bi > > Same problem - the image doesn't show. Anyone got any clues? > > Michael Foord > http://www.voidspace.org.uk/python/weblog/index.shtml > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From jfletcher007 at gmail.com Thu Dec 13 20:18:58 2007 From: jfletcher007 at gmail.com (John Fletcher) Date: Thu, 13 Dec 2007 20:18:58 +0100 Subject: [IronPython] Python libraries Message-ID: <646b8f570712131118w30ac569eo1277a866eb35931c@mail.gmail.com> All, I am absolutely a new bie to python and Iron python. My target application has chunk of C# code and existing python code. I would like to integrate both of them. I am using Visual Studio 2005 with .NET. I understood from the blogs and on the internet that, it is possible to integrate both of them. Please find my setup and correct me, if I am wrong. 1) C# code whose final compilation gives *.exe (Visual studio 2005 with .NET) 2) Ironpython.dll and IronMath.dll are added as references in the C# project. 3) C# project calls the Python Engine scripts using "Python Engine". I would like to keep my Python Script mostly untouched using the existing C-Python Libraries. Please do let me know, is it possible to do as mentioned above ? If so, how to add the Python Libraries ? or any practical problems, which I should be aware of it ? Sorry for my ignorance, as I am completly new to scripting (:- Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Thu Dec 13 20:28:55 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 13 Dec 2007 19:28:55 +0000 Subject: [IronPython] [python] Python libraries In-Reply-To: <646b8f570712131118w30ac569eo1277a866eb35931c@mail.gmail.com> References: <646b8f570712131118w30ac569eo1277a866eb35931c@mail.gmail.com> Message-ID: <476187F7.1080509@voidspace.org.uk> John Fletcher wrote: > All, > > I am absolutely a new bie to python and Iron python. > > My target application has chunk of C# code and existing python code. I > would like to integrate both of them. I am using Visual Studio 2005 > with .NET. I understood from the blogs and on the internet that, it is > possible to integrate both of them. Please find my setup and correct > me, if I am wrong. > > 1) C# code whose final compilation gives *.exe (Visual studio 2005 > with .NET) > > 2) Ironpython.dll and IronMath.dll are added as references in the C# > project. > > 3) C# project calls the Python Engine scripts using "Python Engine". > > I would like to keep my Python Script mostly untouched using the > existing C-Python Libraries. Please do let me know, is it possible to > do as mentioned above ? If so, how to add the Python Libraries ? or > any practical problems, which I should be aware of it ? > > Sorry for my ignorance, as I am completly new to scripting (:- Put the pure Python modules you need in a directory as part of your project. Add the path to that directory to the 'sys' module of your PythonEngine. Michael http://www.manning.com/foord > > Cheers, > John > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From jomes at microsoft.com Thu Dec 13 21:39:13 2007 From: jomes at microsoft.com (John Messerly) Date: Thu, 13 Dec 2007 12:39:13 -0800 Subject: [IronPython] [python] Loading Images from XAML with XamlReader (WPF) In-Reply-To: <47617CD1.2050204@voidspace.org.uk> References: <476143A6.2050202@voidspace.org.uk> <47617CD1.2050204@voidspace.org.uk> Message-ID: <918705E903F4714CB713D89AB5F1857D738EBC3834@NA-EXMSG-C116.redmond.corp.microsoft.com> Michael Foord wrote: > Sorry about the noise guys, but having found the solution I guess I > ought to share it. The answer is (wait for it...)... use site of origin > relative syntax for the Source tag. > > Source="pack://siteoforigin:,,,/image.jpg" > > And its such an obvious syntax, how could I have missed it. :-) > > Gory details here: > http://msdn2.microsoft.com/en-us/library/aa970069.aspx Another workaround would be to use HtmlPage.DocumentUri & cook up an absolute Uri using that, but it looks like you found a good workaround already. Relative URIs are actually a pretty tricky problem; one we're actively working on fixing. The current thinking is to have something like "MakeUri" or "GetRelativeUri" which takes a relative URI string, and returns an absolute System.Uri object which is relative to the executing Python file (which is how the relative URI should work). And of course, there will be a way to get the currently executing file path, if you want to cook up the Uri object yourself. - John From leculver at microsoft.com Thu Dec 13 22:54:09 2007 From: leculver at microsoft.com (Lee Culver) Date: Thu, 13 Dec 2007 13:54:09 -0800 Subject: [IronPython] -X:SaveAssemblies Message-ID: <6512F99DEFF77C418E6738CE6E12FD4E5BC708E281@NA-EXMSG-C105.redmond.corp.microsoft.com> I use the -X:SaveAssemblies command to compile and pass around tools that I create with IronPython... I've noticed that it fails on 2.0A6. Specifically, the exe that it generates gives an "invalid executable" dialog box in windows (with the 3 dlls in the same directory as the .exe file). Is this a known issue? If so is there an eta on a fix? I've had to switch back to 1.1 as a result... -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Dec 13 23:09:12 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 13 Dec 2007 14:09:12 -0800 Subject: [IronPython] -X:SaveAssemblies In-Reply-To: <6512F99DEFF77C418E6738CE6E12FD4E5BC708E281@NA-EXMSG-C105.redmond.corp.microsoft.com> References: <6512F99DEFF77C418E6738CE6E12FD4E5BC708E281@NA-EXMSG-C105.redmond.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227F41BAA27D3@DF-GRTDANE-MSG.exchange.corp.microsoft.com> In v2.0 we currently don't support re-running the assemblies that are saved to disk. There are a number of places where to simplify things we've taken a dependency of passing live objects from compilation through to runtime. Unfortunately I don't know when we'll be fixing that yet. You're not the only one that wants it though so it's hard to imagine we can completely ignore it. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Lee Culver Sent: Thursday, December 13, 2007 1:54 PM To: Users at lists.ironpython.com Subject: [IronPython] -X:SaveAssemblies I use the -X:SaveAssemblies command to compile and pass around tools that I create with IronPython... I've noticed that it fails on 2.0A6. Specifically, the exe that it generates gives an "invalid executable" dialog box in windows (with the 3 dlls in the same directory as the .exe file). Is this a known issue? If so is there an eta on a fix? I've had to switch back to 1.1 as a result... -Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From Sathish.Kaveripakam at phonak.com Fri Dec 14 13:42:51 2007 From: Sathish.Kaveripakam at phonak.com (Kaveripakam, Sathish) Date: Fri, 14 Dec 2007 13:42:51 +0100 Subject: [IronPython] importing C Based *.dlls Message-ID: I am trying to "import C-Based dll's" into the Iron python files using import function, wherein I have path to the Standard C-python libraries is added. Ex: import sys import os if __name__ == "__main__": sys.path.append("C:/IronPython/IronPythonBinary-V1.1/IronPython-1.1-Bin/ IronPython-1.1/Tutorial") import clr clr.AddReferenceToFileAndPath("C:/IronPython/IronPythonBinary-V1.1/IronP ython-1.1-Bin/IronPython-1.1/Tutorial/csextend.dll") import Simple as t_Simple import c_dll In the above file I am able to import the C# file , but when execution comes to c_dll, it complains as "No module named c_dll". Can anyone let me know, if the C based dll's can be imported in Iron python environment ? If not, any work arounds available for the fix ? Regards ******************** Legal Notice: The information in this electronic transmission may contain confidential or legally privileged information and is intended solely for the individual(s) named above. If you are not an intended recipient or an authorized agent, you are hereby notified that reading, distributing, or otherwise disseminating, copying or taking any action based on the contents of this transmission is strictly prohibited. Any unauthorized interception of this transmission is illegal under law. If you have received this transmission in error, please notify the sender by telephone [at the number indicated above/ on +41 58 928 0101] as soon as possible and then destroy all copies of this transmission. ******************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Fri Dec 14 13:51:14 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 14 Dec 2007 12:51:14 +0000 Subject: [IronPython] [python] importing C Based *.dlls In-Reply-To: References: Message-ID: <47627C42.40506@voidspace.org.uk> Kaveripakam, Sathish wrote: > I am trying to "import C-Based dll's" into the Iron python files using > import function, wherein I have path to the Standard C-python > libraries is added. > > Ex: > > import sys > import os > > if __name__ == "__main__": > > sys.path.append("C:/IronPython/IronPythonBinary-V1.1/IronPython-1.1-Bin/IronPython-1.1/Tutorial") > > import clr > > clr.AddReferenceToFileAndPath("C:/IronPython/IronPythonBinary-V1.1/IronPython-1.1-Bin/IronPython-1.1/Tutorial/csextend.dll") > import Simple as t_Simple > import c_dll > > In the above file I am able to import the C# file , but when execution > comes to c_dll, it complains as "No module named c_dll". > > Can anyone let me know, if the C based dll's can be imported in Iron > python environment ? If not, any work arounds available for the fix ? The *basic* situation is that C based DLLs can't be imported into IronPython. Are they CPython C extensions? There is a way (experimental) to access these: http://www.voidspace.org.uk/ironpython/cpython_extensions.shtml In general C libraries (unmanaged code) can be used from .NET with 'Platform Invoke' - using the DllImport attribute. Unfortunately attributes can't be accessed from IronPython so you will need some stub C# to do this. You can generate the C# dynamically from IronPython. These two articles may help: http://www.voidspace.org.uk/ironpython/winforms/part10.shtml http://www.voidspace.org.uk/ironpython/dynamically_compiling.shtml Michael Foord http://www.manning.com/foord > > Regards > > ------------------------------------------------------------------------ > _Legal Notice:_ > The information in this electronic transmission may contain > confidential or legally privileged information and is intended solely > for the individual(s) named above. If you are not an intended > recipient or an authorized agent, you are hereby notified that > reading, distributing, or otherwise disseminating, copying or taking > any action based on the contents of this transmission is strictly > prohibited. Any unauthorized interception of this transmission is > illegal under law. If you have received this transmission in error, > please notify the sender by telephone [at the number indicated > above/on +41 58 928 0101] as soon as possible and then destroy all > copies of this transmission. > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From vizcaynot at gmail.com Sat Dec 15 01:45:30 2007 From: vizcaynot at gmail.com (Vizcayno) Date: Fri, 14 Dec 2007 16:45:30 -0800 (PST) Subject: [IronPython] A help With an Active Directory DateTime field Message-ID: <43c42113-4c8e-4202-a62c-77951d6e365d@s12g2000prg.googlegroups.com> I am trying to save data into meetingStartTime Active Directory (AD) Field. AD is under a w3k (last SP applied) server. I show you the code: import clr import System clr.AddReferenceByPartialName("System.DirectoryServices") root=System.DirectoryServices.DirectoryEntry() s=System.DirectoryServices.DirectorySearcher() s.Filter = "(samaccountname=gnogales)" r=s.FindOne() entry = r.GetDirectoryEntry() entry.Properties["meetingStartTime"].Value = System.DateTime(1962, 5, 15, 0, 0, 0) entry.CommitChanges() entry.Close() But I have the next error in the commit process: Traceback (most recent call last): File , line 0, in ##232 File , line 0, in _stub_##218 File System.DirectoryServices, line unknown, in CommitChanges EnvironmentError: The requested operation did not satisfy one or more constraints associated with the class of the object. (Exception from HRESULT: 0x80072014) The field in AD is considered as DateTime. I have the same for all Ipy versions. What do you is happending? Thanks!! From vizcaynot at gmail.com Sat Dec 15 01:56:59 2007 From: vizcaynot at gmail.com (Vizcayno) Date: Fri, 14 Dec 2007 16:56:59 -0800 (PST) Subject: [IronPython] Question about Web FrameWorks Message-ID: CPython is to Django, TurboGears, Plone, etc .... Irponpython is to .... which one? Thanks!! From bbcofchina at yahoo.com.cn Sat Dec 15 02:18:42 2007 From: bbcofchina at yahoo.com.cn (=?gb2312?q?<=CE=AB=B7=BB=B7=E7=F3=DD>?=) Date: Sat, 15 Dec 2007 09:18:42 +0800 (CST) Subject: [IronPython] =?gb2312?b?u9i4tKO6ICBRdWVzdGlvbiBhYm91dCBXZWIgRnJh?= =?gb2312?b?bWVXb3Jrcw==?= In-Reply-To: Message-ID: <58614.14781.qm@web15002.mail.cnb.yahoo.com> Ironpython is to asp.net Vizcayno ??? CPython is to Django, TurboGears, Plone, etc .... .... which one? Thanks!! _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com --------------------------------- ?????????????????? -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jimmy.Schementi at microsoft.com Sat Dec 15 03:51:53 2007 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Fri, 14 Dec 2007 18:51:53 -0800 Subject: [IronPython] Question about Web FrameWorks In-Reply-To: References: Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32844CEC58126@NA-EXMSG-C116.redmond.corp.microsoft.com> IronPython is suppose to be able to run Django, TurboGears, and the tons of other web frameworks for Python that are out there. I'm not sure if they work "right out of the box" or not, but that's the idea. If they don't work, please report it on codeplex.com/ironpython In addition, due to IronPython's .NET interoperability and hosting capabilities, it can be used to write ASP.NET applications (with the ASP.NET futures release). ~js -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vizcayno Sent: Friday, December 14, 2007 4:57 PM To: users at lists.ironpython.com Subject: [IronPython] Question about Web FrameWorks CPython is to Django, TurboGears, Plone, etc .... Irponpython is to .... which one? Thanks!! _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Jimmy.Schementi at microsoft.com Sat Dec 15 04:35:39 2007 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Fri, 14 Dec 2007 19:35:39 -0800 Subject: [IronPython] Question about Web FrameWorks In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32844CEC58126@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A32844CEC58126@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32844CECF45F4@NA-EXMSG-C116.redmond.corp.microsoft.com> Just to clarify, reporting that these CPython frameworks don't work in IronPython *may* expose issues with IronPython that we want to fix ... but it could just be a library dependency that doesn't exist in our codeplex drop of IronPython. Regardless, it would be good if you found any to let us know. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jimmy Schementi Sent: Friday, December 14, 2007 6:52 PM To: Discussion of IronPython Subject: Re: [IronPython] Question about Web FrameWorks IronPython is suppose to be able to run Django, TurboGears, and the tons of other web frameworks for Python that are out there. I'm not sure if they work "right out of the box" or not, but that's the idea. If they don't work, please report it on codeplex.com/ironpython In addition, due to IronPython's .NET interoperability and hosting capabilities, it can be used to write ASP.NET applications (with the ASP.NET futures release). ~js -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vizcayno Sent: Friday, December 14, 2007 4:57 PM To: users at lists.ironpython.com Subject: [IronPython] Question about Web FrameWorks CPython is to Django, TurboGears, Plone, etc .... Irponpython is to .... which one? Thanks!! _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From textdirected at gmail.com Sat Dec 15 12:21:29 2007 From: textdirected at gmail.com (HEMMI, Shigeru) Date: Sat, 15 Dec 2007 20:21:29 +0900 Subject: [IronPython] ipy crashes on (MAC OS X Panther 10.3 + IPCE-r7 + mono1.2.6) Message-ID: Hello community, ipy crashes on my (MAC OS X Panther 10.3 + IPCE-r7 + mono1.2.6). $ uname -a Darwin hagi.local 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Power Macintosh powerpc $ mono --version Mono JIT compiler version 1.2.6 (tarball) Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com TLS: normal GC: Included Boehm (with typed GC) SIGSEGV: normal Notification: Thread + polling Architecture: ppc Disabled: none $ pwd /Users/zgzg/IPCE-r7/ipy $ mono ipy.exe Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for IronPython.Modules.Builtin ---> System.ExecutionEngineException: SIGILL at <0x00000> at IronPython.Modules.Builtin..cctor () [0x00000] at IronPython.Modules.Builtin..cctor () [0x00000] --- End of inner exception stack trace --- at <0x00000> at (wrapper managed-to-native) System.Reflection.MonoField:GetValueInternal (object) at System.Reflection.MonoField.GetValue (System.Object obj) [0x00000] at IronPython.Runtime.Types.ReflectedField.GetAttribute (System.Object instance, System.Object context) [0x00000] at IronPython.Runtime.Operations.Ops.GetDescriptor (System.Object o, System.Object instance, System.Object context) [0x00000] at IronPython.Runtime.Types.DynamicType.UncheckedGetDescriptor (System.Object o, System.Object instance, System.Object context) [0x00000] at IronPython.Runtime.Types.DynamicType.TryBaseGetAttr (ICallerContext context, System.Object self, SymbolId name, System.Object& ret) [0x00000] at IronPython.Runtime.Types.ReflectedType.TryGetAttr (ICallerContext context, System.Object self, SymbolId name, System.Object& ret) [0x00000] at IronPython.Runtime.Types.DynamicType.GetAttr (ICallerContext context, System.Object self, SymbolId name) [0x00000] at IronPython.Runtime.Importer.MakePythonModule (IronPython.Runtime.SystemState state, System.String name, IronPython.Runtime.Types.ReflectedType type) [0x00000] at IronPython.Runtime.SystemState.Initialize () [0x00000] at IronPython.Runtime.SystemState..ctor (IronPython.Hosting.EngineOptions options) [0x00000] at IronPython.Hosting.PythonEngine.Initialize (IronPython.Hosting.EngineOptions engineOptions) [0x00000] at IronPython.Hosting.PythonEngine..ctor (IronPython.Hosting.EngineOptions engineOptions) [0x00000] at IronPythonConsole.PythonCommandLine.Main (System.String[] rawArgs) [0x00000] Can anybody help me? Thanks in advance. From textdirected at gmail.com Sat Dec 15 23:48:15 2007 From: textdirected at gmail.com (HEMMI, Shigeru) Date: Sun, 16 Dec 2007 07:48:15 +0900 Subject: [IronPython] ipy crashes on (MAC OS X Panther 10.3 + IPCE-r7 + mono1.2.6) In-Reply-To: References: Message-ID: I will cancel the post below to IronPython ML. The cause of crash is MAC OS X Panther 10.3 + mono1.2.6. Sorry for my disturbance. 2007/12/15, HEMMI, Shigeru : > Hello community, > > ipy crashes on my (MAC OS X Panther 10.3 + IPCE-r7 + mono1.2.6). > > $ uname -a > Darwin hagi.local 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 > 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Power > Macintosh powerpc > > $ mono --version > Mono JIT compiler version 1.2.6 (tarball) > Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com > TLS: normal > GC: Included Boehm (with typed GC) > SIGSEGV: normal > Notification: Thread + polling > Architecture: ppc > Disabled: none > > $ pwd > /Users/zgzg/IPCE-r7/ipy > > $ mono ipy.exe > > Unhandled Exception: System.TypeInitializationException: An exception > was thrown by the type initializer for IronPython.Modules.Builtin ---> > System.ExecutionEngineException: SIGILL > at <0x00000> > at IronPython.Modules.Builtin..cctor () [0x00000] > at IronPython.Modules.Builtin..cctor () [0x00000] --- End of inner > exception stack trace --- > > at <0x00000> > at (wrapper managed-to-native) > System.Reflection.MonoField:GetValueInternal (object) > at System.Reflection.MonoField.GetValue (System.Object obj) [0x00000] > at IronPython.Runtime.Types.ReflectedField.GetAttribute > (System.Object instance, System.Object context) [0x00000] > at IronPython.Runtime.Operations.Ops.GetDescriptor (System.Object o, > System.Object instance, System.Object context) [0x00000] > at IronPython.Runtime.Types.DynamicType.UncheckedGetDescriptor > (System.Object o, System.Object instance, System.Object context) > [0x00000] > at IronPython.Runtime.Types.DynamicType.TryBaseGetAttr > (ICallerContext context, System.Object self, SymbolId name, > System.Object& ret) [0x00000] > at IronPython.Runtime.Types.ReflectedType.TryGetAttr (ICallerContext > context, System.Object self, SymbolId name, System.Object& ret) > [0x00000] > at IronPython.Runtime.Types.DynamicType.GetAttr (ICallerContext > context, System.Object self, SymbolId name) [0x00000] > at IronPython.Runtime.Importer.MakePythonModule > (IronPython.Runtime.SystemState state, System.String name, > IronPython.Runtime.Types.ReflectedType type) [0x00000] > at IronPython.Runtime.SystemState.Initialize () [0x00000] > at IronPython.Runtime.SystemState..ctor > (IronPython.Hosting.EngineOptions options) [0x00000] > at IronPython.Hosting.PythonEngine.Initialize > (IronPython.Hosting.EngineOptions engineOptions) [0x00000] > at IronPython.Hosting.PythonEngine..ctor > (IronPython.Hosting.EngineOptions engineOptions) [0x00000] > at IronPythonConsole.PythonCommandLine.Main (System.String[] > rawArgs) [0x00000] > > Can anybody help me? > Thanks in advance. > From vizcaynot at gmail.com Mon Dec 17 02:22:15 2007 From: vizcaynot at gmail.com (Vizcayno) Date: Sun, 16 Dec 2007 17:22:15 -0800 (PST) Subject: [IronPython] Question about Web FrameWorks In-Reply-To: <5283CA0A4168DF4FBBD71AE9ECA5A32844CECF45F4@NA-EXMSG-C116.redmond.corp.microsoft.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A32844CEC58126@NA-EXMSG-C116.redmond.corp.microsoft.com> <5283CA0A4168DF4FBBD71AE9ECA5A32844CECF45F4@NA-EXMSG-C116.redmond.corp.microsoft.com> Message-ID: <39595566-aa93-44b1-9eb8-b6e623a39336@s19g2000prg.googlegroups.com> On 14 dic, 23:35, Jimmy Schementi wrote: > Just to clarify, reporting that these CPython frameworks don't work in IronPython *may* expose issues with IronPython that we want to fix ... but it could just be a library dependency that doesn't exist in our codeplex drop of IronPython. Regardless, it would be good if you found any to let us know. > Jimmy: Thanks for your attention. I have the first library where I have troubles when trying to test Django: the module pyexpat Regards. From sanxiyn at gmail.com Mon Dec 17 02:43:28 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 17 Dec 2007 10:43:28 +0900 Subject: [IronPython] Question about Web FrameWorks In-Reply-To: <39595566-aa93-44b1-9eb8-b6e623a39336@s19g2000prg.googlegroups.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A32844CEC58126@NA-EXMSG-C116.redmond.corp.microsoft.com> <5283CA0A4168DF4FBBD71AE9ECA5A32844CECF45F4@NA-EXMSG-C116.redmond.corp.microsoft.com> <39595566-aa93-44b1-9eb8-b6e623a39336@s19g2000prg.googlegroups.com> Message-ID: <5b0248170712161743m3fb2418agc421e037ba50b666@mail.gmail.com> 2007/12/17, Vizcayno : > Jimmy: Thanks for your attention. I have the first library where I > have troubles when trying to test Django: the module pyexpat > Regards. IronPython port of CPython pyexpat is available here: https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/lib/pyexpat.py In general, many issues you will meet is often resolved in FePy. http://fepy.sourceforge.net/ -- Seo Sanghyeon From slide.o.mix at gmail.com Mon Dec 17 02:52:03 2007 From: slide.o.mix at gmail.com (Slide) Date: Sun, 16 Dec 2007 18:52:03 -0700 Subject: [IronPython] IP 2.0 Hosting In-Reply-To: References: Message-ID: I am at a huge loss trying to figure out hosting IP 2.0 in my C# application to provide scripting capabilities to my app. Does ANYONE have an example of this? I tried grabbing the document listed in a post a little while ago, but the class names in the document don't match anything I have in the package I downloaded. I'm looking for the ability to have a class in Python inherit (implement) an interface defined in C# and then create an instance of that class for use from the C#. thanks slide From antont at kyperjokki.fi Mon Dec 17 10:03:57 2007 From: antont at kyperjokki.fi (Toni Alatalo) Date: Mon, 17 Dec 2007 11:03:57 +0200 Subject: [IronPython] IP 2.0 Hosting In-Reply-To: References: Message-ID: <200712171103.58307.antont@kyperjokki.fi> On Monday 17 December 2007 03:52:03 Slide wrote: > I am at a huge loss trying to figure out hosting IP 2.0 in my C# > application to provide scripting capabilities to my app. Does ANYONE > have an example of this? I tried grabbing the document listed in a > post a little while ago, but the class names in the document don't > match anything I have in the package I downloaded. I'm looking for the I have done it for two systems now. Apparently that document is not about the implementation in the 2.0 alphas, but I've guessed that of a plan for the next step. The embeddings I made were actually done before that document was sent, and I just mostly did trial-and-error based on the method names and signatures etc. Don't have the code here now, but unless someone sends something soon can put something together later today (in 6 hours or so) .. it's simple, nothing special there. > ability to have a class in Python inherit (implement) an interface > defined in C# and then create an instance of that class for use from > the C#. Python uses 'duck typing', so to implement an interface you just implement it, i.e. define the class so that it has the methods that the interface requires. I actually don't know if that is the case when giving objects to c#-written code that expects something that implements a certain interface, but based on how I've used delegates my guess is that no extra syntax is needed. For example if there is a delegate type MyDelegate(int i); defined in c#, a normal Python function that takes 1 argument is accepted (ironpython/dlr/something seems to introspect the definition somehow at runtime and raises an error if the signature does not match). I have not yet found a way to expose selected c#-written classes (or interfaces) to the embedded Python context - have tried many things with the context and module etc. creation methods that are there in 2.0 alphas with no luck. What works, and what I've resorted to currently, is just adding references to the dlls also on the Python side, and importing the modules/classes in Python. Typechecking of objects created from those assemblies seems to work back on the c#-written side as long as the path from where you loaded the dll is exactly the same. With 1.1 it is possible to use the LoadAssembly command to make already loaded assemblies from c# to show in the Python side. I am guessing that the 2.x series will have something similar using the runtime objects or what was it that is mentioned in that document, but there was no detailed info of that in the doc yet and I have not found any implementation of it either (i have not checked out stuff from codeplex repo though, just used alpha releases). > slide ~Toni From Sathish.Kaveripakam at phonak.com Mon Dec 17 13:05:57 2007 From: Sathish.Kaveripakam at phonak.com (Kaveripakam, Sathish) Date: Mon, 17 Dec 2007 13:05:57 +0100 Subject: [IronPython] Null pointer passing Message-ID: HI All, I am trying to call Windows CreateFile function from iron Python. I have a dll (c# dll , which has "extern entry" to Create File and I am importing Kernel32.dll). The problem is, when I am trying to pass the arguments, which is of null type, I used "None" in the iron python. But during execution, I get an error saying that "Expected IntPtr but got NoneType". Could you please let me know, if I am missing something, which is primitive . Iron python Call: x = Win_dll.CreateFile( '\\\\.\\TEST\\test', GENERIC_READ|GENERIC_WRITE , FILE_SHARE_READ|FILE_SHARE_WRITE, None, OPEN_EXISTING, FILE_FLAG_WRITE_THROUGH, None ) public class Win_dll{ [DllImport("Kernel32.dll")] public static extern IntPtr CreateFile( string FileName, uint DesiredAccess, uint ShareMode,IntPtr SecurityAttributes,uint CreationDisposition,uint FlagsAndAttributes,IntPtr TemplateFile); }} ******************** Legal Notice: The information in this electronic transmission may contain confidential or legally privileged information and is intended solely for the individual(s) named above. If you are not an intended recipient or an authorized agent, you are hereby notified that reading, distributing, or otherwise disseminating, copying or taking any action based on the contents of this transmission is strictly prohibited. Any unauthorized interception of this transmission is illegal under law. If you have received this transmission in error, please notify the sender by telephone [at the number indicated above/ on +41 58 928 0101] as soon as possible and then destroy all copies of this transmission. ******************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Dec 17 13:25:52 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 17 Dec 2007 12:25:52 +0000 Subject: [IronPython] Null pointer passing In-Reply-To: References: Message-ID: <47666AD0.1000408@voidspace.org.uk> Try IntPtr.Zero Michael http://www.manning.com/foord Kaveripakam, Sathish wrote: > HI All, > > I am trying to call Windows CreateFile function from iron Python. I > have a dll (c# dll , which has "extern entry" to Create File and I am > importing Kernel32.dll). The problem is, when I am trying to pass the > arguments, which is of null type, I used "None" in the iron python. > But during execution, I get an error saying that "Expected IntPtr but > got NoneType". > > Could you please let me know, if I am missing something, which is > primitive . > > > *Iron python Call:* > > x = Win_dll.CreateFile( '\\\\.\\TEST\\test', > GENERIC_READ|GENERIC_WRITE , > FILE_SHARE_READ|FILE_SHARE_WRITE, > None, > OPEN_EXISTING, > FILE_FLAG_WRITE_THROUGH, > None > ) > > > public class Win_dll{ > > [DllImport("Kernel32.dll")] > > public static extern IntPtr CreateFile( string > FileName, uint DesiredAccess, uint ShareMode,IntPtr > SecurityAttributes,uint CreationDisposition,uint > FlagsAndAttributes,IntPtr TemplateFile); > > }} > > ------------------------------------------------------------------------ > _Legal Notice:_ > The information in this electronic transmission may contain > confidential or legally privileged information and is intended solely > for the individual(s) named above. If you are not an intended > recipient or an authorized agent, you are hereby notified that > reading, distributing, or otherwise disseminating, copying or taking > any action based on the contents of this transmission is strictly > prohibited. Any unauthorized interception of this transmission is > illegal under law. If you have received this transmission in error, > please notify the sender by telephone [at the number indicated > above/on +41 58 928 0101] as soon as possible and then destroy all > copies of this transmission. > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From Sathish.Kaveripakam at phonak.com Mon Dec 17 13:43:37 2007 From: Sathish.Kaveripakam at phonak.com (Kaveripakam, Sathish) Date: Mon, 17 Dec 2007 13:43:37 +0100 Subject: [IronPython] Null pointer passing In-Reply-To: <47666AD0.1000408@voidspace.org.uk> References: <47666AD0.1000408@voidspace.org.uk> Message-ID: I tried using "IntPtr.Zero", but doesnt seems to work. During execution, it complains "name IntPtr not defined". I am using Iron python 1.1 version and also I have a link to the system path, to pick the Iron path Stub libraries (ie FEPY project). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Montag, 17. Dezember 2007 13:26 To: Discussion of IronPython Subject: Re: [IronPython] Null pointer passing Try IntPtr.Zero Michael http://www.manning.com/foord Kaveripakam, Sathish wrote: > HI All, > > I am trying to call Windows CreateFile function from iron Python. I > have a dll (c# dll , which has "extern entry" to Create File and I am > importing Kernel32.dll). The problem is, when I am trying to pass the > arguments, which is of null type, I used "None" in the iron python. > But during execution, I get an error saying that "Expected IntPtr but > got NoneType". > > Could you please let me know, if I am missing something, which is > primitive . > > > *Iron python Call:* > > x = Win_dll.CreateFile( '\\\\.\\TEST\\test', > GENERIC_READ|GENERIC_WRITE , > FILE_SHARE_READ|FILE_SHARE_WRITE, > None, > OPEN_EXISTING, > FILE_FLAG_WRITE_THROUGH, > None > ) > > > public class Win_dll{ > > [DllImport("Kernel32.dll")] > > public static extern IntPtr CreateFile( string > FileName, uint DesiredAccess, uint ShareMode,IntPtr > SecurityAttributes,uint CreationDisposition,uint > FlagsAndAttributes,IntPtr TemplateFile); > > }} > > ---------------------------------------------------------------------- > -- > _Legal Notice:_ > The information in this electronic transmission may contain > confidential or legally privileged information and is intended solely > for the individual(s) named above. If you are not an intended > recipient or an authorized agent, you are hereby notified that > reading, distributing, or otherwise disseminating, copying or taking > any action based on the contents of this transmission is strictly > prohibited. Any unauthorized interception of this transmission is > illegal under law. If you have received this transmission in error, > please notify the sender by telephone [at the number indicated > above/on +41 58 928 0101] as soon as possible and then destroy all > copies of this transmission. > ---------------------------------------------------------------------- > -- > > ---------------------------------------------------------------------- > -- > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ******************** Legal Notice: The information in this electronic transmission may contain confidential or legally privileged information and is intended solely for the individual(s) named above. If you are not an intended recipient or an authorized agent, you are hereby notified that reading, distributing, or otherwise disseminating, copying or taking any action based on the contents of this transmission is strictly prohibited. Any unauthorized interception of this transmission is illegal under law. If you have received this transmission in error, please notify the sender by telephone [at the number indicated above/ on +41 58 928 0101] as soon as possible and then destroy all copies of this transmission. ******************** From Sathish.Kaveripakam at phonak.com Mon Dec 17 13:46:05 2007 From: Sathish.Kaveripakam at phonak.com (Kaveripakam, Sathish) Date: Mon, 17 Dec 2007 13:46:05 +0100 Subject: [IronPython] Null pointer passing References: <47666AD0.1000408@voidspace.org.uk> Message-ID: got it working..forget about my last message Thanks -----Original Message----- From: Kaveripakam, Sathish Sent: Montag, 17. Dezember 2007 13:44 To: 'Discussion of IronPython' Subject: RE: [IronPython] Null pointer passing I tried using "IntPtr.Zero", but doesnt seems to work. During execution, it complains "name IntPtr not defined". I am using Iron python 1.1 version and also I have a link to the system path, to pick the Iron path Stub libraries (ie FEPY project). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Montag, 17. Dezember 2007 13:26 To: Discussion of IronPython Subject: Re: [IronPython] Null pointer passing Try IntPtr.Zero Michael http://www.manning.com/foord Kaveripakam, Sathish wrote: > HI All, > > I am trying to call Windows CreateFile function from iron Python. I > have a dll (c# dll , which has "extern entry" to Create File and I am > importing Kernel32.dll). The problem is, when I am trying to pass the > arguments, which is of null type, I used "None" in the iron python. > But during execution, I get an error saying that "Expected IntPtr but > got NoneType". > > Could you please let me know, if I am missing something, which is > primitive . > > > *Iron python Call:* > > x = Win_dll.CreateFile( '\\\\.\\TEST\\test', > GENERIC_READ|GENERIC_WRITE , > FILE_SHARE_READ|FILE_SHARE_WRITE, > None, > OPEN_EXISTING, > FILE_FLAG_WRITE_THROUGH, > None > ) > > > public class Win_dll{ > > [DllImport("Kernel32.dll")] > > public static extern IntPtr CreateFile( string > FileName, uint DesiredAccess, uint ShareMode,IntPtr > SecurityAttributes,uint CreationDisposition,uint > FlagsAndAttributes,IntPtr TemplateFile); > > }} > > ---------------------------------------------------------------------- > -- > _Legal Notice:_ > The information in this electronic transmission may contain > confidential or legally privileged information and is intended solely > for the individual(s) named above. If you are not an intended > recipient or an authorized agent, you are hereby notified that > reading, distributing, or otherwise disseminating, copying or taking > any action based on the contents of this transmission is strictly > prohibited. Any unauthorized interception of this transmission is > illegal under law. If you have received this transmission in error, > please notify the sender by telephone [at the number indicated > above/on +41 58 928 0101] as soon as possible and then destroy all > copies of this transmission. > ---------------------------------------------------------------------- > -- > > ---------------------------------------------------------------------- > -- > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ******************** Legal Notice: The information in this electronic transmission may contain confidential or legally privileged information and is intended solely for the individual(s) named above. If you are not an intended recipient or an authorized agent, you are hereby notified that reading, distributing, or otherwise disseminating, copying or taking any action based on the contents of this transmission is strictly prohibited. Any unauthorized interception of this transmission is illegal under law. If you have received this transmission in error, please notify the sender by telephone [at the number indicated above/ on +41 58 928 0101] as soon as possible and then destroy all copies of this transmission. ******************** From slide.o.mix at gmail.com Mon Dec 17 17:40:19 2007 From: slide.o.mix at gmail.com (Slide) Date: Mon, 17 Dec 2007 09:40:19 -0700 Subject: [IronPython] IP 2.0 Hosting In-Reply-To: <200712171103.58307.antont@kyperjokki.fi> References: <200712171103.58307.antont@kyperjokki.fi> Message-ID: On Dec 17, 2007 2:03 AM, Toni Alatalo wrote: > > I have done it for two systems now. > > Apparently that document is not about the implementation in the 2.0 alphas, > but I've guessed that of a plan for the next step. > > The embeddings I made were actually done before that document was sent, and I > just mostly did trial-and-error based on the method names and signatures etc. > Don't have the code here now, but unless someone sends something soon can put > something together later today (in 6 hours or so) .. it's simple, nothing > special there. > It would be great to see some example code. Thanks! slide From dinov at exchange.microsoft.com Mon Dec 17 17:48:17 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 17 Dec 2007 08:48:17 -0800 Subject: [IronPython] IP 2.0 Hosting In-Reply-To: <200712171103.58307.antont@kyperjokki.fi> References: <200712171103.58307.antont@kyperjokki.fi> Message-ID: <7AD436E4270DD54A94238001769C2227F41C65E4EC@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Yes, the document is not yet up to date - we're currently working on implementing it so the next release will probably have some of it, and subsequence releases will have the whole thing. For giving objects to C# code you need to derive from the interface (and implement the methods). If you fail to implement any methods we'll throw at runtime when that method is called. For exposing classes/namespaces/etc... I think we may have a deficiency here even in the new model. While we do have a global namespace per ScriptRuntime I don't believe we have a way to say "populate this with these types/namespaces". I'll bring this up next time we're going over the spec internally. Here's some simple code you can give a shot to get started. I don't have anything comprehensive, this is just what I pulled from EngineTest.cs which if you get the IronPython source code is in IronPythonTest. I imagine whatever Toni can post will be more useful :). using IronPython.Runtime.Hosting; using Microsoft.Scripting; ... PythonEngine pe = PythonEngine.CurrentEngine; pe.Execute(script); # where script is a string w/ some code in it. This runs in the DefaultModule which is: IScriptModule default_module = ScriptDomainManager.CurrentManager.Host.DefaultModule; You can also do: pe.Execute("x = 1", anonymousModule); You can create new modules via: ScriptModule publishedModule = pe.CreateModule("published_context_test", ModuleOptions.PublishModule); -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Toni Alatalo Sent: Monday, December 17, 2007 1:04 AM To: users at lists.ironpython.com Subject: Re: [IronPython] IP 2.0 Hosting On Monday 17 December 2007 03:52:03 Slide wrote: > I am at a huge loss trying to figure out hosting IP 2.0 in my C# > application to provide scripting capabilities to my app. Does ANYONE > have an example of this? I tried grabbing the document listed in a > post a little while ago, but the class names in the document don't > match anything I have in the package I downloaded. I'm looking for the I have done it for two systems now. Apparently that document is not about the implementation in the 2.0 alphas, but I've guessed that of a plan for the next step. The embeddings I made were actually done before that document was sent, and I just mostly did trial-and-error based on the method names and signatures etc. Don't have the code here now, but unless someone sends something soon can put something together later today (in 6 hours or so) .. it's simple, nothing special there. > ability to have a class in Python inherit (implement) an interface > defined in C# and then create an instance of that class for use from > the C#. Python uses 'duck typing', so to implement an interface you just implement it, i.e. define the class so that it has the methods that the interface requires. I actually don't know if that is the case when giving objects to c#-written code that expects something that implements a certain interface, but based on how I've used delegates my guess is that no extra syntax is needed. For example if there is a delegate type MyDelegate(int i); defined in c#, a normal Python function that takes 1 argument is accepted (ironpython/dlr/something seems to introspect the definition somehow at runtime and raises an error if the signature does not match). I have not yet found a way to expose selected c#-written classes (or interfaces) to the embedded Python context - have tried many things with the context and module etc. creation methods that are there in 2.0 alphas with no luck. What works, and what I've resorted to currently, is just adding references to the dlls also on the Python side, and importing the modules/classes in Python. Typechecking of objects created from those assemblies seems to work back on the c#-written side as long as the path from where you loaded the dll is exactly the same. With 1.1 it is possible to use the LoadAssembly command to make already loaded assemblies from c# to show in the Python side. I am guessing that the 2.x series will have something similar using the runtime objects or what was it that is mentioned in that document, but there was no detailed info of that in the doc yet and I have not found any implementation of it either (i have not checked out stuff from codeplex repo though, just used alpha releases). > slide ~Toni _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From slide.o.mix at gmail.com Mon Dec 17 21:38:01 2007 From: slide.o.mix at gmail.com (Slide) Date: Mon, 17 Dec 2007 13:38:01 -0700 Subject: [IronPython] IP 2.0 Hosting In-Reply-To: <7AD436E4270DD54A94238001769C2227F41C65E4EC@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <200712171103.58307.antont@kyperjokki.fi> <7AD436E4270DD54A94238001769C2227F41C65E4EC@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On Dec 17, 2007 9:48 AM, Dino Viehland wrote: > Yes, the document is not yet up to date - we're currently working on implementing it so the next release will probably have some of it, and subsequence releases will have the whole thing. > > For giving objects to C# code you need to derive from the interface (and implement the methods). If you fail to implement any methods we'll throw at runtime when that method is called. > > For exposing classes/namespaces/etc... I think we may have a deficiency here even in the new model. While we do have a global namespace per ScriptRuntime I don't believe we have a way to say "populate this with these types/namespaces". I'll bring this up next time we're going over the spec internally. > > Here's some simple code you can give a shot to get started. I don't have anything comprehensive, this is just what I pulled from EngineTest.cs which if you get the IronPython source code is in IronPythonTest. I imagine whatever Toni can post will be more useful :). > > using IronPython.Runtime.Hosting; > using Microsoft.Scripting; > ... > > PythonEngine pe = PythonEngine.CurrentEngine; > > pe.Execute(script); # where script is a string w/ some code in it. This runs in the DefaultModule which is: > > IScriptModule default_module = ScriptDomainManager.CurrentManager.Host.DefaultModule; > > You can also do: > > pe.Execute("x = 1", anonymousModule); > > You can create new modules via: > > ScriptModule publishedModule = pe.CreateModule("published_context_test", ModuleOptions.PublishModule); > > Can you give some quick examples of how to import modules from C#? I am having issues with import exceptions when I try to do things. The path to the module is definitely within the sys.path, but I get all sorts of errors. Here is a snippet of my code: _script_engine.AddToPath(Path.GetDirectoryName(_scriptPath)); _script_engine.AddToPath(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)); _script_engine.AddToPath(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "Lib")); foreach (string assembly in _assemblies) _script_engine.SystemState.ClrModule.AddReferenceByPartialName(Path.GetFileNameWithoutExtension(assembly)); foreach (KeyValuePair obj in _objects) __main__.SetVariable(obj.Key, obj.Value); _script_engine.SystemState.prefix = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); _script_engine.Execute("import ScriptHelper"); _script_engine.Execute(string.Format("import {0} as Config", Path.GetFileNameWithoutExtension(_scriptPath))); ScriptHelper.py is just a set of simple python functions for grabbing information about loaded modules, etc. It resides in the current working directory (same as the EntryAssembly.Location). My problem comes from something inside the script (which is written to a temp file by the UI in my simple test app) importing something (which has been added using the ClrModule.AddReferenceByPartialName). I get a 'Script' is not defined (with Script being a DLL in the working directory which has been added as a reference). THanks From vizcaynot at gmail.com Mon Dec 17 23:02:46 2007 From: vizcaynot at gmail.com (Vizcayno) Date: Mon, 17 Dec 2007 14:02:46 -0800 (PST) Subject: [IronPython] Question about Web FrameWorks In-Reply-To: <5b0248170712161743m3fb2418agc421e037ba50b666@mail.gmail.com> References: <5283CA0A4168DF4FBBD71AE9ECA5A32844CEC58126@NA-EXMSG-C116.redmond.corp.microsoft.com> <5283CA0A4168DF4FBBD71AE9ECA5A32844CECF45F4@NA-EXMSG-C116.redmond.corp.microsoft.com> <39595566-aa93-44b1-9eb8-b6e623a39336@s19g2000prg.googlegroups.com> <5b0248170712161743m3fb2418agc421e037ba50b666@mail.gmail.com> Message-ID: <77d9a6b3-12f9-4ce2-9c37-9eb54da063dd@e25g2000prg.googlegroups.com> Seo: Thanks for your indications. I downloaded the last version (7) of FePy and began to use. When trying to import the template library from Django, I get next error: >>> from django.template import Template Traceback (most recent call last): File , line 0, in ##243 File , line 0, in _stub_##2 File c:\os\ipy\django_src\django\template\__init__.py, line 53, in Initialize File , line 0, in _stub_##2 File c:\os\ipy\django_src\django\conf\__init__.py, line 11, in Initialize File , line 0, in _stub_##2 File c:\os\ipy\django_src\django\conf\global_settings.py, line 254, in Initialize File c:\os\ipy\django_src\django\__init__.py, line 8, in get_version File c:\os\ipy\django_src\django\utils\version.py, line 34, in get_svn_revision File c:\os\ipy\lib\xml\dom\minidom.py, line 1915, in parse File c:\os\ipy\lib\xml\dom\expatbuilder.py, line 924, in parse File c:\os\ipy\lib\xml\dom\expatbuilder.py, line 213, in parseFile TypeError: None is not enumerable The error happens into the fragment of next "expatbuilder.py" code: def parseFile(self, file): """Parse a document from a file object, returning the document node.""" parser = self.getParser() first_buffer = True try: while 1: buffer = file.read(16*1024) if not buffer: break parser.Parse(buffer, 0) if first_buffer and self.document.documentElement: self._setup_subset(buffer) first_buffer = False parser.Parse("", True) <-------- "The error occurs here" except ParseEscape: pass doc = self.document self.reset() self._parser = None return doc I am using the ipy 2.0A6. Regards. Vizcayno. From dinov at exchange.microsoft.com Mon Dec 17 23:38:28 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 17 Dec 2007 14:38:28 -0800 Subject: [IronPython] IP 2.0 Hosting In-Reply-To: References: <200712171103.58307.antont@kyperjokki.fi> <7AD436E4270DD54A94238001769C2227F41C65E4EC@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227F41C65E614@DF-GRTDANE-MSG.exchange.corp.microsoft.com> My guess here would be that Script is the DLL name but it doesn't include a namespace named Script. One fairly common issue is that AddReference add's references to the assembly, but import imports types and namespaces from the loaded assemblies. So if the type doesn't have a namespace you should just import TypeName, and if it's in a namespace then you should import Namespace. Respond back if that's not the problem. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Slide Sent: Monday, December 17, 2007 12:38 PM To: Discussion of IronPython Subject: Re: [IronPython] IP 2.0 Hosting On Dec 17, 2007 9:48 AM, Dino Viehland wrote: > Yes, the document is not yet up to date - we're currently working on implementing it so the next release will probably have some of it, and subsequence releases will have the whole thing. > > For giving objects to C# code you need to derive from the interface (and implement the methods). If you fail to implement any methods we'll throw at runtime when that method is called. > > For exposing classes/namespaces/etc... I think we may have a deficiency here even in the new model. While we do have a global namespace per ScriptRuntime I don't believe we have a way to say "populate this with these types/namespaces". I'll bring this up next time we're going over the spec internally. > > Here's some simple code you can give a shot to get started. I don't have anything comprehensive, this is just what I pulled from EngineTest.cs which if you get the IronPython source code is in IronPythonTest. I imagine whatever Toni can post will be more useful :). > > using IronPython.Runtime.Hosting; > using Microsoft.Scripting; > ... > > PythonEngine pe = PythonEngine.CurrentEngine; > > pe.Execute(script); # where script is a string w/ some code in it. This runs in the DefaultModule which is: > > IScriptModule default_module = ScriptDomainManager.CurrentManager.Host.DefaultModule; > > You can also do: > > pe.Execute("x = 1", anonymousModule); > > You can create new modules via: > > ScriptModule publishedModule = pe.CreateModule("published_context_test", ModuleOptions.PublishModule); > > Can you give some quick examples of how to import modules from C#? I am having issues with import exceptions when I try to do things. The path to the module is definitely within the sys.path, but I get all sorts of errors. Here is a snippet of my code: _script_engine.AddToPath(Path.GetDirectoryName(_scriptPath)); _script_engine.AddToPath(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location)); _script_engine.AddToPath(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "Lib")); foreach (string assembly in _assemblies) _script_engine.SystemState.ClrModule.AddReferenceByPartialName(Path.GetFileNameWithoutExtension(assembly)); foreach (KeyValuePair obj in _objects) __main__.SetVariable(obj.Key, obj.Value); _script_engine.SystemState.prefix = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); _script_engine.Execute("import ScriptHelper"); _script_engine.Execute(string.Format("import {0} as Config", Path.GetFileNameWithoutExtension(_scriptPath))); ScriptHelper.py is just a set of simple python functions for grabbing information about loaded modules, etc. It resides in the current working directory (same as the EntryAssembly.Location). My problem comes from something inside the script (which is written to a temp file by the UI in my simple test app) importing something (which has been added using the ClrModule.AddReferenceByPartialName). I get a 'Script' is not defined (with Script being a DLL in the working directory which has been added as a reference). THanks _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Dec 18 00:09:33 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 17 Dec 2007 15:09:33 -0800 Subject: [IronPython] Mailing list vs. Web discussions on CodePlex In-Reply-To: <95294eec0712111132q20f30b96o95c41524d249b825@mail.gmail.com> References: <7AD436E4270DD54A94238001769C2227E6D67D688A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <95294eec0712111132q20f30b96o95c41524d249b825@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227F41C65E62A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Thanks everyone for your feedback here - it's been a week, so I'm assuming no one new is going to chime in. For now we can just do nothing which is always a nice resolution! :) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Patrick Dubroy Sent: Tuesday, December 11, 2007 11:32 AM To: Discussion of IronPython Subject: Re: [IronPython] Mailing list vs. Web discussions on CodePlex I also think it would be confusing to have both the mailing list and the forum, considering the traffic is pretty low on the mailing list. Pat On Dec 10, 2007 10:40 PM, Dino Viehland wrote: > > > Just thought I'd collect some opinions here. Internally we discussed this > sometime ago but never made any decisions and haven't done much to push this > forward... On CodePlex we have the ability to enable a discussion forum > (which would look like http://www.codeplex.com/CodePlex/Thread/List.aspx) > where people could post questions, discuss issues, etc... CodePlex is > heavily RSS-enabled so you could also get RSS feeds to track the discussions > in RSS form. There've been some requests on the main page > (http://www.codeplex.com/IronPython) and at least one person who didn't like > the mailing list. > > But obviously we don't want to get rid of the mailing list format - > personally it's the format I prefer (and find the least overhead for > replying). But I've started to use RSS a lot recently so I can certainly > see the appeal there, and maybe others here do as well... Overall my own > personal worry is that we'll be fragmenting the two discussions and actually > hinder some discussion. > > So, thoughts? Should we: > Very easy: > just open the flood gates on the discussions and everyone can go > where they want - let the search engines sort it out! > vs Requires some work: > open up the RSS feed but setup some thread-propagation-bot? > open up the RSS feed but send out regular digests? > vs the unknown: > something completely different? > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From curt at hagenlocher.org Tue Dec 18 00:17:28 2007 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Mon, 17 Dec 2007 15:17:28 -0800 Subject: [IronPython] Mailing list vs. Web discussions on CodePlex In-Reply-To: <7AD436E4270DD54A94238001769C2227F41C65E62A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227E6D67D688A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <95294eec0712111132q20f30b96o95c41524d249b825@mail.gmail.com> <7AD436E4270DD54A94238001769C2227F41C65E62A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On 12/17/07, Dino Viehland wrote: > > Thanks everyone for your feedback here - it's been a week, so I'm > assuming no one new is going to chime in. Just to break your assumption... :) I think it's best to stick with the mailing list. And anyone who posts answers on Codeplex should also direct the questioner to the mailing list for future questions. -- Curt Hagenlocher curt at hagenlocher.org From slide.o.mix at gmail.com Tue Dec 18 00:36:33 2007 From: slide.o.mix at gmail.com (Slide) Date: Mon, 17 Dec 2007 16:36:33 -0700 Subject: [IronPython] IP 2.0 Hosting In-Reply-To: <7AD436E4270DD54A94238001769C2227F41C65E614@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <200712171103.58307.antont@kyperjokki.fi> <7AD436E4270DD54A94238001769C2227F41C65E4EC@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227F41C65E614@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On Dec 17, 2007 3:38 PM, Dino Viehland wrote: > My guess here would be that Script is the DLL name but it doesn't include a namespace named Script. One fairly common issue is that AddReference add's references to the assembly, but import imports types and namespaces from the loaded assemblies. So if the type doesn't have a namespace you should just import TypeName, and if it's in a namespace then you should import Namespace. > > Respond back if that's not the problem. > > I've decided to break this problem down and create a VERY simple embedding example that I can work the kinks out with. I'll reply back with further questions if that doesn't help me out :) Thanks as always for an awesome project. I love IronPython slide From dinov at exchange.microsoft.com Tue Dec 18 01:02:04 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 17 Dec 2007 16:02:04 -0800 Subject: [IronPython] Mailing list vs. Web discussions on CodePlex In-Reply-To: References: <7AD436E4270DD54A94238001769C2227E6D67D688A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <95294eec0712111132q20f30b96o95c41524d249b825@mail.gmail.com> <7AD436E4270DD54A94238001769C2227F41C65E62A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227F41C65E64C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Yep, I agree... I'm actually subscribed to the CodePlex RSS feed so I can respond to those issues and redirect them. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Monday, December 17, 2007 3:17 PM To: Discussion of IronPython Subject: Re: [IronPython] Mailing list vs. Web discussions on CodePlex On 12/17/07, Dino Viehland wrote: > > Thanks everyone for your feedback here - it's been a week, so I'm > assuming no one new is going to chime in. Just to break your assumption... :) I think it's best to stick with the mailing list. And anyone who posts answers on Codeplex should also direct the questioner to the mailing list for future questions. -- Curt Hagenlocher curt at hagenlocher.org _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Dec 18 01:02:33 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 17 Dec 2007 16:02:33 -0800 Subject: [IronPython] IronPython 1.1.1 wish-list? Message-ID: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Are there any particular bugs you'd like to see fixed in IronPython 1.1.1? We're planning on updating the 1.1 release w/ a targeted set of bug fixes. Unfortunately we've started to use the CodePlex bug list to track primarily 2.0 bugs. We can still use this to find the highest ranked bugs that aren't fixed in v1.1 and target those to be back ported - but it's possible we might miss something important. So I'd thought I'd ask: what do you want fixed? Note the idea here is to keep these fixes small and keep the release stable, so please no fix "type(type) is type" :). And of course if you don't know how bad it'll be feel free to suggest it anyway. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Tue Dec 18 01:03:04 2007 From: kfarmer at thuban.org (Keith J. Farmer) Date: Mon, 17 Dec 2007 16:03:04 -0800 Subject: [IronPython] Mailing list vs. Web discussions on CodePlex References: <7AD436E4270DD54A94238001769C2227E6D67D688A@DF-GRTDANE-MSG.exchange.corp.microsoft.com><95294eec0712111132q20f30b96o95c41524d249b825@mail.gmail.com><7AD436E4270DD54A94238001769C2227F41C65E62A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Use IronPython to implement two-way copying of messages between the forums and the mailing list :) You would, of course, have to tackle email message identity. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher Sent: Mon 12/17/2007 3:17 PM To: Discussion of IronPython Subject: Re: [IronPython] Mailing list vs. Web discussions on CodePlex On 12/17/07, Dino Viehland wrote: > > Thanks everyone for your feedback here - it's been a week, so I'm > assuming no one new is going to chime in. Just to break your assumption... :) I think it's best to stick with the mailing list. And anyone who posts answers on Codeplex should also direct the questioner to the mailing list for future questions. -- Curt Hagenlocher curt at hagenlocher.org _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Tue Dec 18 01:18:26 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 17 Dec 2007 16:18:26 -0800 Subject: [IronPython] Mailing list vs. Web discussions on CodePlex In-Reply-To: References: <7AD436E4270DD54A94238001769C2227E6D67D688A@DF-GRTDANE-MSG.exchange.corp.microsoft.com><95294eec0712111132q20f30b96o95c41524d249b825@mail.gmail.com><7AD436E4270DD54A94238001769C2227F41C65E62A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227F41C65E65F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I actually thought that's the direction most people would have liked, but I was happy to be wrong :) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Monday, December 17, 2007 4:03 PM To: Discussion of IronPython; Discussion of IronPython Subject: Re: [IronPython] Mailing list vs. Web discussions on CodePlex Use IronPython to implement two-way copying of messages between the forums and the mailing list :) You would, of course, have to tackle email message identity. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher Sent: Mon 12/17/2007 3:17 PM To: Discussion of IronPython Subject: Re: [IronPython] Mailing list vs. Web discussions on CodePlex On 12/17/07, Dino Viehland wrote: > > Thanks everyone for your feedback here - it's been a week, so I'm > assuming no one new is going to chime in. Just to break your assumption... :) I think it's best to stick with the mailing list. And anyone who posts answers on Codeplex should also direct the questioner to the mailing list for future questions. -- Curt Hagenlocher curt at hagenlocher.org _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From vizcaynot at gmail.com Tue Dec 18 02:53:55 2007 From: vizcaynot at gmail.com (Vizcayno) Date: Mon, 17 Dec 2007 17:53:55 -0800 (PST) Subject: [IronPython] Problems with {field}.__dict__.items() Message-ID: <95a7f3f8-266a-4798-9fe8-dd17f3e74bf2@r29g2000hsg.googlegroups.com> I Cpython I have next code: a='text' b=type(a) print b.__dict__.items() [('upper', ), ('__getslice__', ), 'startswith', ), ('lstrip', ), ('capitalize', method'capitalize' of 'str' objects>), ('__str__', ), ('__getattribute__', ), ('rpartition', ), ('replace', <95294eec0712111132q20f30b96o95c41524d249b825@mail.gmail.com><7AD436E4270DD54A94238001769C2227F41C65E62A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227F41C65E65F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: I prefer mailing lists, personally. I have unified searching in my email app rather than slow, non-unified searching in Yet-another-forums-implementation. I also have a tendency to read email more often than forums (hence my increasing absence on the LINQ forums). ________________________________ From: users-bounces at lists.ironpython.com on behalf of Dino Viehland Sent: Mon 12/17/2007 4:18 PM To: Discussion of IronPython Subject: Re: [IronPython] Mailing list vs. Web discussions on CodePlex I actually thought that's the direction most people would have liked, but I was happy to be wrong :) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer Sent: Monday, December 17, 2007 4:03 PM To: Discussion of IronPython; Discussion of IronPython Subject: Re: [IronPython] Mailing list vs. Web discussions on CodePlex Use IronPython to implement two-way copying of messages between the forums and the mailing list :) You would, of course, have to tackle email message identity. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Curt Hagenlocher Sent: Mon 12/17/2007 3:17 PM To: Discussion of IronPython Subject: Re: [IronPython] Mailing list vs. Web discussions on CodePlex On 12/17/07, Dino Viehland wrote: > > Thanks everyone for your feedback here - it's been a week, so I'm > assuming no one new is going to chime in. Just to break your assumption... :) I think it's best to stick with the mailing list. And anyone who posts answers on Codeplex should also direct the questioner to the mailing list for future questions. -- Curt Hagenlocher curt at hagenlocher.org _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From vizcaynot at gmail.com Tue Dec 18 03:06:23 2007 From: vizcaynot at gmail.com (Vizcayno) Date: Mon, 17 Dec 2007 18:06:23 -0800 (PST) Subject: [IronPython] raw_input seems to hang (for winXP ipy 2.0a6) Message-ID: <1e000933-9f9f-4f6c-b745-9bd990e26169@j20g2000hsi.googlegroups.com> Try this: >>> test_save = raw_input('[T]est [S]ave?: ') [T]est [S]ave?: S No answer is received, it hangs until you repeat typing the Enter key (9 or more times). After that, raw-input behaves in another way: >>> test_save = raw_input('[T]est [S]ave?: ') [T]est [S]ave?: >>> Value of test_save is: >>> test_save '' Regards. From sanxiyn at gmail.com Tue Dec 18 03:22:37 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 18 Dec 2007 11:22:37 +0900 Subject: [IronPython] raw_input seems to hang (for winXP ipy 2.0a6) In-Reply-To: <1e000933-9f9f-4f6c-b745-9bd990e26169@j20g2000hsi.googlegroups.com> References: <1e000933-9f9f-4f6c-b745-9bd990e26169@j20g2000hsi.googlegroups.com> Message-ID: <5b0248170712171822r237b70a6w32092225d1dfe466@mail.gmail.com> 2007/12/18, Vizcayno : > >>> test_save = raw_input('[T]est [S]ave?: ') > [T]est [S]ave?: S > > No answer is received, it hangs until you repeat typing the Enter key > (9 or more times). This works fine for me on Mono/Linux. -- Seo Sanghyeon From sanxiyn at gmail.com Tue Dec 18 04:28:02 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 18 Dec 2007 12:28:02 +0900 Subject: [IronPython] Slice assignment in array Message-ID: <5b0248170712171928k60e1ad6eke148c53b69406267@mail.gmail.com> >>> import clr >>> abc = 'abc'.ToCharArray() >>> cd = 'cd'.ToCharArray() >>> abc[1:] = cd Traceback (most recent call last): ValueError: cannot do slice assignment w/ no step -- Seo Sanghyeon From sanxiyn at gmail.com Tue Dec 18 05:28:51 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 18 Dec 2007 13:28:51 +0900 Subject: [IronPython] File as TextReader Message-ID: <5b0248170712172028h43afbb85i2fb3eb66412f2284@mail.gmail.com> I wrote a short howto on passing Python's file-like objects to .NET API expecting TextReader. http://www.ironpython.info/index.php/File_as_TextReader 1. Does this look okay? It does work. 2. It would be nice if IronPython can provide conversions like these. Another example would be Python datetime and .NET DateTime. Already implemented example is constructing Python file from .NET Stream. What do you think? -- Seo Sanghyeon From antont at kyperjokki.fi Tue Dec 18 09:12:04 2007 From: antont at kyperjokki.fi (Toni Alatalo) Date: Tue, 18 Dec 2007 10:12:04 +0200 Subject: [IronPython] IP 2.0 Hosting In-Reply-To: <7AD436E4270DD54A94238001769C2227F41C65E4EC@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <200712171103.58307.antont@kyperjokki.fi> <7AD436E4270DD54A94238001769C2227F41C65E4EC@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <476780D4.5000003@kyperjokki.fi> Dino Viehland kirjoitti: > For exposing classes/namespaces/etc... I think we may have a deficiency here even in the new model. While we do have a global namespace per ScriptRuntime I don't believe we have a way to say "populate this with these types/namespaces". I'll bring this up next time we're going over the spec internally. > Ok. I am not sure if I actually need to be able to populate the embedded scriptruntime with certain types directly, but certainly being able to expose namespaces there nicely would be good. I guess I'll need to study again / more what the module publishing actually already provides. > IronPython source code is in IronPythonTest. I imagine whatever Toni can post will be more useful :). > using IronPython.Runtime.Hosting; > using Microsoft.Scripting; > PythonEngine pe = PythonEngine.CurrentEngine; > pe.Execute(script); # where script is a string w/ some code in it. This runs in the DefaultModule which is: > IScriptModule default_module = ScriptDomainManager.CurrentManager.Host.DefaultModule; > That is effectively what I do too, otherwise the code just has failed attempts to load assemblies etc. that are now commented out :p ~Toni > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Toni Alatalo > Sent: Monday, December 17, 2007 1:04 AM > To: users at lists.ironpython.com > Subject: Re: [IronPython] IP 2.0 Hosting > > On Monday 17 December 2007 03:52:03 Slide wrote: > >> I am at a huge loss trying to figure out hosting IP 2.0 in my C# >> application to provide scripting capabilities to my app. Does ANYONE >> have an example of this? I tried grabbing the document listed in a >> post a little while ago, but the class names in the document don't >> match anything I have in the package I downloaded. I'm looking for the >> > > I have done it for two systems now. > > Apparently that document is not about the implementation in the 2.0 alphas, > but I've guessed that of a plan for the next step. > > The embeddings I made were actually done before that document was sent, and I > just mostly did trial-and-error based on the method names and signatures etc. > Don't have the code here now, but unless someone sends something soon can put > something together later today (in 6 hours or so) .. it's simple, nothing > special there. > > >> ability to have a class in Python inherit (implement) an interface >> defined in C# and then create an instance of that class for use from >> the C#. >> > > Python uses 'duck typing', so to implement an interface you just implement it, > i.e. define the class so that it has the methods that the interface requires. > I actually don't know if that is the case when giving objects to c#-written > code that expects something that implements a certain interface, but based on > how I've used delegates my guess is that no extra syntax is needed. For > example if there is a delegate type MyDelegate(int i); defined in c#, a > normal Python function that takes 1 argument is accepted > (ironpython/dlr/something seems to introspect the definition somehow at > runtime and raises an error if the signature does not match). > > I have not yet found a way to expose selected c#-written classes (or > interfaces) to the embedded Python context - have tried many things with the > context and module etc. creation methods that are there in 2.0 alphas with no > luck. > > What works, and what I've resorted to currently, is just adding references to > the dlls also on the Python side, and importing the modules/classes in > Python. Typechecking of objects created from those assemblies seems to work > back on the c#-written side as long as the path from where you loaded the dll > is exactly the same. > > With 1.1 it is possible to use the LoadAssembly command to make already loaded > assemblies from c# to show in the Python side. I am guessing that the 2.x > series will have something similar using the runtime objects or what was it > that is mentioned in that document, but there was no detailed info of that in > the doc yet and I have not found any implementation of it either (i have not > checked out stuff from codeplex repo though, just used alpha releases). > > >> slide >> > > ~Toni > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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 kamil at dworakowski.name Tue Dec 18 10:32:01 2007 From: kamil at dworakowski.name (Kamil Dworakowski) Date: Tue, 18 Dec 2007 09:32:01 +0000 Subject: [IronPython] static source2handler mapping causing memory leaks Message-ID: <47679391.20606@dworakowski.name> I think I have found what is a design flaw in implementation of events in IronPython that causes memory leaks. This seems to affect both IP 1.1 and IP 2. As far as I understand the code of IP, there is an instance of ReflectedEvent per event in a class (making it effectively static). This ReflectedEvent object holds a hashtable from source of the event to a handler. This hashtable is of class WeakHash in which keys are weak references but the *values are strong references*. There is a problem only for cases where GC can reach the source (the key) by references starting from the handler (the value). This means that values are keeping the keys alive and they will live happily ever after just for themselves (and all their extended family, meaning the objects that can be reach from them ;). Why not make values of the mapping weak references too? -- Kamil Dworakowski Resolver Systems From kamil at dworakowski.name Tue Dec 18 15:25:40 2007 From: kamil at dworakowski.name (Kamil Dworakowski) Date: Tue, 18 Dec 2007 14:25:40 +0000 Subject: [IronPython] static source2handler mapping causing memory leaks In-Reply-To: <47679391.20606@dworakowski.name> References: <47679391.20606@dworakowski.name> Message-ID: <93fc29d60712180625r536d72f2o95de6bb2a5e8fc8d@mail.gmail.com> > > Why not make values of the mapping weak references too? Weak ref for value is bad because that would allow the handler to be garbage collected even though the sender is alive. That problem is harder than I thought initially. Why not store the subscribers on a list attached to the source object? -- Kamil Dworakowski -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Dec 18 18:27:05 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 18 Dec 2007 09:27:05 -0800 Subject: [IronPython] raw_input seems to hang (for winXP ipy 2.0a6) In-Reply-To: <5b0248170712171822r237b70a6w32092225d1dfe466@mail.gmail.com> References: <1e000933-9f9f-4f6c-b745-9bd990e26169@j20g2000hsi.googlegroups.com> <5b0248170712171822r237b70a6w32092225d1dfe466@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227F41C65E708@DF-GRTDANE-MSG.exchange.corp.microsoft.com> This does repro for me on Vista w/ .NET 3.5. Let me dig into it a little more and see what's going on. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Monday, December 17, 2007 6:23 PM To: Discussion of IronPython Subject: Re: [IronPython] raw_input seems to hang (for winXP ipy 2.0a6) 2007/12/18, Vizcayno : > >>> test_save = raw_input('[T]est [S]ave?: ') > [T]est [S]ave?: S > > No answer is received, it hangs until you repeat typing the Enter key > (9 or more times). This works fine for me on Mono/Linux. -- 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 Dec 18 18:29:38 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 18 Dec 2007 09:29:38 -0800 Subject: [IronPython] Slice assignment in array In-Reply-To: <5b0248170712171928k60e1ad6eke148c53b69406267@mail.gmail.com> References: <5b0248170712171928k60e1ad6eke148c53b69406267@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227F41C65E70A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Thanks for the bug report - I've opened CodePlex bug #14452. I agree this should work. http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=14452 -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Monday, December 17, 2007 7:28 PM To: Discussion of IronPython Subject: [IronPython] Slice assignment in array >>> import clr >>> abc = 'abc'.ToCharArray() >>> cd = 'cd'.ToCharArray() >>> abc[1:] = cd Traceback (most recent call last): ValueError: cannot do slice assignment w/ no step -- 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 Dec 18 18:33:26 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 18 Dec 2007 09:33:26 -0800 Subject: [IronPython] File as TextReader In-Reply-To: <5b0248170712172028h43afbb85i2fb3eb66412f2284@mail.gmail.com> References: <5b0248170712172028h43afbb85i2fb3eb66412f2284@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227F41C65E70B@DF-GRTDANE-MSG.exchange.corp.microsoft.com> This looks ok to me. Everything is either standard Python or standard .NET. The additional conversions also sound like a good idea. We already support a number of conversions to .NET (e.g. things like lists and tuples can turn into List) but we probably just need to go through a lot of types and add implicit or explicit conversions. I could file->text reader being implicit but I think date time needs to be explicit (Python's date time has higher precision than .NET so we'd lose some info). Any other types? I've opened bug #14453 - if anyone can think of other conversions you can either respond here or comment on the bug. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Monday, December 17, 2007 8:29 PM To: Discussion of IronPython Subject: [IronPython] File as TextReader I wrote a short howto on passing Python's file-like objects to .NET API expecting TextReader. http://www.ironpython.info/index.php/File_as_TextReader 1. Does this look okay? It does work. 2. It would be nice if IronPython can provide conversions like these. Another example would be Python datetime and .NET DateTime. Already implemented example is constructing Python file from .NET Stream. What do you think? -- 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 Dec 18 18:46:48 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 18 Dec 2007 09:46:48 -0800 Subject: [IronPython] static source2handler mapping causing memory leaks In-Reply-To: <93fc29d60712180625r536d72f2o95de6bb2a5e8fc8d@mail.gmail.com> References: <47679391.20606@dworakowski.name> <93fc29d60712180625r536d72f2o95de6bb2a5e8fc8d@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227F41C65E713@DF-GRTDANE-MSG.exchange.corp.microsoft.com> If I remember correctly we can't just directly hook the events the 'normal' way because then the unhook fails in certain cases. But it looks like we still have some bugs related to that anyway. I tracked down the original bug and the way this came about was we had code like: >>> class C: ... def cf(self, x): ... print "inside C.F" ... return x ... >>> r = IronPythonTest.ReturnTypes() >>> c = C() >>> r.floatEvent += c.cf >>> r.RunFloat(20) inside C.F 20.0 >>> r.floatEvent -= c.cf >>> r.RunFloat(20) inside C.F 20.0 And before 1.0 beta 3 this was broken. I fixed it by using the WeakHash class. The reason why the above code was broken is because the CLR only does object equality comparisons when unhooking delegates. And each time we have a delegate to 'c.cf' we have a new ReflectedMethod which is bound to the instance - and therefore the instances don't compare as equal and the CLR doesn't think the delegates are the same. Unfortunately we still seem to have some other bugs on CodePlex related to event hooking so I'm guessing this gets another pass before 2.0 is done. I've gone ahead and opened bug #14454 to track it http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=14454. Also, when it comes to WeakHash we actually are aware of this problem in general although we hadn't yet seen it creep into IronPython. We knew it'd be an issue for IronRuby where we have to use the weak hash table much more because you can add to arbitrary objects. We're trying to get some support from the CLR to make this work correctly. So solving the general problem might take a while but hopefully we'll get a chance to at least revisit the event handling code. Thanks for the bug report! From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kamil Dworakowski Sent: Tuesday, December 18, 2007 6:26 AM To: users at lists.ironpython.com Subject: Re: [IronPython] static source2handler mapping causing memory leaks Why not make values of the mapping weak references too? Weak ref for value is bad because that would allow the handler to be garbage collected even though the sender is alive. That problem is harder than I thought initially. Why not store the subscribers on a list attached to the source object? -- Kamil Dworakowski -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Dec 18 19:53:39 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 18 Dec 2007 10:53:39 -0800 Subject: [IronPython] raw_input seems to hang (for winXP ipy 2.0a6) In-Reply-To: <1e000933-9f9f-4f6c-b745-9bd990e26169@j20g2000hsi.googlegroups.com> References: <1e000933-9f9f-4f6c-b745-9bd990e26169@j20g2000hsi.googlegroups.com> Message-ID: <7AD436E4270DD54A94238001769C2227F41C65E73D@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Ok, I've tracked this issue down - and thanks for the bug report (sorry we missed it the 1st time). The problem here is that in PythonTextCRLFReader.ReadBuffer (which is used by PythonFile) we call "ReadBlock" instead of "Read". This causes the input to block until a 20-character buffer is exhausted. On Unix we use PythonTextLFReader which is doing the right thing and calling Read instead of ReadBlock - which explains why this works for Seo. I've opened bug #14457 for this (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=14457) but it'll be fixed shortly. It's too late for the next IronPython release but it should be in the one after that. If you want to work around it you can always re-build IronPython w/ the one line fix. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vizcayno Sent: Monday, December 17, 2007 6:06 PM To: users at lists.ironpython.com Subject: [IronPython] raw_input seems to hang (for winXP ipy 2.0a6) Try this: >>> test_save = raw_input('[T]est [S]ave?: ') [T]est [S]ave?: S No answer is received, it hangs until you repeat typing the Enter key (9 or more times). After that, raw-input behaves in another way: >>> test_save = raw_input('[T]est [S]ave?: ') [T]est [S]ave?: >>> Value of test_save is: >>> test_save '' Regards. _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From joshua.pearce at gmail.com Wed Dec 19 15:51:02 2007 From: joshua.pearce at gmail.com (Joshua J. Pearce) Date: Wed, 19 Dec 2007 09:51:02 -0500 Subject: [IronPython] Application.config In-Reply-To: <174e07690712041715l6f115e8crf08764a1342fc027@mail.gmail.com> References: <278e6e410712041248h2af9e007qe6787e39f751ae1f@mail.gmail.com> <174e07690712041715l6f115e8crf08764a1342fc027@mail.gmail.com> Message-ID: <278e6e410712190651h41188d43p3e78f99904e2b0b5@mail.gmail.com> So I just place a file called, ipy.exe.config in the directory with ipy.exe, and that's it? On Dec 4, 2007 8:15 PM, ? ?? wrote: > ipy.exe.config > > Here is my running very good ipy.exe.config (?????ipy.exe.config ?????) > > > > >
> >
> > > > > > > > > > > > > connectionString="server=localhost;database=ASPNetService;uid=sa;pwd=q1w2e3r4t5;"/> > > > > > > > > defaultUrl="index.aspx " protection="All" timeout="60"/> > > > name="NHSessionModule"/> > > useFullyQualifiedRedirectUrl="true" > executionTimeout="100"/> > > > > > > > > > > > > > > > connectionStringName="AspNetServiceConnectionString" applicationName="Jump" > type=" System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider"/> > > > > > > connectionStringName="AspNetServiceConnectionString" applicationName="Jump" > type="System.Web.Profile.SqlProfileProvider "/> > > > allowAnonymous="false" defaultValue="0"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ?????????????. > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- Joshua Pearce -------------- next part -------------- An HTML attachment was scrubbed... URL: From francois.schnell at gmail.com Wed Dec 19 16:14:11 2007 From: francois.schnell at gmail.com (=?ISO-8859-1?Q?Fran=E7ois_Schnell?=) Date: Wed, 19 Dec 2007 16:14:11 +0100 Subject: [IronPython] Newbie, feedback/question Message-ID: <13a83ca10712190714s743bd4bav6aeb9a2f9c77fec6@mail.gmail.com> Hello guys, I'm a 'regular user' of CPython/WxPython/SPE_IDE and new to IronPython/ Silverlight (also learning Flex/Air). What convinced me to also take some time with IronPython/.Net is the free "Iron Python Studio" and Microsoft move with the Visual Studio Shell: http://www.regdeveloper.co.uk/2007/06/09/vs_shell_eclipse/ Even if WxPython API is fine, it's been a long time I've been hoping for a free "Visual Studio Python Express"-like, with a form designer to quickly develop GUIs in particular. My guess is that with this free (as in beer) IDE, IPY has the potential to attract much more users especially students and hobbyists. I just hope that Iron Python Studio is not just a proof of concept (to show what can be done with the VS Isolated Shell) and that it will be maintained and enhanced. I say that because: - I didn't find any link from Iron Python homepage to the Iron Python Studio - it's been 5 days any developer/coordinator of Iron Python Studio have replied in their discussions section? (unusual for a project just released) Anyway, just a quick feedback from my newbie eye on Iron Python :) * Concerning Tutorials (.html) The tutorial in the download and the samples (link bellow) looks like a great place to start and as a quick reference for examples: http://www.codeplex.com/IronPython/Wiki/View.aspx?title=Samples& referringTitle=Home Unfortunately they are not visible to search-engines, hidden behind save-as, unizip, double-clicks(many times). I can understand the need to zip everything on a projects hosting pate-form but I think the .html(s) pages deserve to be directly visible, Is it possible? (if help is needed to format them for a wiki for example I could help) Also I wonder if a more permissive licence could be used to encourage the use of this content (as opposed to the actual 90 years all-rights-reserved US copyright). For example I might be interested to translate a part in French (my mother tongue) and maybe to extend some examples. I've seen the IP cookbook is under CC-BY (I think it's a great licence for docs) but if it is too much, a CC licence without the Non-Derivative clause would already be useful (for example both MIT Open Course Ware and Open Yale Courses use the CC-BY-NC-SA licence). * Concerning Lists / Discussion I think lists are great for dev. teams but "forums/discussions"-like are more used by 'learners', especially younger people like students (I guess the "edit" link is reassuring). Anyway Iron Python Studio project has the Discussion open. I think beginners will use this place also for IronPython questions. I don't now what is the plan about that but I think it would be nice to keep an eye on this place to help beginners to Iron Python. EDIT: As I was writing this (and waiting for a moderator to let me in the list) a post has been sent in the IronPythonStudio discussion on this: http://www.codeplex.com/IronPythonStudio/Thread/View.aspx?ThreadId=19414 I'm not sure it's the best solution but anyway thanks to Mircosoft for its interest in Python and to the people behind Iron Python :) francois -------------- next part -------------- An HTML attachment was scrubbed... URL: From kfarmer at thuban.org Wed Dec 19 20:09:08 2007 From: kfarmer at thuban.org (Keith J. Farmer) Date: Wed, 19 Dec 2007 11:09:08 -0800 Subject: [IronPython] Newbie, feedback/question References: <13a83ca10712190714s743bd4bav6aeb9a2f9c77fec6@mail.gmail.com> Message-ID: Just to make sure you're aware: people have already started taking their vacations. I don't know if this is the case in this instance, but it's a fairly sure thing that Microsofties will be less present over the next 3 weeks or so. ________________________________ From: users-bounces at lists.ironpython.com on behalf of Fran?ois Schnell Sent: Wed 12/19/2007 7:14 AM To: users at lists.ironpython.com Subject: [IronPython] Newbie, feedback/question - it's been 5 days any developer/coordinator of Iron Python Studio have replied in their discussions section? (unusual for a project just released) From francois.schnell at gmail.com Wed Dec 19 22:42:27 2007 From: francois.schnell at gmail.com (=?ISO-8859-1?Q?Fran=E7ois_Schnell?=) Date: Wed, 19 Dec 2007 22:42:27 +0100 Subject: [IronPython] Newbie, feedback/question In-Reply-To: References: <13a83ca10712190714s743bd4bav6aeb9a2f9c77fec6@mail.gmail.com> Message-ID: <13a83ca10712191342g325b538w4f4a748cf09f0929@mail.gmail.com> On Dec 19, 2007 8:09 PM, Keith J. Farmer wrote: > Just to make sure you're aware: people have already started taking their > vacations. I don't know if this is the case in this instance, but it's a > fairly sure thing that Microsofties will be less present over the next 3 > weeks or so. Ah Ok, thanks for the info Keith. Happy holidays to all. francois > > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of Fran?ois Schnell > Sent: Wed 12/19/2007 7:14 AM > To: users at lists.ironpython.com > Subject: [IronPython] Newbie, feedback/question > > > - it's been 5 days any developer/coordinator of Iron Python Studio have > replied in their discussions section? (unusual for a project just released) > > _______________________________________________ > 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 Kyle.Howland-Rose at aar.com.au Wed Dec 19 23:57:17 2007 From: Kyle.Howland-Rose at aar.com.au (Howland-Rose, Kyle) Date: Thu, 20 Dec 2007 09:57:17 +1100 Subject: [IronPython] Newbie, feedback/question Message-ID: <032584705D18504AAD2498139856C9C6052C956C@SYDEXCVS1.aar.com.au> I have to concur with Fran?ois' request about examples in plain text. Our corporate firewall means I can't see these while at work. ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fran?ois Schnell Sent: Thursday, 20 December 2007 2:14 AM To: users at lists.ironpython.com Subject: [IronPython] Newbie, feedback/question Hello guys, I'm a 'regular user' of CPython/WxPython/SPE_IDE and new to IronPython/Silverlight (also learning Flex/Air). What convinced me to also take some time with IronPython/.Net is the free "Iron Python Studio" and Microsoft move with the Visual Studio Shell: http://www.regdeveloper.co.uk/2007/06/09/vs_shell_eclipse/ Even if WxPython API is fine, it's been a long time I've been hoping for a free "Visual Studio Python Express"-like, with a form designer to quickly develop GUIs in particular. My guess is that with this free (as in beer) IDE, IPY has the potential to attract much more users especially students and hobbyists. I just hope that Iron Python Studio is not just a proof of concept (to show what can be done with the VS Isolated Shell) and that it will be maintained and enhanced. I say that because: - I didn't find any link from Iron Python homepage to the Iron Python Studio - it's been 5 days any developer/coordinator of Iron Python Studio have replied in their discussions section? (unusual for a project just released) Anyway, just a quick feedback from my newbie eye on Iron Python :) * Concerning Tutorials (.html) The tutorial in the download and the samples (link bellow) looks like a great place to start and as a quick reference for examples: http://www.codeplex.com/IronPython/Wiki/View.aspx?title=Samples& referringTitle=Home Unfortunately they are not visible to search-engines, hidden behind save-as, unizip, double-clicks(many times). I can understand the need to zip everything on a projects hosting pate-form but I think the .html(s) pages deserve to be directly visible, Is it possible? (if help is needed to format them for a wiki for example I could help) Also I wonder if a more permissive licence could be used to encourage the use of this content (as opposed to the actual 90 years all-rights-reserved US copyright). For example I might be interested to translate a part in French (my mother tongue) and maybe to extend some examples. I've seen the IP cookbook is under CC-BY (I think it's a great licence for docs) but if it is too much, a CC licence without the Non-Derivative clause would already be useful (for example both MIT Open Course Ware and Open Yale Courses use the CC-BY-NC-SA licence). * Concerning Lists / Discussion I think lists are great for dev. teams but "forums/discussions"-like are more used by 'learners', especially younger people like students (I guess the "edit" link is reassuring). Anyway Iron Python Studio project has the Discussion open. I think beginners will use this place also for IronPython questions. I don't now what is the plan about that but I think it would be nice to keep an eye on this place to help beginners to Iron Python. EDIT: As I was writing this (and waiting for a moderator to let me in the list) a post has been sent in the IronPythonStudio discussion on this: http://www.codeplex.com/IronPythonStudio/Thread/View.aspx?ThreadId=19414 I'm not sure it's the best solution but anyway thanks to Mircosoft for its interest in Python and to the people behind Iron Python :) francois ************************************************************************ Allens Arthur Robinson online: http://www.aar.com.au This email is confidential and may be subject to legal or other professional privilege. It is also subject to copyright. If you have received it in error, confidentiality and privilege are not waived and you must not disclose or use the information in it. Please notify the sender by return email and delete it from your system. Any personal information in this email must be handled in accordance with the Privacy Act 1988 (Cth). ************************************************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From jomes at microsoft.com Thu Dec 20 00:10:36 2007 From: jomes at microsoft.com (John Messerly) Date: Wed, 19 Dec 2007 15:10:36 -0800 Subject: [IronPython] Newbie, feedback/question In-Reply-To: References: <13a83ca10712190714s743bd4bav6aeb9a2f9c77fec6@mail.gmail.com> Message-ID: <918705E903F4714CB713D89AB5F1857D73A7931150@NA-EXMSG-C116.redmond.corp.microsoft.com> Also, just to be clear: we (IronPython team) didn't write "IronPython Studio". Although it sure looks like a cool project! - John > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users- > bounces at lists.ironpython.com] On Behalf Of Keith J. Farmer > Sent: Wednesday, December 19, 2007 11:09 AM > To: Discussion of IronPython; users at lists.ironpython.com > Subject: Re: [IronPython] Newbie, feedback/question > > Just to make sure you're aware: people have already started taking > their vacations. I don't know if this is the case in this instance, > but it's a fairly sure thing that Microsofties will be less present > over the next 3 weeks or so. > > ________________________________ > > From: users-bounces at lists.ironpython.com on behalf of Fran?ois Schnell > Sent: Wed 12/19/2007 7:14 AM > To: users at lists.ironpython.com > Subject: [IronPython] Newbie, feedback/question > > > - it's been 5 days any developer/coordinator of Iron Python Studio have > replied in their discussions section? (unusual for a project just > released) > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dfugate at microsoft.com Thu Dec 20 20:57:16 2007 From: dfugate at microsoft.com (Dave Fugate) Date: Thu, 20 Dec 2007 11:57:16 -0800 Subject: [IronPython] IronPython 2.0 Alpha 7 Message-ID: <7346A825E148B049A9AD1D3ED46A2D9116C321B1B3@NA-EXMSG-C106.redmond.corp.microsoft.com> Hello IronPython Community, Just in time for the holidays we have released IronPython 2.0 Alpha 7! There's been numerous changes to IronPython in the past month and a half. Most notably a lot of work has been done to get usage of the 'yield' statement compatible with CPython 2.5. There might be a few more changes that need to be made, but by and far IP now adheres to PEP 342. Another notable change brings the code closer to the new hosting API spec we published on this mailing list. The next couple of releases should finish that work. After careful consideration of your valuable feedback we've determined that 2.0A7 will be the last 2.0 release to be built and fully tested by us under Visual Studio 2005 tools. Beginning with 2.0 Alpha 8, IronPython.sln (included in the source zip file) will be upgraded to VS 2008 format and we will only run our full test suite against binaries built from this. The 2005 version of IronPython.sln will then be deprecated although it will remain in the source zip file alongside IronPython.sln under the new name of IronPython2005.sln for some time. At this point it's unclear whether we'll continue to update IronPython2005.sln. Last but not least, a number of bugs have been closed: 10581 - Python25: Characters of hex values are uppercase in IP while they're lowercase in CPython 2.5 8961 - Cannot run globals().keys() after accessing the dictionary keys method of a function 12965 - __doc__ broken 1689 - Raising attribute error from __getattr__ doesn't propagate out, instead we throw a new attribute error 11491 - problem parsing conditional expression 8074 - ipy hangs if imported namespaces contain numbers 4716 - items = globals().items() in a module (not at console) 10637 - Function object missing func_closure Closed 6707 - Trivial: IronPython.Hosting.PythonEngine().Sys.prefix is set to None 6770 - callable(__builtins__) has different results in ipy and Cpy 3953 - Trivial: Can convert float infinity to long in IronPython 11103 - Trivial: 'ipy.exe -c "something"' prints out the results of "something" to stdout 10856 - __doc__ does not show up in dir() output on load (and has wrong contents) 2267 - sys.winver missing? 1352 - Trivial: Open paren at end-of-line raises SyntaxError in interactive console 12141 - Microsoft.Scripting.MethodBinder.ToString() 5446 - socket.getaddrinfo(...) proto parameter 5757 - PythonFile is not thread-safe 10474 - Need to ignore null paths in sys.path We'd like to thank everyone in the community who reported these to make a better release: Jan Szumiec, arman0, orbital56, Seo Sanghyeon, glchapman, tscottw, jacobg23, brucec, leppie, and Christopher Baus. You can download IronPython 2.0 Alpha 7 at: https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=IronPython&ReleaseId=8189 The IronPython Team IMPORTANT NOTES ToyScript, a small scripting language built on top of the DLR, is merely a DLR sample and not some new scripting language Microsoft has created. Also, ToyScript is not intended to be distributed with IronPython on a permanent basis. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfugate at microsoft.com Thu Dec 20 23:27:25 2007 From: dfugate at microsoft.com (Dave Fugate) Date: Thu, 20 Dec 2007 14:27:25 -0800 Subject: [IronPython] Newbie, feedback/question In-Reply-To: <13a83ca10712191342g325b538w4f4a748cf09f0929@mail.gmail.com> References: <13a83ca10712190714s743bd4bav6aeb9a2f9c77fec6@mail.gmail.com> <13a83ca10712191342g325b538w4f4a748cf09f0929@mail.gmail.com> Message-ID: <7346A825E148B049A9AD1D3ED46A2D9116C321B28B@NA-EXMSG-C106.redmond.corp.microsoft.com> Yes, it's pretty empty around here already. Today and tomorrow there are a few IronPython team members working, but next week nearly everyone is on vacation. A day or two after New Year's things will start returning to normal:) From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fran?ois Schnell Sent: Wednesday, December 19, 2007 1:42 PM To: Discussion of IronPython Subject: Re: [IronPython] Newbie, feedback/question On Dec 19, 2007 8:09 PM, Keith J. Farmer > wrote: Just to make sure you're aware: people have already started taking their vacations. I don't know if this is the case in this instance, but it's a fairly sure thing that Microsofties will be less present over the next 3 weeks or so. Ah Ok, thanks for the info Keith. Happy holidays to all. francois ________________________________ From: users-bounces at lists.ironpython.com on behalf of Fran?ois Schnell Sent: Wed 12/19/2007 7:14 AM To: users at lists.ironpython.com Subject: [IronPython] Newbie, feedback/question - it's been 5 days any developer/coordinator of Iron Python Studio have replied in their discussions section? (unusual for a project just released) _______________________________________________ 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 daftspaniel at gmail.com Thu Dec 20 21:53:53 2007 From: daftspaniel at gmail.com (Davy Mitchell) Date: Thu, 20 Dec 2007 20:53:53 +0000 Subject: [IronPython] IronPython 2.0 Alpha 7 In-Reply-To: <7346A825E148B049A9AD1D3ED46A2D9116C321B1B3@NA-EXMSG-C106.redmond.corp.microsoft.com> References: <7346A825E148B049A9AD1D3ED46A2D9116C321B1B3@NA-EXMSG-C106.redmond.corp.microsoft.com> Message-ID: <20253b0c0712201253u5e6bff13j179e3e8deb0ce2ad@mail.gmail.com> Thanks Dave - appreciate the hard work. I have been using the module querypy.py (Attached) with previous releases. Think I have found an issue in the latest release. ---- def __make_tag__(name, **kwargs): class tmp: pass tmp_dict = dict(Tag.__dict__) # This is 232 the problem line. tmp.__name__ = name --- Traceback (most recent call last): File ldservergui.py, line 8, in Initialize File , line 0, in _stub_##2 File c:\Code\MN2\moodnews.py, line 9, in Initialize File , line 0, in _stub_##2 File c:\Code\MN2\querypy.py, line 241, in Initialize File querypy, line unknown, in __make_tag__ File c:\Code\MN2\querypy.py, line 232, in __make_tag__ NotImplementedError: The method or operation is not implemented. On Dec 20, 2007 7:57 PM, Dave Fugate wrote: > > > > > Hello IronPython Community, > > > > Just in time for the holidays we have released IronPython 2.0 Alpha 7! > There's been numerous changes to IronPython in the past month and a half. > Most notably a lot of work has been done to get usage of the 'yield' > statement compatible with CPython 2.5. There might be a few more changes > that need to be made, but by and far IP now adheres to PEP 342. Another > notable change brings the code closer to the new hosting API spec we > published on this mailing list. The next couple of releases should finish > that work. > > > > After careful consideration of your valuable feedback we've determined that > 2.0A7 will be the last 2.0 release to be built and fully tested by us under > Visual Studio 2005 tools. Beginning with 2.0 Alpha 8, IronPython.sln > (included in the source zip file) will be upgraded to VS 2008 format and we > will only run our full test suite against binaries built from this. The > 2005 version of IronPython.sln will then be deprecated although it will > remain in the source zip file alongside IronPython.sln under the new name of > IronPython2005.sln for some time. At this point it's unclear whether we'll > continue to update IronPython2005.sln. > > > > Last but not least, a number of bugs have been closed: > > 10581 - Python25: Characters of hex values are uppercase in IP while they're > lowercase in CPython 2.5 > > 8961 - Cannot run globals().keys() after accessing the dictionary keys > method of a function > > 12965 - __doc__ broken > > 1689 - Raising attribute error from __getattr__ doesn't propagate out, > instead we throw a new attribute error > > 11491 - problem parsing conditional expression > > 8074 - ipy hangs if imported namespaces contain numbers > > 4716 - items = globals().items() in a module (not at console) > > 10637 - Function object missing func_closure Closed > > 6707 - Trivial: IronPython.Hosting.PythonEngine().Sys.prefix is set to None > > 6770 - callable(__builtins__) has different results in ipy and Cpy > > 3953 - Trivial: Can convert float infinity to long in IronPython > > 11103 - Trivial: 'ipy.exe -c "something"' prints out the results of > "something" to stdout > > 10856 - __doc__ does not show up in dir() output on load (and has wrong > contents) > > 2267 - sys.winver missing? > > 1352 - Trivial: Open paren at end-of-line raises SyntaxError in interactive > console > > 12141 - Microsoft.Scripting.MethodBinder.ToString() > > 5446 - socket.getaddrinfo(...) proto parameter > > 5757 - PythonFile is not thread-safe > > 10474 - Need to ignore null paths in sys.path > > > > We'd like to thank everyone in the community who reported these to make a > better release: Jan Szumiec, arman0, orbital56, Seo Sanghyeon, glchapman, > tscottw, jacobg23, brucec, leppie, and Christopher Baus. > > > > You can download IronPython 2.0 Alpha 7 at: > https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=IronPython&ReleaseId=8189 > > > > The IronPython Team > > > > > > IMPORTANT NOTES > > ToyScript, a small scripting language built on top of the DLR, is merely a > DLR sample and not some new scripting language Microsoft has created. Also, > ToyScript is not intended to be distributed with IronPython on a permanent > basis. > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- Davy Mitchell Blog - http://www.latedecember.co.uk/sites/personal/davy/ Twitter - http://twitter.com/daftspaniel Skype - daftspaniel needgod.com -------------- next part -------------- A non-text attachment was scrubbed... Name: querypy.py Type: text/x-python Size: 11644 bytes Desc: not available URL: From dfugate at microsoft.com Fri Dec 21 00:43:45 2007 From: dfugate at microsoft.com (Dave Fugate) Date: Thu, 20 Dec 2007 15:43:45 -0800 Subject: [IronPython] IronPython 2.0 Alpha 7 In-Reply-To: <20253b0c0712201253u5e6bff13j179e3e8deb0ce2ad@mail.gmail.com> References: <7346A825E148B049A9AD1D3ED46A2D9116C321B1B3@NA-EXMSG-C106.redmond.corp.microsoft.com> <20253b0c0712201253u5e6bff13j179e3e8deb0ce2ad@mail.gmail.com> Message-ID: <7346A825E148B049A9AD1D3ED46A2D9116C321B2E5@NA-EXMSG-C106.redmond.corp.microsoft.com> Thanks! This is a good bug and I'm little surprised we didn't have a test for it. Filed as CodePlex 14501 - http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=14501. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Davy Mitchell Sent: Thursday, December 20, 2007 12:54 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 2.0 Alpha 7 Thanks Dave - appreciate the hard work. I have been using the module querypy.py (Attached) with previous releases. Think I have found an issue in the latest release. ---- def __make_tag__(name, **kwargs): class tmp: pass tmp_dict = dict(Tag.__dict__) # This is 232 the problem line. tmp.__name__ = name --- Traceback (most recent call last): File ldservergui.py, line 8, in Initialize File , line 0, in _stub_##2 File c:\Code\MN2\moodnews.py, line 9, in Initialize File , line 0, in _stub_##2 File c:\Code\MN2\querypy.py, line 241, in Initialize File querypy, line unknown, in __make_tag__ File c:\Code\MN2\querypy.py, line 232, in __make_tag__ NotImplementedError: The method or operation is not implemented. On Dec 20, 2007 7:57 PM, Dave Fugate wrote: > > > > > Hello IronPython Community, > > > > Just in time for the holidays we have released IronPython 2.0 Alpha 7! > There's been numerous changes to IronPython in the past month and a half. > Most notably a lot of work has been done to get usage of the 'yield' > statement compatible with CPython 2.5. There might be a few more > changes that need to be made, but by and far IP now adheres to PEP > 342. Another notable change brings the code closer to the new hosting > API spec we published on this mailing list. The next couple of > releases should finish that work. > > > > After careful consideration of your valuable feedback we've determined > that > 2.0A7 will be the last 2.0 release to be built and fully tested by us > under Visual Studio 2005 tools. Beginning with 2.0 Alpha 8, > IronPython.sln (included in the source zip file) will be upgraded to > VS 2008 format and we will only run our full test suite against > binaries built from this. The > 2005 version of IronPython.sln will then be deprecated although it > will remain in the source zip file alongside IronPython.sln under the > new name of IronPython2005.sln for some time. At this point it's > unclear whether we'll continue to update IronPython2005.sln. > > > > Last but not least, a number of bugs have been closed: > > 10581 - Python25: Characters of hex values are uppercase in IP while > they're lowercase in CPython 2.5 > > 8961 - Cannot run globals().keys() after accessing the dictionary keys > method of a function > > 12965 - __doc__ broken > > 1689 - Raising attribute error from __getattr__ doesn't propagate out, > instead we throw a new attribute error > > 11491 - problem parsing conditional expression > > 8074 - ipy hangs if imported namespaces contain numbers > > 4716 - items = globals().items() in a module (not at console) > > 10637 - Function object missing func_closure Closed > > 6707 - Trivial: IronPython.Hosting.PythonEngine().Sys.prefix is set to > None > > 6770 - callable(__builtins__) has different results in ipy and Cpy > > 3953 - Trivial: Can convert float infinity to long in IronPython > > 11103 - Trivial: 'ipy.exe -c "something"' prints out the results of > "something" to stdout > > 10856 - __doc__ does not show up in dir() output on load (and has > wrong > contents) > > 2267 - sys.winver missing? > > 1352 - Trivial: Open paren at end-of-line raises SyntaxError in > interactive console > > 12141 - Microsoft.Scripting.MethodBinder.ToString() > > 5446 - socket.getaddrinfo(...) proto parameter > > 5757 - PythonFile is not thread-safe > > 10474 - Need to ignore null paths in sys.path > > > > We'd like to thank everyone in the community who reported these to > make a better release: Jan Szumiec, arman0, orbital56, Seo Sanghyeon, > glchapman, tscottw, jacobg23, brucec, leppie, and Christopher Baus. > > > > You can download IronPython 2.0 Alpha 7 at: > https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=Iron > Python&ReleaseId=8189 > > > > The IronPython Team > > > > > > IMPORTANT NOTES > > ToyScript, a small scripting language built on top of the DLR, is > merely a DLR sample and not some new scripting language Microsoft has > created. Also, ToyScript is not intended to be distributed with > IronPython on a permanent basis. > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- Davy Mitchell Blog - http://www.latedecember.co.uk/sites/personal/davy/ Twitter - http://twitter.com/daftspaniel Skype - daftspaniel needgod.com From slide.o.mix at gmail.com Fri Dec 21 22:39:59 2007 From: slide.o.mix at gmail.com (Slide) Date: Fri, 21 Dec 2007 14:39:59 -0700 Subject: [IronPython] IP 2.0 Alpha 7 embedding Message-ID: I have come up with an example (very simple) of embedding IP 2.0 into a C# app and doing back and forth handling of objects (objects declared in Python and object declared in C#). I am interested to know if I am doing some things the best way as I've just been going kind of hit and miss. Can someone do a little critiquing of this code and see if I am being dumb? The windows app has two RichTextBoxes on it (one for input, the other for output), a clear button and a "go" button. When the "go" button is pressed, it writes the source out to a temp file and then creates the object instance from the script. Thanks! Here is the code: test.py ============================================ import TestLib, unittest def Print(message): output.AppendText("%s\r\n" % message) class Test(TestLib.ITest): def Print(self, message): output.AppendText("%s\r\n" % message) Print("Hello, world!") ITestLib.cs located in TestLib.dll ========================================== using System; using System.Collections.Generic; using System.Text; namespace TestLib { public interface ITest { void Print(string message); } } MainForm.cs located in IPEmbed.exe which references TestLib.dll ============================================ using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.IO; using System.Windows.Forms; using Microsoft.Scripting; using Microsoft.Scripting.Hosting; using IronPython.Runtime; using IronPython.Hosting; namespace IPEmbed { public partial class Form1 : Form { private ScriptScope __main__; private LanguageContext _context; public Form1() { InitializeComponent(); _context = LanguageContext.FromEngine(PythonEngine.CurrentEngine); _context.SetScriptSourceSearchPaths(new string[] { Environment.CurrentDirectory, Path.Combine(Environment.CurrentDirectory, "Lib") }); } // sets up the script engine, etc private void go_Click(object sender, EventArgs e) { ScriptDomainManager.CurrentManager.Host.DefaultModule.ClearVariables(); if (input.Text.Length == 0) return; string filepath = Path.GetTempFileName(); File.WriteAllText(filepath, input.Text); __main__ = ScriptDomainManager.CurrentManager.CompileModule("__main__", SourceUnit.CreateFileUnit(_context, filepath)); ScriptDomainManager.CurrentManager.PublishModule(__main__, "__main__"); Microsoft.Scripting.ClrModule.GetInstance().AddReference("TestLib"); __main__.SetVariable("output", output); __main__.Execute(); TestLib.ITest test = CreateInstanceFromInterface(); if (test != null) test.Print("Hello, world!"); } // this method will find a class in the python code that implements a given interface and create and instance // of that class, returning it as the interface private T CreateInstanceFromInterface() { T result = default(T); IAttributesCollection attrs = IronPython.Runtime.Types.PythonModuleOps.Get__dict__(__main__); foreach (KeyValuePair attr in attrs) { IronPython.Runtime.Types.PythonType attr_type = attr.Value as IronPython.Runtime.Types.PythonType; if (attr_type != null) { foreach (IronPython.Runtime.Types.PythonType dt in attr_type.BaseTypes) { if (dt.UnderlyingSystemType != null && dt.UnderlyingSystemType == typeof(T)) { CodeContext context = new CodeContext(__main__.Scope, _context, new ModuleContext(__main__)); result = (T)attr_type.CreateInstance(context); break; } } } } return result; } private void clear_Click(object sender, EventArgs e) { output.Clear(); } } } From nekomaho at gmail.com Sat Dec 22 09:18:24 2007 From: nekomaho at gmail.com (nekomaho) Date: Sat, 22 Dec 2007 17:18:24 +0900 Subject: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' with -X:PreferComDispatch In-Reply-To: <50B69702CA6E6D4E849D30CD4989AB8EC590263C18@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <838491.95529.qm@web31102.mail.mud.yahoo.com> <7346A825E148B049A9AD1D3ED46A2D9116C181F63E@NA-EXMSG-C106.redmond.corp.microsoft.com> <473C3F5C.9050204@gmail.com> <50B69702CA6E6D4E849D30CD4989AB8EC58FC5AEB7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <473D7508.1060709@gmail.com> <50B69702CA6E6D4E849D30CD4989AB8EC590263C18@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <476CC850.4060303@gmail.com> Hi, I get no AttributeError with IronPython 2.0 Alpha 7. thanks > Misha said - "I should add that having the registry keys alone would only help if Excel PIAs are in the GAC as well (when installing Excel - you would choose .NET Interoperability support)." You probably do not have the PIAs installed. > > The problem is just a matter of initialiazation order. The IDispatch support was not initialized by the time the "e.Visible = True" statement was executed. I have a fix and have just checked it in. The next IronPython drop should have the fix. If you want a fix now, you can add the following lines at the very start of PythonBinder.GetExtensionTypes. > > // Ensure that the type is initialized. If ReflectedTypeBuilder.RegisterAlternateBuilder was used, > // the alternate builder will get a chance to initialize the type. > DynamicHelpers.GetPythonTypeFromType(t); > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of nekomaho > Sent: Friday, November 16, 2007 2:47 AM > To: Discussion of IronPython > Subject: Re: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' with -X:PreferComDispatch > > Hi, > > I changed registry but I get same error. > > IronPython-2.0A6>reg query HKEY_CLASSES_ROOT\CLSID\{00024500-0000-0000-C000-000000000046}\InprocServer32 /s > > ! REG.EXE VERSION 3.0 > > HKEY_CLASSES_ROOT\CLSID\{00024500-0000-0000-C000-000000000046}\InprocServer32 > Class REG_SZ Microsoft.Office.Interop.Excel.ApplicationClass > RuntimeVersion REG_SZ v1.1.4322 > > HKEY_CLASSES_ROOT\CLSID\{00024500-0000-0000-C000-000000000046}\InprocServer32\12.0.0.0 > Class REG_SZ Microsoft.Office.Interop.Excel.ApplicationClass > RuntimeVersion REG_SZ v1.1.4322 > > IronPython-2.0A6>ipy.exe -X:PreferComDispatch -X:TabCompletion -X:ExceptionDetail > IronPython console: IronPython 2.0A6 (2.0.11102.00) on .NET 2.0.50727.832 > Copyright (c) Microsoft Corporation. All rights reserved. >>>> import clr >>>> from System import Type, Activator >>>> t = Type.GetTypeFromProgID('Excel.Application') >>>> e = Activator.CreateInstance(t) >>>> e.Visible = True > '__ComObject' object has no attribute 'Visible' > ?? Microsoft.Scripting.Ast.ThrowStatement.DoExecute(CodeContext context) > ?? Microsoft.Scripting.Ast.Statement.Execute(CodeContext context) > ?? Microsoft.Scripting.Actions.ActionBinder.UpdateSiteAndExecute[T](CodeContext callerContext, DynamicAction action, Object[] args, Object site, T& target, RuleSet`1& rules) > ?? Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) > ?? Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) > ?? Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) > ?? ##29(Object[] , CodeContext ) > ?? Microsoft.Scripting.ScriptCode.Run(CodeContext codeContext, Boolean tryEvaluate) > ?? Microsoft.Scripting.ScriptCode.Run(ScriptModule module) > ?? Microsoft.Scripting.Hosting.CompiledCode.Evaluate(IScriptModule module) > ?? Microsoft.Scripting.Hosting.ScriptEngine.ExecuteCommand(String code, IScriptModule module) > ?? Microsoft.Scripting.Shell.CommandLine.RunOneInteraction() > ?? Microsoft.Scripting.Shell.CommandLine.TryInteractiveAction() > ?? IronPython.Hosting.PythonCommandLine.TryInteractiveAction() > ?? Microsoft.Scripting.Shell.CommandLine.RunInteractiveLoop() > AttributeError: '__ComObject' object has no attribute 'Visible' > > Thanks > >> The behavior currently depends on whether or not the RCW gets strongly-typed when it enters the managed world. As a workaround, the following registry script Misha provided could "fix" your machine by registering the PIA: >> >> Windows Registry Editor Version 5.00 >> >> [HKEY_CLASSES_ROOT\CLSID\{00024500-0000-0000-C000-000000000046}\InprocServer32] >> "Assembly"="Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C" >> "Class"="Microsoft.Office.Interop.Excel.ApplicationClass" >> "RuntimeVersion"="v1.1.4322" >> >> [HKEY_CLASSES_ROOT\CLSID\{00024500-0000-0000-C000-000000000046}\InprocServer32\12.0.0.0] >> "Assembly"="Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C" >> "Class"="Microsoft.Office.Interop.Excel.ApplicationClass" >> "RuntimeVersion"="v1.1.4322" >> >> Your script should work independent of whether the PIA is registered or not. We will look into it and see what is going. >> >> The implementation of -X:PreferComDispatch is still not complete. We are working on improving it and will enable it by default once all issues are flushed out. You are on the cutting edge and providing us with advance feedback :) >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of nekomaho >> Sent: Thursday, November 15, 2007 4:45 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' >> >> Hi, >> >> I use Windows XP Pro SP2 ja & Office 2007 Pro ja. >> >> IronPython-2.0A6>ipy.exe -X:PreferComDispatch -X:TabCompletion -X:ExceptionDetail >> IronPython console: IronPython 2.0A6 (2.0.11102.00) on .NET 2.0.50727.832 >> Copyright (c) Microsoft Corporation. All rights reserved. >>>>> import clr >>>>> from System import Type, Activator >>>>> t = Type.GetTypeFromProgID('Excel.Application') >>>>> e = Activator.CreateInstance(t) >>>>> e.Visible = True >> '__ComObject' object has no attribute 'Visible' >> ?? Microsoft.Scripting.Ast.ThrowStatement.DoExecute(CodeContext context) >> ?? Microsoft.Scripting.Ast.Statement.Execute(CodeContext context) >> ?? Microsoft.Scripting.Actions.ActionBinder.UpdateSiteAndExecute[T](CodeContext callerContext, DynamicAction action, Object[] args, Object site, T& target, RuleSet`1& rules) >> ?? Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) >> ?? Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) >> ?? Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) >> ?? ##29(Object[] , CodeContext ) >> ?? Microsoft.Scripting.ScriptCode.Run(CodeContext codeContext, Boolean tryEvaluate) >> ?? Microsoft.Scripting.ScriptCode.Run(ScriptModule module) >> ?? Microsoft.Scripting.Hosting.CompiledCode.Evaluate(IScriptModule module) >> ?? Microsoft.Scripting.Hosting.ScriptEngine.ExecuteCommand(String code, IScriptModule module) >> ?? Microsoft.Scripting.Shell.CommandLine.RunOneInteraction() >> ?? Microsoft.Scripting.Shell.CommandLine.TryInteractiveAction() >> ?? IronPython.Hosting.PythonCommandLine.TryInteractiveAction() >> ?? Microsoft.Scripting.Shell.CommandLine.RunInteractiveLoop() >> AttributeError: '__ComObject' object has no attribute 'Visible' >> >> Thanks >> >>> This works for me as well. Could you please re-run your code snippet under the -X:ExceptionDetail mode and send us the output? Also, what versions of Windows and Office are being used? >>> >>> Thanks >>> >>> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mohammad Tayseer >>> Sent: Wednesday, November 14, 2007 8:02 AM >>> To: Discussion of IronPython >>> Subject: Re: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' >>> >>> It works for me. What version of Excel do you use?? >>> >>> Mohammad Tayseer >>> http://spellcoder.com/blogs/tayseer >>> >>> ----- Original Message ---- >>> From: nekomaho >>> >>> >>> Hi, >>> >>> I get AttributeError in IronPython 2.0A6 & A5, but 2.0A4 is ok. why? >>> >>> >>> ________________________________ >>> Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. >>> >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From Shri.Borde at microsoft.com Sat Dec 22 21:16:38 2007 From: Shri.Borde at microsoft.com (Shri Borde) Date: Sat, 22 Dec 2007 12:16:38 -0800 Subject: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' with -X:PreferComDispatch In-Reply-To: <476CC850.4060303@gmail.com> References: <838491.95529.qm@web31102.mail.mud.yahoo.com> <7346A825E148B049A9AD1D3ED46A2D9116C181F63E@NA-EXMSG-C106.redmond.corp.microsoft.com> <473C3F5C.9050204@gmail.com> <50B69702CA6E6D4E849D30CD4989AB8EC58FC5AEB7@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <473D7508.1060709@gmail.com> <50B69702CA6E6D4E849D30CD4989AB8EC590263C18@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <476CC850.4060303@gmail.com> Message-ID: <50B69702CA6E6D4E849D30CD4989AB8ECF65564FF6@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Hi, Could you include the following information please: 1. Is this with the modified registry or without? 2. Can you show the complete output with -X:ExceptionDetail? 3. If you do "dir(e)" before doing "e.Visible = True", does that change the behavior? 4. What happens if you do *not* use -X:PreferComDispatch? You will have to use the following script. c:\Test>ipy.exe -X:TabCompletion -X:ExceptionDetail IronPython console: 2.0 Copyright (c) Microsoft Corporation. All rights reserved. >>> import clr >>> clr.AddReference("Microsoft.Office.Interop.Excel") # expects the PIA to be in the GAC on in the current folder >>> from Microsoft.Office.Interop.Excel import * >>> e = ApplicationClass() >>> ApplicationClass.Visible.SetValue(e, True) Thanks, Shri -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of nekomaho Sent: Saturday, December 22, 2007 12:18 AM To: Discussion of IronPython Subject: Re: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' with -X:PreferComDispatch Hi, I get no AttributeError with IronPython 2.0 Alpha 7. thanks > Misha said - "I should add that having the registry keys alone would only help if Excel PIAs are in the GAC as well (when installing Excel - you would choose .NET Interoperability support)." You probably do not have the PIAs installed. > > The problem is just a matter of initialiazation order. The IDispatch support was not initialized by the time the "e.Visible = True" statement was executed. I have a fix and have just checked it in. The next IronPython drop should have the fix. If you want a fix now, you can add the following lines at the very start of PythonBinder.GetExtensionTypes. > > // Ensure that the type is initialized. If ReflectedTypeBuilder.RegisterAlternateBuilder was used, > // the alternate builder will get a chance to initialize the type. > DynamicHelpers.GetPythonTypeFromType(t); > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of nekomaho > Sent: Friday, November 16, 2007 2:47 AM > To: Discussion of IronPython > Subject: Re: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' with -X:PreferComDispatch > > Hi, > > I changed registry but I get same error. > > IronPython-2.0A6>reg query HKEY_CLASSES_ROOT\CLSID\{00024500-0000-0000-C000-000000000046}\InprocServer32 /s > > ! REG.EXE VERSION 3.0 > > HKEY_CLASSES_ROOT\CLSID\{00024500-0000-0000-C000-000000000046}\InprocServer32 > Class REG_SZ Microsoft.Office.Interop.Excel.ApplicationClass > RuntimeVersion REG_SZ v1.1.4322 > > HKEY_CLASSES_ROOT\CLSID\{00024500-0000-0000-C000-000000000046}\InprocServer32\12.0.0.0 > Class REG_SZ Microsoft.Office.Interop.Excel.ApplicationClass > RuntimeVersion REG_SZ v1.1.4322 > > IronPython-2.0A6>ipy.exe -X:PreferComDispatch -X:TabCompletion -X:ExceptionDetail > IronPython console: IronPython 2.0A6 (2.0.11102.00) on .NET 2.0.50727.832 > Copyright (c) Microsoft Corporation. All rights reserved. >>>> import clr >>>> from System import Type, Activator >>>> t = Type.GetTypeFromProgID('Excel.Application') >>>> e = Activator.CreateInstance(t) >>>> e.Visible = True > '__ComObject' object has no attribute 'Visible' > ?? Microsoft.Scripting.Ast.ThrowStatement.DoExecute(CodeContext context) > ?? Microsoft.Scripting.Ast.Statement.Execute(CodeContext context) > ?? Microsoft.Scripting.Actions.ActionBinder.UpdateSiteAndExecute[T](CodeContext callerContext, DynamicAction action, Object[] args, Object site, T& target, RuleSet`1& rules) > ?? Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) > ?? Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) > ?? Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) > ?? ##29(Object[] , CodeContext ) > ?? Microsoft.Scripting.ScriptCode.Run(CodeContext codeContext, Boolean tryEvaluate) > ?? Microsoft.Scripting.ScriptCode.Run(ScriptModule module) > ?? Microsoft.Scripting.Hosting.CompiledCode.Evaluate(IScriptModule module) > ?? Microsoft.Scripting.Hosting.ScriptEngine.ExecuteCommand(String code, IScriptModule module) > ?? Microsoft.Scripting.Shell.CommandLine.RunOneInteraction() > ?? Microsoft.Scripting.Shell.CommandLine.TryInteractiveAction() > ?? IronPython.Hosting.PythonCommandLine.TryInteractiveAction() > ?? Microsoft.Scripting.Shell.CommandLine.RunInteractiveLoop() > AttributeError: '__ComObject' object has no attribute 'Visible' > > Thanks > >> The behavior currently depends on whether or not the RCW gets strongly-typed when it enters the managed world. As a workaround, the following registry script Misha provided could "fix" your machine by registering the PIA: >> >> Windows Registry Editor Version 5.00 >> >> [HKEY_CLASSES_ROOT\CLSID\{00024500-0000-0000-C000-000000000046}\InprocServer32] >> "Assembly"="Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C" >> "Class"="Microsoft.Office.Interop.Excel.ApplicationClass" >> "RuntimeVersion"="v1.1.4322" >> >> [HKEY_CLASSES_ROOT\CLSID\{00024500-0000-0000-C000-000000000046}\InprocServer32\12.0.0.0] >> "Assembly"="Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C" >> "Class"="Microsoft.Office.Interop.Excel.ApplicationClass" >> "RuntimeVersion"="v1.1.4322" >> >> Your script should work independent of whether the PIA is registered or not. We will look into it and see what is going. >> >> The implementation of -X:PreferComDispatch is still not complete. We are working on improving it and will enable it by default once all issues are flushed out. You are on the cutting edge and providing us with advance feedback :) >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of nekomaho >> Sent: Thursday, November 15, 2007 4:45 AM >> To: Discussion of IronPython >> Subject: Re: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' >> >> Hi, >> >> I use Windows XP Pro SP2 ja & Office 2007 Pro ja. >> >> IronPython-2.0A6>ipy.exe -X:PreferComDispatch -X:TabCompletion -X:ExceptionDetail >> IronPython console: IronPython 2.0A6 (2.0.11102.00) on .NET 2.0.50727.832 >> Copyright (c) Microsoft Corporation. All rights reserved. >>>>> import clr >>>>> from System import Type, Activator >>>>> t = Type.GetTypeFromProgID('Excel.Application') >>>>> e = Activator.CreateInstance(t) >>>>> e.Visible = True >> '__ComObject' object has no attribute 'Visible' >> ?? Microsoft.Scripting.Ast.ThrowStatement.DoExecute(CodeContext context) >> ?? Microsoft.Scripting.Ast.Statement.Execute(CodeContext context) >> ?? Microsoft.Scripting.Actions.ActionBinder.UpdateSiteAndExecute[T](CodeContext callerContext, DynamicAction action, Object[] args, Object site, T& target, RuleSet`1& rules) >> ?? Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) >> ?? Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) >> ?? Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) >> ?? ##29(Object[] , CodeContext ) >> ?? Microsoft.Scripting.ScriptCode.Run(CodeContext codeContext, Boolean tryEvaluate) >> ?? Microsoft.Scripting.ScriptCode.Run(ScriptModule module) >> ?? Microsoft.Scripting.Hosting.CompiledCode.Evaluate(IScriptModule module) >> ?? Microsoft.Scripting.Hosting.ScriptEngine.ExecuteCommand(String code, IScriptModule module) >> ?? Microsoft.Scripting.Shell.CommandLine.RunOneInteraction() >> ?? Microsoft.Scripting.Shell.CommandLine.TryInteractiveAction() >> ?? IronPython.Hosting.PythonCommandLine.TryInteractiveAction() >> ?? Microsoft.Scripting.Shell.CommandLine.RunInteractiveLoop() >> AttributeError: '__ComObject' object has no attribute 'Visible' >> >> Thanks >> >>> This works for me as well. Could you please re-run your code snippet under the -X:ExceptionDetail mode and send us the output? Also, what versions of Windows and Office are being used? >>> >>> Thanks >>> >>> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Mohammad Tayseer >>> Sent: Wednesday, November 14, 2007 8:02 AM >>> To: Discussion of IronPython >>> Subject: Re: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' >>> >>> It works for me. What version of Excel do you use?? >>> >>> Mohammad Tayseer >>> http://spellcoder.com/blogs/tayseer >>> >>> ----- Original Message ---- >>> From: nekomaho >>> >>> >>> Hi, >>> >>> I get AttributeError in IronPython 2.0A6 & A5, but 2.0A4 is ok. why? >>> >>> >>> ________________________________ >>> Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. >>> >>> >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From textdirected at gmail.com Sun Dec 23 12:59:39 2007 From: textdirected at gmail.com (HEMMI, Shigeru) Date: Sun, 23 Dec 2007 20:59:39 +0900 Subject: [IronPython] IronPython 1.1.1 wish-list? In-Reply-To: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Hello, If the bug, http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2007-February/004500.html is fixed or somebody shows me a good example how to inherit "file" class in IronPython 1.1, I will be happy. 2nd, please provide quit() function, which eases my interactive IronPython session. Regards, 2007/12/18, Dino Viehland : > > > > > Are there any particular bugs you'd like to see fixed in IronPython 1.1.1? > > > > We're planning on updating the 1.1 release w/ a targeted set of bug fixes. > Unfortunately we've started to use the CodePlex bug list to track primarily > 2.0 bugs. We can still use this to find the highest ranked bugs that aren't > fixed in v1.1 and target those to be back ported ? but it's possible we > might miss something important. So I'd thought I'd ask: what do you want > fixed? > > > > Note the idea here is to keep these fixes small and keep the release stable, > so please no fix "type(type) is type" J. And of course if you don't know > how bad it'll be feel free to suggest it anyway. Thanks! > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From daftspaniel at gmail.com Sun Dec 23 15:20:47 2007 From: daftspaniel at gmail.com (Davy Mitchell) Date: Sun, 23 Dec 2007 14:20:47 +0000 Subject: [IronPython] Difference in 1.1 and 2.0 with Dialog Result Message-ID: <20253b0c0712230620id6cdae1n4e99fe03374de04b@mail.gmail.com> import clr clr.AddReference('System.Windows.Forms') from System.Windows.Forms import DialogResult if DialogResult.OK: print "Boo!" The above prints Boo! in 1.1 and early 2.0 Alphas i.e. DialogResult.OK resolves to TRUE. A6 and A7 (didn't try any others!) nothing is printed i.e. DialogResult.OK resolves to FALSE. Now, I am changing my dialog code anyway but is this a deliberate change? Cheers, Davy -- Davy Mitchell Blog - http://www.latedecember.co.uk/sites/personal/davy/ Twitter - http://twitter.com/daftspaniel Skype - daftspaniel needgod.com From fuzzyman at voidspace.org.uk Sun Dec 23 18:05:05 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 23 Dec 2007 17:05:05 +0000 Subject: [IronPython] [python] Difference in 1.1 and 2.0 with Dialog Result In-Reply-To: <20253b0c0712230620id6cdae1n4e99fe03374de04b@mail.gmail.com> References: <20253b0c0712230620id6cdae1n4e99fe03374de04b@mail.gmail.com> Message-ID: <476E9541.7010209@voidspace.org.uk> Davy Mitchell wrote: > import clr > clr.AddReference('System.Windows.Forms') > from System.Windows.Forms import DialogResult > if DialogResult.OK: > print "Boo!" > > The above prints Boo! in 1.1 and early 2.0 Alphas i.e. DialogResult.OK > resolves to TRUE. > > A6 and A7 (didn't try any others!) nothing is printed i.e. > DialogResult.OK resolves to FALSE. > > Now, I am changing my dialog code anyway but is this a deliberate change? > > Hmm.. (IP2.0 A7) >>> import clr >>> clr.AddReference('System.Windows.Forms') >>> from System.Windows.Forms import DialogResult >>> bool(DialogResult.OK) False >>> DialogResult.OK.value__ 1 Odd. Of course the right thing to be doing is: if result == DialogResult.OK: but it is still odd that this enumeration now evaluates to False. Michael http://www.manning.com/foord > Cheers, > Davy > > From fuzzyman at voidspace.org.uk Sun Dec 23 18:25:21 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 23 Dec 2007 17:25:21 +0000 Subject: [IronPython] [python] Re: IronPython 1.1.1 wish-list? In-Reply-To: References: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <476E9A01.80404@voidspace.org.uk> (Sorry to reply to this one - lost the original.) Resolver is based on IronPython 1.1 - and in our test suite we have a set of IronPython bug tests for bugs that have affected us and that we have had to work around. Fixing these would be great. These include (note that the tests all pass - they will fail as soon as the bugs are fixed so that we know to remove our workarounds. To see the correct behaviour you should reverse the asserts): def testExceptionRaisedInWrongPlace(self): class AttributeTest(object): def __getattr__(self, name): raise AttributeError('wibble') try: AttributeTest().fish except AttributeError, a: self.assertEquals(a.msg, 'fish', "AttributeError fixed") def testGetAttr(self): class Broken(object): def __getattr__(self, name): raise AttributeError(name) try: Broken().__gt__ except AttributeError: pass else: self.fail("IronPython bug fixed") def testComparingClrObjects(self): self.assertNotEquals([Color.Red], [Color.Red], "IronPython has fixed comparing clr objects in lists.") def testComparingSingles(self): self.assertFalse(1 <= Single(2.0) <= 3, "IronPython bug fixed.") def testCallableWithKWArgs(self): # IronPython bug #8246 class F(object): def __call__(self, *args, **kwargs): print args, kwargs f = F() # Search for __call__ to find workarounds for this problem - as of this writing # there is at least one use in Listener.wrap() self.assertRaises(Exception, lambda : f(*(1,), **{'a' : 23})) def testConvertFloatToLongAndFloat(self): self.assertFalse(hasattr(5.0, "__float__"), "Floats now have a __float__ attribute") self.assertFalse(hasattr(5.0, "__long__"), "Floats now have a __long__ attribute") One that affects our user code: "Array doesn't have methods w/o importing clr" - Item # 11971 We would love to see all these bugs fixed in the stable version of IronPython. :-) Many of these are fixed in IP 2 already. Many Thanks Michael Foord http://www.manning.com/foord HEMMI, Shigeru wrote: > Hello, > > If the bug, > http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2007-February/004500.html > is fixed or somebody shows me a good example how to inherit "file" > class in IronPython > 1.1, I will be happy. > > 2nd, please provide quit() function, which eases my interactive > IronPython session. > > Regards, > > > > > 2007/12/18, Dino Viehland : > >> >> >> Are there any particular bugs you'd like to see fixed in IronPython 1.1.1? >> >> >> >> We're planning on updating the 1.1 release w/ a targeted set of bug fixes. >> Unfortunately we've started to use the CodePlex bug list to track primarily >> 2.0 bugs. We can still use this to find the highest ranked bugs that aren't >> fixed in v1.1 and target those to be back ported ? but it's possible we >> might miss something important. So I'd thought I'd ask: what do you want >> fixed? >> >> >> >> Note the idea here is to keep these fixes small and keep the release stable, >> so please no fix "type(type) is type" J. And of course if you don't know >> how bad it'll be feel free to suggest it anyway. Thanks! >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> >> > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From fuzzyman at voidspace.org.uk Sun Dec 23 19:08:40 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 23 Dec 2007 18:08:40 +0000 Subject: [IronPython] [python] IP 2.0 Alpha 7 embedding In-Reply-To: References: Message-ID: <476EA428.2020302@voidspace.org.uk> Hello Slide, If you don't mind I will post this example to the IronPython Cookbook! Thanks Michael Slide wrote: > I have come up with an example (very simple) of embedding IP 2.0 into > a C# app and doing back and forth handling of objects (objects > declared in Python and object declared in C#). I am interested to know > if I am doing some things the best way as I've just been going kind of > hit and miss. Can someone do a little critiquing of this code and see > if I am being dumb? The windows app has two RichTextBoxes on it (one > for input, the other for output), a clear button and a "go" button. > When the "go" button is pressed, it writes the source out to a temp > file and then creates the object instance from the script. Thanks! > > > Here is the code: > > > test.py > ============================================ > import TestLib, unittest > > def Print(message): > output.AppendText("%s\r\n" % message) > > class Test(TestLib.ITest): > def Print(self, message): > output.AppendText("%s\r\n" % message) > > Print("Hello, world!") > > > > > ITestLib.cs located in TestLib.dll > ========================================== > using System; > using System.Collections.Generic; > using System.Text; > > namespace TestLib > { > public interface ITest > { > void Print(string message); > } > } > > > > MainForm.cs located in IPEmbed.exe which references TestLib.dll > ============================================ > using System; > using System.Collections.Generic; > using System.ComponentModel; > using System.Data; > using System.Drawing; > using System.Text; > using System.IO; > using System.Windows.Forms; > > using Microsoft.Scripting; > using Microsoft.Scripting.Hosting; > > using IronPython.Runtime; > using IronPython.Hosting; > > namespace IPEmbed > { > public partial class Form1 : Form > { > private ScriptScope __main__; > private LanguageContext _context; > > public Form1() > { > InitializeComponent(); > > _context = LanguageContext.FromEngine(PythonEngine.CurrentEngine); > _context.SetScriptSourceSearchPaths(new string[] { > Environment.CurrentDirectory, > Path.Combine(Environment.CurrentDirectory, "Lib") }); > } > > // sets up the script engine, etc > private void go_Click(object sender, EventArgs e) > { > ScriptDomainManager.CurrentManager.Host.DefaultModule.ClearVariables(); > > if (input.Text.Length == 0) > return; > > string filepath = Path.GetTempFileName(); > File.WriteAllText(filepath, input.Text); > > __main__ = > ScriptDomainManager.CurrentManager.CompileModule("__main__", > SourceUnit.CreateFileUnit(_context, filepath)); > ScriptDomainManager.CurrentManager.PublishModule(__main__, > "__main__"); > > Microsoft.Scripting.ClrModule.GetInstance().AddReference("TestLib"); > __main__.SetVariable("output", output); > __main__.Execute(); > > TestLib.ITest test = CreateInstanceFromInterface(); > if (test != null) > test.Print("Hello, world!"); > } > > // this method will find a class in the python code that > implements a given interface and create and instance > // of that class, returning it as the interface > private T CreateInstanceFromInterface() > { > T result = default(T); > > IAttributesCollection attrs = > IronPython.Runtime.Types.PythonModuleOps.Get__dict__(__main__); > foreach (KeyValuePair attr in attrs) > { > IronPython.Runtime.Types.PythonType attr_type = > attr.Value as IronPython.Runtime.Types.PythonType; > > if (attr_type != null) > { > foreach (IronPython.Runtime.Types.PythonType dt in > attr_type.BaseTypes) > { > if (dt.UnderlyingSystemType != null && > dt.UnderlyingSystemType == typeof(T)) > { > CodeContext context = new > CodeContext(__main__.Scope, _context, new ModuleContext(__main__)); > result = (T)attr_type.CreateInstance(context); > break; > } > } > } > } > return result; > } > > private void clear_Click(object sender, EventArgs e) > { > output.Clear(); > } > } > } > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From slide.o.mix at gmail.com Sun Dec 23 22:07:33 2007 From: slide.o.mix at gmail.com (Slide) Date: Sun, 23 Dec 2007 14:07:33 -0700 Subject: [IronPython] [python] IP 2.0 Alpha 7 embedding In-Reply-To: <476EA428.2020302@voidspace.org.uk> References: <476EA428.2020302@voidspace.org.uk> Message-ID: I don't mind at all, I just hope that is the way it is supposed to be done :) Thanks, slide On Dec 23, 2007 11:08 AM, Michael Foord wrote: > Hello Slide, > > If you don't mind I will post this example to the IronPython Cookbook! > > Thanks > > Michael > > > Slide wrote: > > I have come up with an example (very simple) of embedding IP 2.0 into > > a C# app and doing back and forth handling of objects (objects > > declared in Python and object declared in C#). I am interested to know > > if I am doing some things the best way as I've just been going kind of > > hit and miss. Can someone do a little critiquing of this code and see > > if I am being dumb? The windows app has two RichTextBoxes on it (one > > for input, the other for output), a clear button and a "go" button. > > When the "go" button is pressed, it writes the source out to a temp > > file and then creates the object instance from the script. Thanks! > > > > > > Here is the code: > > > > > > test.py > > ============================================ > > import TestLib, unittest > > > > def Print(message): > > output.AppendText("%s\r\n" % message) > > > > class Test(TestLib.ITest): > > def Print(self, message): > > output.AppendText("%s\r\n" % message) > > > > Print("Hello, world!") > > > > > > > > > > ITestLib.cs located in TestLib.dll > > ========================================== > > using System; > > using System.Collections.Generic; > > using System.Text; > > > > namespace TestLib > > { > > public interface ITest > > { > > void Print(string message); > > } > > } > > > > > > > > MainForm.cs located in IPEmbed.exe which references TestLib.dll > > ============================================ > > using System; > > using System.Collections.Generic; > > using System.ComponentModel; > > using System.Data; > > using System.Drawing; > > using System.Text; > > using System.IO; > > using System.Windows.Forms; > > > > using Microsoft.Scripting; > > using Microsoft.Scripting.Hosting; > > > > using IronPython.Runtime; > > using IronPython.Hosting; > > > > namespace IPEmbed > > { > > public partial class Form1 : Form > > { > > private ScriptScope __main__; > > private LanguageContext _context; > > > > public Form1() > > { > > InitializeComponent(); > > > > _context = LanguageContext.FromEngine(PythonEngine.CurrentEngine); > > _context.SetScriptSourceSearchPaths(new string[] { > > Environment.CurrentDirectory, > > Path.Combine(Environment.CurrentDirectory, "Lib") }); > > } > > > > // sets up the script engine, etc > > private void go_Click(object sender, EventArgs e) > > { > > ScriptDomainManager.CurrentManager.Host.DefaultModule.ClearVariables(); > > > > if (input.Text.Length == 0) > > return; > > > > string filepath = Path.GetTempFileName(); > > File.WriteAllText(filepath, input.Text); > > > > __main__ = > > ScriptDomainManager.CurrentManager.CompileModule("__main__", > > SourceUnit.CreateFileUnit(_context, filepath)); > > ScriptDomainManager.CurrentManager.PublishModule(__main__, > > "__main__"); > > > > Microsoft.Scripting.ClrModule.GetInstance().AddReference("TestLib"); > > __main__.SetVariable("output", output); > > __main__.Execute(); > > > > TestLib.ITest test = CreateInstanceFromInterface(); > > if (test != null) > > test.Print("Hello, world!"); > > } > > > > // this method will find a class in the python code that > > implements a given interface and create and instance > > // of that class, returning it as the interface > > private T CreateInstanceFromInterface() > > { > > T result = default(T); > > > > IAttributesCollection attrs = > > IronPython.Runtime.Types.PythonModuleOps.Get__dict__(__main__); > > foreach (KeyValuePair attr in attrs) > > { > > IronPython.Runtime.Types.PythonType attr_type = > > attr.Value as IronPython.Runtime.Types.PythonType; > > > > if (attr_type != null) > > { > > foreach (IronPython.Runtime.Types.PythonType dt in > > attr_type.BaseTypes) > > { > > if (dt.UnderlyingSystemType != null && > > dt.UnderlyingSystemType == typeof(T)) > > { > > CodeContext context = new > > CodeContext(__main__.Scope, _context, new ModuleContext(__main__)); > > result = (T)attr_type.CreateInstance(context); > > break; > > } > > } > > } > > } > > return result; > > } > > > > private void clear_Click(object sender, EventArgs e) > > { > > output.Clear(); > > } > > } > > } > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From fuzzyman at voidspace.org.uk Sun Dec 23 22:15:58 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 23 Dec 2007 21:15:58 +0000 Subject: [IronPython] [python] IP 2.0 Alpha 7 embedding In-Reply-To: References: <476EA428.2020302@voidspace.org.uk> Message-ID: <476ED00E.4010701@voidspace.org.uk> Slide wrote: > I don't mind at all, I just hope that is the way it is supposed to be done :) > > Cool - thanks. When I post it I'll give you any feedback I can come up with. :-) Michael > Thanks, > > slide > > On Dec 23, 2007 11:08 AM, Michael Foord wrote: > >> Hello Slide, >> >> If you don't mind I will post this example to the IronPython Cookbook! >> >> Thanks >> >> Michael >> >> >> Slide wrote: >> >>> I have come up with an example (very simple) of embedding IP 2.0 into >>> a C# app and doing back and forth handling of objects (objects >>> declared in Python and object declared in C#). I am interested to know >>> if I am doing some things the best way as I've just been going kind of >>> hit and miss. Can someone do a little critiquing of this code and see >>> if I am being dumb? The windows app has two RichTextBoxes on it (one >>> for input, the other for output), a clear button and a "go" button. >>> When the "go" button is pressed, it writes the source out to a temp >>> file and then creates the object instance from the script. Thanks! >>> >>> >>> Here is the code: >>> >>> >>> test.py >>> ============================================ >>> import TestLib, unittest >>> >>> def Print(message): >>> output.AppendText("%s\r\n" % message) >>> >>> class Test(TestLib.ITest): >>> def Print(self, message): >>> output.AppendText("%s\r\n" % message) >>> >>> Print("Hello, world!") >>> >>> >>> >>> >>> ITestLib.cs located in TestLib.dll >>> ========================================== >>> using System; >>> using System.Collections.Generic; >>> using System.Text; >>> >>> namespace TestLib >>> { >>> public interface ITest >>> { >>> void Print(string message); >>> } >>> } >>> >>> >>> >>> MainForm.cs located in IPEmbed.exe which references TestLib.dll >>> ============================================ >>> using System; >>> using System.Collections.Generic; >>> using System.ComponentModel; >>> using System.Data; >>> using System.Drawing; >>> using System.Text; >>> using System.IO; >>> using System.Windows.Forms; >>> >>> using Microsoft.Scripting; >>> using Microsoft.Scripting.Hosting; >>> >>> using IronPython.Runtime; >>> using IronPython.Hosting; >>> >>> namespace IPEmbed >>> { >>> public partial class Form1 : Form >>> { >>> private ScriptScope __main__; >>> private LanguageContext _context; >>> >>> public Form1() >>> { >>> InitializeComponent(); >>> >>> _context = LanguageContext.FromEngine(PythonEngine.CurrentEngine); >>> _context.SetScriptSourceSearchPaths(new string[] { >>> Environment.CurrentDirectory, >>> Path.Combine(Environment.CurrentDirectory, "Lib") }); >>> } >>> >>> // sets up the script engine, etc >>> private void go_Click(object sender, EventArgs e) >>> { >>> ScriptDomainManager.CurrentManager.Host.DefaultModule.ClearVariables(); >>> >>> if (input.Text.Length == 0) >>> return; >>> >>> string filepath = Path.GetTempFileName(); >>> File.WriteAllText(filepath, input.Text); >>> >>> __main__ = >>> ScriptDomainManager.CurrentManager.CompileModule("__main__", >>> SourceUnit.CreateFileUnit(_context, filepath)); >>> ScriptDomainManager.CurrentManager.PublishModule(__main__, >>> "__main__"); >>> >>> Microsoft.Scripting.ClrModule.GetInstance().AddReference("TestLib"); >>> __main__.SetVariable("output", output); >>> __main__.Execute(); >>> >>> TestLib.ITest test = CreateInstanceFromInterface(); >>> if (test != null) >>> test.Print("Hello, world!"); >>> } >>> >>> // this method will find a class in the python code that >>> implements a given interface and create and instance >>> // of that class, returning it as the interface >>> private T CreateInstanceFromInterface() >>> { >>> T result = default(T); >>> >>> IAttributesCollection attrs = >>> IronPython.Runtime.Types.PythonModuleOps.Get__dict__(__main__); >>> foreach (KeyValuePair attr in attrs) >>> { >>> IronPython.Runtime.Types.PythonType attr_type = >>> attr.Value as IronPython.Runtime.Types.PythonType; >>> >>> if (attr_type != null) >>> { >>> foreach (IronPython.Runtime.Types.PythonType dt in >>> attr_type.BaseTypes) >>> { >>> if (dt.UnderlyingSystemType != null && >>> dt.UnderlyingSystemType == typeof(T)) >>> { >>> CodeContext context = new >>> CodeContext(__main__.Scope, _context, new ModuleContext(__main__)); >>> result = (T)attr_type.CreateInstance(context); >>> break; >>> } >>> } >>> } >>> } >>> return result; >>> } >>> >>> private void clear_Click(object sender, EventArgs e) >>> { >>> output.Clear(); >>> } >>> } >>> } >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.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 daftspaniel at gmail.com Sun Dec 23 23:15:56 2007 From: daftspaniel at gmail.com (Davy Mitchell) Date: Sun, 23 Dec 2007 22:15:56 +0000 Subject: [IronPython] [python] Difference in 1.1 and 2.0 with Dialog Result In-Reply-To: <476E9541.7010209@voidspace.org.uk> References: <20253b0c0712230620id6cdae1n4e99fe03374de04b@mail.gmail.com> <476E9541.7010209@voidspace.org.uk> Message-ID: <20253b0c0712231415i14aa567dt293289a4a36c7c7c@mail.gmail.com> Yes my initial code was flat wrong :-) I was using if fbd.ShowDialog(): etc... For reference, the IPY1.1 result: >>> bool(DialogResult.OK) False >>> DialogResult.OK.value__ 1 > but it is still odd that this enumeration now evaluates to False. Yes, very odd but I guess it is never safe to rely on the value of an enum. Davy On Dec 23, 2007 5:05 PM, Michael Foord wrote: > Davy Mitchell wrote: > > import clr > > clr.AddReference('System.Windows.Forms') > > from System.Windows.Forms import DialogResult > > if DialogResult.OK: > > print "Boo!" > > > > The above prints Boo! in 1.1 and early 2.0 Alphas i.e. DialogResult.OK > > resolves to TRUE. > > > > A6 and A7 (didn't try any others!) nothing is printed i.e. > > DialogResult.OK resolves to FALSE. > > > > Now, I am changing my dialog code anyway but is this a deliberate change? > > > > > > Hmm.. (IP2.0 A7) > > >>> import clr > >>> clr.AddReference('System.Windows.Forms') > >>> from System.Windows.Forms import DialogResult > >>> bool(DialogResult.OK) > False > >>> DialogResult.OK.value__ > 1 > > Odd. > > Of course the right thing to be doing is: > > if result == DialogResult.OK: > > but it is still odd that this enumeration now evaluates to False. > > Michael > http://www.manning.com/foord > > Cheers, > > Davy > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Davy Mitchell Blog - http://www.latedecember.co.uk/sites/personal/davy/ Twitter - http://twitter.com/daftspaniel Skype - daftspaniel needgod.com From chenrong2003 at gmail.com Mon Dec 24 08:47:14 2007 From: chenrong2003 at gmail.com (=?GB2312?B?TmVpbCjEvtKwuvwp?=) Date: Mon, 24 Dec 2007 15:47:14 +0800 Subject: [IronPython] How about IronPython for ASP.NET? Message-ID: <26756bf60712232347i338c8d2aoe04b291ca0471223@mail.gmail.com> Hello, IronPython team, I'm quite interested in IronPython for ASP.NET, but after the CTP release in last year, it seems that the project has stopped to move on. From a thread in this mailing list I know there are some bugs on static compilation. But what about other ways? Do you have any plan about IronPython with ASP.NETcombination in the near future ? Thanks very much. -------------- next part -------------- An HTML attachment was scrubbed... URL: From empirebuilder at gmail.com Mon Dec 24 09:40:16 2007 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Mon, 24 Dec 2007 10:40:16 +0200 Subject: [IronPython] How about IronPython for ASP.NET? In-Reply-To: <26756bf60712232347i338c8d2aoe04b291ca0471223@mail.gmail.com> References: <26756bf60712232347i338c8d2aoe04b291ca0471223@mail.gmail.com> Message-ID: <8cd017b80712240040q4baf1531g9a675d1e02c58066@mail.gmail.com> Hi Neil, Download ASP.Net 3.5 web extension or Asp.Net Futures July CTP. You can find the DLR based IronPython for ASP.Net in those packages. Dody G. On Dec 24, 2007 9:47 AM, Neil(???) wrote: > Hello, IronPython team, > > I'm quite interested in IronPython for ASP.NET, but after the CTP > release in last year, it seems that the project has stopped to move on. From > a thread in this mailing list I know there are some bugs on static > compilation. But what about other ways? Do you have any plan about > IronPython with ASP.NET combination in the near future ? > > Thanks very much. > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From chenrong2003 at gmail.com Mon Dec 24 09:54:23 2007 From: chenrong2003 at gmail.com (=?GB2312?B?TmVpbCjEvtKwuvwp?=) Date: Mon, 24 Dec 2007 16:54:23 +0800 Subject: [IronPython] How about IronPython for ASP.NET? In-Reply-To: <8cd017b80712240040q4baf1531g9a675d1e02c58066@mail.gmail.com> References: <26756bf60712232347i338c8d2aoe04b291ca0471223@mail.gmail.com> <8cd017b80712240040q4baf1531g9a675d1e02c58066@mail.gmail.com> Message-ID: <26756bf60712240054u434f9686h87b0ec6ed32742be@mail.gmail.com> Thanks Dody, I'm going to try it now :) Neil Chen 2007/12/24, Dody Gunawinata : > > Hi Neil, > > Download ASP.Net 3.5 web extension or Asp.Net Futures July CTP. You can > find the DLR based IronPython for ASP.Net in those packages. > > Dody G. > > On Dec 24, 2007 9:47 AM, Neil(???) < chenrong2003 at gmail.com> wrote: > > > Hello, IronPython team, > > > > I'm quite interested in IronPython for ASP.NET , but > > after the CTP release in last year, it seems that the project has stopped to > > move on. From a thread in this mailing list I know there are some bugs on > > static compilation. But what about other ways? Do you have any plan about > > IronPython with ASP.NET combination in the near future > > ? > > > > Thanks very much. > > > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > -- > nomadlife.org > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidjensen at usa.net Tue Dec 25 21:02:11 2007 From: davidjensen at usa.net (David Jensen) Date: Tue, 25 Dec 2007 15:02:11 -0500 Subject: [IronPython] Users Digest, Vol 41, Issue 26 Message-ID: <274LLyuBL6620S03.1198612931@cmsweb03.cms.usa.net> I have not tried this yet, but this is very important. ------ Original Message ------ Received: Mon, 24 Dec 2007 04:52:51 PM EST From: users-request at lists.ironpython.com To: users at lists.ironpython.com Subject: Users Digest, Vol 41, Issue 26 > Send Users mailing list submissions to > users at lists.ironpython.com > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > or, via email, send a message with subject or body 'help' to > users-request at lists.ironpython.com > > You can reach the person managing the list at > users-owner at lists.ironpython.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Users digest..." > > > Today's Topics: > > 1. Re: [python] Difference in 1.1 and 2.0 with Dialog Result > (Davy Mitchell) > 2. How about IronPython for ASP.NET? ( Neil(???) ) > 3. Re: How about IronPython for ASP.NET? (Dody Gunawinata) > 4. Re: How about IronPython for ASP.NET? ( Neil(???) ) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sun, 23 Dec 2007 22:15:56 +0000 > From: "Davy Mitchell" > Subject: Re: [IronPython] [python] Difference in 1.1 and 2.0 with > Dialog Result > To: "Discussion of IronPython" > Message-ID: > <20253b0c0712231415i14aa567dt293289a4a36c7c7c at mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > Yes my initial code was flat wrong :-) > > I was using > if fbd.ShowDialog(): > etc... > > For reference, the IPY1.1 result: > >>> bool(DialogResult.OK) > False > >>> DialogResult.OK.value__ > 1 > > > but it is still odd that this enumeration now evaluates to False. > Yes, very odd but I guess it is never safe to rely on the value of an enum. > > Davy > > On Dec 23, 2007 5:05 PM, Michael Foord wrote: > > Davy Mitchell wrote: > > > import clr > > > clr.AddReference('System.Windows.Forms') > > > from System.Windows.Forms import DialogResult > > > if DialogResult.OK: > > > print "Boo!" > > > > > > The above prints Boo! in 1.1 and early 2.0 Alphas i.e. DialogResult.OK > > > resolves to TRUE. > > > > > > A6 and A7 (didn't try any others!) nothing is printed i.e. > > > DialogResult.OK resolves to FALSE. > > > > > > Now, I am changing my dialog code anyway but is this a deliberate change? > > > > > > > > > > Hmm.. (IP2.0 A7) > > > > >>> import clr > > >>> clr.AddReference('System.Windows.Forms') > > >>> from System.Windows.Forms import DialogResult > > >>> bool(DialogResult.OK) > > False > > >>> DialogResult.OK.value__ > > 1 > > > > Odd. > > > > Of course the right thing to be doing is: > > > > if result == DialogResult.OK: > > > > but it is still odd that this enumeration now evaluates to False. > > > > Michael > > http://www.manning.com/foord > > > Cheers, > > > Davy > > > > > > > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > -- > Davy Mitchell > Blog - http://www.latedecember.co.uk/sites/personal/davy/ > Twitter - http://twitter.com/daftspaniel > Skype - daftspaniel needgod.com > > > ------------------------------ > > Message: 2 > Date: Mon, 24 Dec 2007 15:47:14 +0800 > From: " Neil(???) " > Subject: [IronPython] How about IronPython for ASP.NET? > To: "Discussion of IronPython" > Message-ID: > <26756bf60712232347i338c8d2aoe04b291ca0471223 at mail.gmail.com> > Content-Type: text/plain; charset="iso-8859-1" > > Hello, IronPython team, > > I'm quite interested in IronPython for ASP.NET, but after the CTP release in > last year, it seems that the project has stopped to move on. From a thread > in this mailing list I know there are some bugs on static compilation. But > what about other ways? Do you have any plan about IronPython with > ASP.NETcombination in the near future ? > > Thanks very much. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20071224/6c440759/attachment.html > > ------------------------------ > > Message: 3 > Date: Mon, 24 Dec 2007 10:40:16 +0200 > From: "Dody Gunawinata" > Subject: Re: [IronPython] How about IronPython for ASP.NET? > To: "Discussion of IronPython" > Message-ID: > <8cd017b80712240040q4baf1531g9a675d1e02c58066 at mail.gmail.com> > Content-Type: text/plain; charset="iso-2022-jp" > > Hi Neil, > > Download ASP.Net 3.5 web extension or Asp.Net Futures July CTP. You can find > the DLR based IronPython for ASP.Net in those packages. > > Dody G. > > On Dec 24, 2007 9:47 AM, Neil(???) wrote: > > > Hello, IronPython team, > > > > I'm quite interested in IronPython for ASP.NET, but after the CTP > > release in last year, it seems that the project has stopped to move on. From > > a thread in this mailing list I know there are some bugs on static > > compilation. But what about other ways? Do you have any plan about > > IronPython with ASP.NET combination in the near future ? > > > > Thanks very much. > > > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > -- > nomadlife.org > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20071224/e04f9564/attachment.html > > ------------------------------ > > Message: 4 > Date: Mon, 24 Dec 2007 16:54:23 +0800 > From: " Neil(???) " > Subject: Re: [IronPython] How about IronPython for ASP.NET? > To: dody at nomadlife.org, "Discussion of IronPython" > > Message-ID: > <26756bf60712240054u434f9686h87b0ec6ed32742be at mail.gmail.com> > Content-Type: text/plain; charset="gb2312" > > Thanks Dody, I'm going to try it now :) > > Neil Chen > > > 2007/12/24, Dody Gunawinata : > > > > Hi Neil, > > > > Download ASP.Net 3.5 web extension or Asp.Net Futures July CTP. You can > > find the DLR based IronPython for ASP.Net in those packages. > > > > Dody G. > > > > On Dec 24, 2007 9:47 AM, Neil(???) < chenrong2003 at gmail.com> wrote: > > > > > Hello, IronPython team, > > > > > > I'm quite interested in IronPython for ASP.NET , but > > > after the CTP release in last year, it seems that the project has stopped to > > > move on. From a thread in this mailing list I know there are some bugs on > > > static compilation. But what about other ways? Do you have any plan about > > > IronPython with ASP.NET combination in the near future > > > ? > > > > > > Thanks very much. > > > > > > > > > _______________________________________________ > > > Users mailing list > > > Users at lists.ironpython.com > > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > > > > > > > -- > > nomadlife.org > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20071224/ea318462/attachment-0001.htm > > ------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > End of Users Digest, Vol 41, Issue 26 > ************************************* > From jfletcher007 at gmail.com Wed Dec 26 18:32:09 2007 From: jfletcher007 at gmail.com (John Fletcher) Date: Wed, 26 Dec 2007 18:32:09 +0100 Subject: [IronPython] *.pyd files usage in Iron python Message-ID: <646b8f570712260932q6d134951x9afa0311069142f0@mail.gmail.com> All, I am trying to port the existing Python code to Iron python. To use most of the existing python functionalities , I have a path to the python installation(ie C:\python24\lib) in my *.py files. With this I am able to import all the python libraries like "os", "clr" etc., But if I try to import the libraries in *.pyd file, my execution complains about its non-existence (eg: win32file, win32net, though they are present in C:\python24\lib\site-packages\win32 ). Could any one let me know, how to deal with it ? or where can I get the corresponding *.py files ? Cheers, John -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Wed Dec 26 18:45:10 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 26 Dec 2007 17:45:10 +0000 Subject: [IronPython] [python] *.pyd files usage in Iron python In-Reply-To: <646b8f570712260932q6d134951x9afa0311069142f0@mail.gmail.com> References: <646b8f570712260932q6d134951x9afa0311069142f0@mail.gmail.com> Message-ID: <47729326.3080803@voidspace.org.uk> John Fletcher wrote: > All, > > I am trying to port the existing Python code to Iron python. To use > most of the existing python functionalities , I have a path to the > python installation(ie C:\python24\lib) in my *.py files. With this I > am able to import all the python libraries like "os", "clr" etc., But > if I try to import the libraries in *.pyd file, my execution complains > about its non-existence (eg: win32file, win32net, though they are > present in C:\python24\lib\site-packages\win32 ). > > Could any one let me know, how to deal with it ? or where can I get > the corresponding *.py files ? From the FAQ ( http://www.codeplex.com/WorkItem/AttachmentDownload.ashx?ProjectName=IronPython&WorkItemId=2731&FileAttachmentId=869 - why is this a download?): Q: How do I build and call into PYD libraries? A: IronPython does not support using PYDs built for CPython since they leverage implementation details of CPython. You can get a similar effect for new "PYD"s you would like to implement by writing them in C# or VB and building a DLL for .NET. There is one approach - but really you are better off looking for native ways of doing what you need from IronPython: http://www.voidspace.org.uk/ironpython/cpython_extensions.shtml Michael http://www.manning.com/foord > > Cheers, > John > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From jfletcher007 at gmail.com Wed Dec 26 20:50:57 2007 From: jfletcher007 at gmail.com (John Fletcher) Date: Wed, 26 Dec 2007 20:50:57 +0100 Subject: [IronPython] [python] *.pyd files usage in Iron python In-Reply-To: <47729326.3080803@voidspace.org.uk> References: <646b8f570712260932q6d134951x9afa0311069142f0@mail.gmail.com> <47729326.3080803@voidspace.org.uk> Message-ID: <646b8f570712261150j12f25dd7m174d0129148eda94@mail.gmail.com> Thanks Michael for your reply. I tried the approach mentioned in http://www.voidspace.org.uk/ironpython/cpython_extensions.shtml and added a new function in the cext.py to call the win32 extensions: *def createFilexx(): print "Before Importing Win32File" import win32file print " Importing Win32File - Success" x = win32file.CreateFile("C:/john_text.txt",0,0,None,2,3,None) print " Creation of file - Success" * In the command prompt, I executed the following as follows: >>> import sys >>> sys.path.append("C:\Documents and Settings\john\Desktop\cext- ironpy-0.1.4 \cext-ironpy-0.1.4") >>> sys.path.append("C:\Program Files\Python24\Lib") >>> sys.path.append("C:\Program Files\Python24\Lib\site-packages\win32") >>> import cext >>> cext.install() >>> cext.createFilexx() Loading the module win32file FileName C:\Program Files\Python24\Lib\site-packages\win32\win32file.pyd Traceback (most recent call last): File , line 0, in ##206 File , line 0, in _stub_##145 File C:\Documents and Settings\john\Desktop\cext- ironpy-0.1.4\cext-ironpy-0 .1.4\cext.py, line 41, in createFilexx File , line 0, in _stub_##346 File , line 0, in _stub_##347 File , line 0, in _stub_##348 File embedding, line unknown, in f File C:\Documents and Settings\john\Desktop\cext- ironpy-0.1.4\cext-ironpy-0 .1.4\embedding.py, line 36, in f File , line 0, in _stub_##307 File embedding, line unknown, in f File C:\Documents and Settings\john\Desktop\cext- ironpy-0.1.4\cext-ironpy-0 .1.4\embedding.py, line 48, in f File , line 0, in _stub_##331 File C:\Documents and Settings\john\Desktop\cext- ironpy-0.1.4\cext-ironpy-0 .1.4\embedding.py, line 95, in PyExcConvert File , line 0, in _stub_##375 File , line 0, in _stub_##376 File C:\Program Files\Python24\Lib\ihooks.py, line 403, in import_module File , line 0, in _stub_##218 File , line 0, in _stub_##219 File C:\Program Files\Python24\Lib\ihooks.py, line 447, in find_head_package *ImportError: No module named pywintypes* In this context, I want to know, if this cextension module has any known caveats wrt Win types ? Cheers, John On Dec 26, 2007 6:45 PM, Michael Foord wrote: > John Fletcher wrote: > > All, > > > > I am trying to port the existing Python code to Iron python. To use > > most of the existing python functionalities , I have a path to the > > python installation(ie C:\python24\lib) in my *.py files. With this I > > am able to import all the python libraries like "os", "clr" etc., But > > if I try to import the libraries in *.pyd file, my execution complains > > about its non-existence (eg: win32file, win32net, though they are > > present in C:\python24\lib\site-packages\win32 ). > > > > Could any one let me know, how to deal with it ? or where can I get > > the corresponding *.py files ? > > From the FAQ ( > > http://www.codeplex.com/WorkItem/AttachmentDownload.ashx?ProjectName=IronPython&WorkItemId=2731&FileAttachmentId=869 > - why is this a download?): > > Q: How do I build and call into PYD libraries? > > A: IronPython does not support using PYDs built for CPython since they > leverage implementation details of CPython. You can get a similar > effect for new "PYD"s you would like to implement by writing them in C# > or VB and building a DLL for .NET. > > There is one approach - but really you are better off looking for native > ways of doing what you need from IronPython: > > http://www.voidspace.org.uk/ironpython/cpython_extensions.shtml > > Michael > http://www.manning.com/foord > > > > > > Cheers, > > John > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Wed Dec 26 20:58:16 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 26 Dec 2007 19:58:16 +0000 Subject: [IronPython] [python] *.pyd files usage in Iron python In-Reply-To: <646b8f570712261150j12f25dd7m174d0129148eda94@mail.gmail.com> References: <646b8f570712260932q6d134951x9afa0311069142f0@mail.gmail.com> <47729326.3080803@voidspace.org.uk> <646b8f570712261150j12f25dd7m174d0129148eda94@mail.gmail.com> Message-ID: <4772B258.9090905@voidspace.org.uk> John Fletcher wrote: > Thanks Michael for your reply. > > I tried the approach mentioned in > http://www.voidspace.org.uk/ironpython/cpython_extensions.shtml > and > added a new function in the cext.py to call the win32 extensions: I will take a look at this and report back. In general though the win32 modules should be the *easiest* ones to port to .NET as the win32 functionality is almost always exposed by .NET. Michael http://www.manning.com/foord > > *def createFilexx(): > print "Before Importing Win32File" > import win32file > print " Importing Win32File - Success" > x = > win32file.CreateFile("C:/john_text.txt",0,0,None,2,3,None) > > print " Creation of file - Success" > * > In the command prompt, I executed the following as follows: > > >>> import sys > >>> sys.path.append("C:\Documents and > Settings\john\Desktop\cext-ironpy-0.1.4 > \cext-ironpy-0.1.4") > >>> sys.path.append("C:\Program Files\Python24\Lib") > >>> sys.path.append("C:\Program Files\Python24\Lib\site-packages\win32") > >>> import cext > >>> cext.install() > >>> cext.createFilexx() > Loading the module win32file > FileName C:\Program Files\Python24\Lib\site-packages\win32\win32file.pyd > Traceback (most recent call last): > File , line 0, in ##206 > File , line 0, in _stub_##145 > File C:\Documents and Settings\john\Desktop\cext- > ironpy-0.1.4\cext-ironpy-0 > .1.4\cext.py, line 41, in createFilexx > File , line 0, in _stub_##346 > File , line 0, in _stub_##347 > File , line 0, in _stub_##348 > File embedding, line unknown, in f > File C:\Documents and Settings\john\Desktop\cext- > ironpy-0.1.4\cext-ironpy-0 > .1.4\embedding.py, line 36, in f > File , line 0, in _stub_##307 > File embedding, line unknown, in f > File C:\Documents and > Settings\john\Desktop\cext-ironpy-0.1.4\cext-ironpy-0 > .1.4\embedding.py, line 48, in f > File , line 0, in _stub_##331 > File C:\Documents and > Settings\john\Desktop\cext-ironpy-0.1.4\cext-ironpy-0 > .1.4\embedding.py, line 95, in PyExcConvert > File , line 0, in _stub_##375 > File , line 0, in _stub_##376 > File C:\Program Files\Python24\Lib\ihooks.py, line 403, in import_module > File , line 0, in _stub_##218 > File , line 0, in _stub_##219 > File C:\Program Files\Python24\Lib\ihooks.py, line 447, in > find_head_package > *ImportError: No module named pywintypes* > > In this context, I want to know, if this cextension module has any > known caveats wrt Win types ? > > Cheers, > John > > On Dec 26, 2007 6:45 PM, Michael Foord < fuzzyman at voidspace.org.uk > > wrote: > > John Fletcher wrote: > > All, > > > > I am trying to port the existing Python code to Iron python. To use > > most of the existing python functionalities , I have a path to the > > python installation(ie C:\python24\lib) in my *.py files. With > this I > > am able to import all the python libraries like "os", "clr" > etc., But > > if I try to import the libraries in *.pyd file, my execution > complains > > about its non-existence (eg: win32file, win32net, though they are > > present in C:\python24\lib\site-packages\win32 ). > > > > Could any one let me know, how to deal with it ? or where can I get > > the corresponding *.py files ? > > From the FAQ ( > http://www.codeplex.com/WorkItem/AttachmentDownload.ashx?ProjectName=IronPython&WorkItemId=2731&FileAttachmentId=869 > > - why is this a download?): > > Q: How do I build and call into PYD libraries? > > A: IronPython does not support using PYDs built for CPython since they > leverage implementation details of CPython. You can get a similar > effect for new "PYD"s you would like to implement by writing them > in C# > or VB and building a DLL for .NET. > > There is one approach - but really you are better off looking for > native > ways of doing what you need from IronPython: > > http://www.voidspace.org.uk/ironpython/cpython_extensions.shtml > > Michael > http://www.manning.com/foord > > > > > > Cheers, > > John > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.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 daftspaniel at gmail.com Wed Dec 26 22:48:13 2007 From: daftspaniel at gmail.com (Davy Mitchell) Date: Wed, 26 Dec 2007 21:48:13 +0000 Subject: [IronPython] Import Performance Message-ID: <20253b0c0712261348o25ec725fyc6a1737fa480f099@mail.gmail.com> I was curious as to why one of my apps was taking so long to start up. Sure it loaded up some RSS feeds but it shouldn't take *that* long. Anyway turns out to be 4-5 seconds importing configobj import datetime print datetime.datetime.now() from configobj import ConfigObj print datetime.datetime.now() Repeated with consistent results in seconds: IPY2.0 4.0 (A6 and A7) IPY1.1 1.9 Cpython 0.1 Not a huge issue for me but for large apps, this could be quite significant for startup times. Cheers, Davy -- Davy Mitchell Blog - http://www.latedecember.co.uk/sites/personal/davy/ Twitter - http://twitter.com/daftspaniel Skype - daftspaniel needgod.com From fuzzyman at voidspace.org.uk Wed Dec 26 22:56:04 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 26 Dec 2007 21:56:04 +0000 Subject: [IronPython] [python] Import Performance In-Reply-To: <20253b0c0712261348o25ec725fyc6a1737fa480f099@mail.gmail.com> References: <20253b0c0712261348o25ec725fyc6a1737fa480f099@mail.gmail.com> Message-ID: <4772CDF4.2040805@voidspace.org.uk> Davy Mitchell wrote: > I was curious as to why one of my apps was taking so long to start up. > Sure it loaded up some RSS feeds but it shouldn't take *that* long. > Anyway turns out to be 4-5 seconds importing configobj > > import datetime > print datetime.datetime.now() > from configobj import ConfigObj > print datetime.datetime.now() > > Repeated with consistent results in seconds: > IPY2.0 4.0 (A6 and A7) > IPY1.1 1.9 > Cpython 0.1 > > Not a huge issue for me but for large apps, this could be quite > significant for startup times. > Can you benchmark which bits of the import take how much time? Michael > Cheers, > Davy > > From daftspaniel at gmail.com Thu Dec 27 18:44:22 2007 From: daftspaniel at gmail.com (Davy Mitchell) Date: Thu, 27 Dec 2007 17:44:22 +0000 Subject: [IronPython] [python] Import Performance In-Reply-To: <4772CDF4.2040805@voidspace.org.uk> References: <20253b0c0712261348o25ec725fyc6a1737fa480f099@mail.gmail.com> <4772CDF4.2040805@voidspace.org.uk> Message-ID: <20253b0c0712270944k5d72e28cr6a07e747b3edf759@mail.gmail.com> Hi All, Okay had a go at narrowing down the issue - appears to be the 'import compiler' line taking around 2 seconds. The importing seems pretty fast - possibly the exceptions in IronPython being generated causing the slowdown. Here's the test code I used: import sys import datetime print datetime.datetime.now() try: import antigravity except ImportError: pass print datetime.datetime.now() try: import compiler except ImportError: print " Error \n", sys.exc_info()[0] for line in sys.exc_info(): print line print datetime.datetime.now() CPython: 2007-12-27 17:35:57.279000 2007-12-27 17:35:57.284000 2007-12-27 17:35:57.316000 IronPython: 2007-12-27 17:37:59.502000 2007-12-27 17:37:59.528000 Error exceptions.ImportError exceptions.ImportError No module named parser 2007-12-27 17:38:01.664000 Both cope with unknown modules fast but it appears the exception condition causes the slowdown. This is a common way for optional or preferred modules to be imported so I would say this is probably an issue though not having worked on anything large enough in IronPython to draw firm conclusions!! CPython seems to be about 10 times faster importing modules from the various benchmarks I have run. Easy workaround for me is to remove the import from configobj - hurrah :-) Cheers, Davy On Dec 26, 2007 9:56 PM, Michael Foord wrote: > Davy Mitchell wrote: > > I was curious as to why one of my apps was taking so long to start up. > > Sure it loaded up some RSS feeds but it shouldn't take *that* long. > > Anyway turns out to be 4-5 seconds importing configobj > > > > import datetime > > print datetime.datetime.now() > > from configobj import ConfigObj > > print datetime.datetime.now() > > > > Repeated with consistent results in seconds: > > IPY2.0 4.0 (A6 and A7) > > IPY1.1 1.9 > > Cpython 0.1 > > > > Not a huge issue for me but for large apps, this could be quite > > significant for startup times. > > > > Can you benchmark which bits of the import take how much time? > > Michael > > > Cheers, > > Davy > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Davy Mitchell Blog - http://www.latedecember.co.uk/sites/personal/davy/ Twitter - http://twitter.com/daftspaniel Skype - daftspaniel needgod.com From riltim at gmail.com Thu Dec 27 19:51:57 2007 From: riltim at gmail.com (Tim Riley) Date: Thu, 27 Dec 2007 13:51:57 -0500 Subject: [IronPython] IronPython Community Edition - FeedParser Weirdness Message-ID: I am trying to access my gmail account using the latest IronPython Community Edition (IPY, not IPY2) and the python feedparser library. When I run the following script through python 2.5 everything works great, however when I run it through ipy.exe I get an error. I was wondering if anyone has any experience using feedparser with ipy and if so if they could give me a pointer on how to get this working. Here is the code: #################code##################### #Note: Build with IronPython Community Edition, Not Standard IronPython #import statements import ConfigParser import feedparser def generateURL(): """ Generates a the url for the ATOM feed by reading the username and password from the config file. """ config = ConfigParser.ConfigParser() config.read("config.ini") return "https://%s:%s at gmail.google.com/gmail/feed/atom" % (config.get("app:main", "username"), config.get("app:main", "password")) def checkmail(): usermail = feedparser.parse(generateURL()) #for testing only print usermail.feed.title print len(usermail['entries']) if __name__ == "__main__": checkmail() #################code##################### and here is the output: ################output#################### C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail>python ipygmail.py Gmail - Inbox for riltim at gmail.com 9 C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail>ipy ipygmail.py Traceback (most recent call last): File C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail\ipygmail.py, l ine 25, in Initialize File C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail\ipygmail.py, l ine 20, in checkmail AttributeError: title ################output#################### From fuzzyman at voidspace.org.uk Thu Dec 27 21:28:40 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 27 Dec 2007 20:28:40 +0000 Subject: [IronPython] [python] IronPython Community Edition - FeedParser Weirdness In-Reply-To: References: Message-ID: <47740AF8.9050501@voidspace.org.uk> Tim Riley wrote: > I am trying to access my gmail account using the latest IronPython > Community Edition (IPY, not IPY2) and the python feedparser library. > When I run the following script through python 2.5 everything works > great, however when I run it through ipy.exe I get an error. I was > wondering if anyone has any experience using feedparser with ipy and > if so if they could give me a pointer on how to get this working. > > > What happens if you replace the line: print usermail.feed.title With print dir(usermail.feed) ? The feedparser code isn't failing, but it looks like you aren't getting back what you expect... Michael http://www.manning.com/foord > Here is the code: > > #################code##################### > #Note: Build with IronPython Community Edition, Not Standard IronPython > > #import statements > import ConfigParser > import feedparser > > > def generateURL(): > """ > Generates a the url for the ATOM feed by reading the username and > password from the config file. > """ > config = ConfigParser.ConfigParser() > config.read("config.ini") > return "https://%s:%s at gmail.google.com/gmail/feed/atom" % > (config.get("app:main", "username"), config.get("app:main", > "password")) > > > def checkmail(): > usermail = feedparser.parse(generateURL()) > #for testing only > print usermail.feed.title > print len(usermail['entries']) > > if __name__ == "__main__": > checkmail() > #################code##################### > > > and here is the output: > > ################output#################### > > > > C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail>python ipygmail.py > Gmail - Inbox for riltim at gmail.com > 9 > > C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail>ipy ipygmail.py > Traceback (most recent call last): > File C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail\ipygmail.py, l > ine 25, in Initialize > File C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail\ipygmail.py, l > ine 20, in checkmail > AttributeError: title > > ################output#################### > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From riltim at gmail.com Thu Dec 27 21:59:08 2007 From: riltim at gmail.com (Tim Riley) Date: Thu, 27 Dec 2007 15:59:08 -0500 Subject: [IronPython] [python] IronPython Community Edition - FeedParser Weirdness In-Reply-To: <47740AF8.9050501@voidspace.org.uk> References: <47740AF8.9050501@voidspace.org.uk> Message-ID: Yeah something isn't right. Python 2.5 output gives me: ['__class__', '__cmp__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__eq__', '__ge__', '__getattr__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__slotnames__', '__str__', '__weakref__', 'clear', 'copy', 'fromkeys', 'get', 'has_key', 'items', 'iteritems', 'iterkeys', 'itervalues', 'keymap', 'keys', 'pop', 'popitem', 'setdefault', 'update', 'values'] 14 ipy.exe output gives me: ['__class__', '__cmp__', '__contains__', '__delitem__', '__dict__', '__doc__', '__eq__', '__getattr__', '__getitem__', '__hash__', '__init__', '__iter__', '__len__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__str__', '__weakref__', 'clear', 'copy', 'fromkeys', 'get', 'has_key', 'items', 'iteritems', 'iterkeys', 'itervalues', 'keymap', 'keys', 'pop', 'popitem', 'setdefault', 'update', 'values'] 0 Tim On Dec 27, 2007 3:28 PM, Michael Foord wrote: > Tim Riley wrote: > > I am trying to access my gmail account using the latest IronPython > > Community Edition (IPY, not IPY2) and the python feedparser library. > > When I run the following script through python 2.5 everything works > > great, however when I run it through ipy.exe I get an error. I was > > wondering if anyone has any experience using feedparser with ipy and > > if so if they could give me a pointer on how to get this working. > > > > > > > > What happens if you replace the line: > > print usermail.feed.title > > With > > print dir(usermail.feed) > > ? > > The feedparser code isn't failing, but it looks like you aren't getting back what you expect... > > Michael > http://www.manning.com/foord > > > > > > Here is the code: > > > > #################code##################### > > #Note: Build with IronPython Community Edition, Not Standard IronPython > > > > #import statements > > import ConfigParser > > import feedparser > > > > > > def generateURL(): > > """ > > Generates a the url for the ATOM feed by reading the username and > > password from the config file. > > """ > > config = ConfigParser.ConfigParser() > > config.read("config.ini") > > return "https://%s:%s at gmail.google.com/gmail/feed/atom" % > > (config.get("app:main", "username"), config.get("app:main", > > "password")) > > > > > > def checkmail(): > > usermail = feedparser.parse(generateURL()) > > #for testing only > > print usermail.feed.title > > print len(usermail['entries']) > > > > if __name__ == "__main__": > > checkmail() > > #################code##################### > > > > > > and here is the output: > > > > ################output#################### > > > > > > > > C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail>python ipygmail.py > > Gmail - Inbox for riltim at gmail.com > > 9 > > > > C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail>ipy ipygmail.py > > Traceback (most recent call last): > > File C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail\ipygmail.py, l > > ine 25, in Initialize > > File C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail\ipygmail.py, l > > ine 20, in checkmail > > AttributeError: title > > > > ################output#################### > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From fuzzyman at voidspace.org.uk Thu Dec 27 22:29:47 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 27 Dec 2007 21:29:47 +0000 Subject: [IronPython] [python] IronPython Community Edition - FeedParser Weirdness In-Reply-To: References: <47740AF8.9050501@voidspace.org.uk> Message-ID: <4774194B.20402@voidspace.org.uk> Hmm... no '__delattr__' or '__getattribute__' to start with - and more importantly no entries. Odd. I wonder if an exception is being raised in fetching the feed (or something...) and being suppressed by feedparser. I'm afraid that unless anyone has any direct experience of using feedparser with IronPython, the only option is to follow the code backwards until you find the problem... Michael http://www.manning.com/foord Tim Riley wrote: > Yeah something isn't right. > > Python 2.5 output gives me: > ['__class__', '__cmp__', '__contains__', '__delattr__', '__delitem__', > '__dict__', '__doc__', '__eq__', '__ge__', '__getattr__', > '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', > '__iter__', '__le__', '__len__', '__lt__', '__module__', '__ne__', > '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', > '__setitem__', '__slotnames__', '__str__', '__weakref__', 'clear', > 'copy', 'fromkeys', 'get', 'has_key', 'items', 'iteritems', > 'iterkeys', 'itervalues', 'keymap', 'keys', 'pop', 'popitem', > 'setdefault', 'update', 'values'] > 14 > > ipy.exe output gives me: > ['__class__', '__cmp__', '__contains__', '__delitem__', '__dict__', > '__doc__', '__eq__', '__getattr__', '__getitem__', '__hash__', > '__init__', '__iter__', '__len__', '__module__', '__ne__', '__new__', > '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', > '__setitem__', '__str__', '__weakref__', 'clear', 'copy', 'fromkeys', > 'get', 'has_key', 'items', 'iteritems', 'iterkeys', 'itervalues', > 'keymap', 'keys', 'pop', 'popitem', 'setdefault', 'update', 'values'] > 0 > > > Tim > > > > On Dec 27, 2007 3:28 PM, Michael Foord wrote: > >> Tim Riley wrote: >> >>> I am trying to access my gmail account using the latest IronPython >>> Community Edition (IPY, not IPY2) and the python feedparser library. >>> When I run the following script through python 2.5 everything works >>> great, however when I run it through ipy.exe I get an error. I was >>> wondering if anyone has any experience using feedparser with ipy and >>> if so if they could give me a pointer on how to get this working. >>> >>> >>> >>> >> What happens if you replace the line: >> >> print usermail.feed.title >> >> With >> >> print dir(usermail.feed) >> >> ? >> >> The feedparser code isn't failing, but it looks like you aren't getting back what you expect... >> >> Michael >> http://www.manning.com/foord >> >> >> >> >> >>> Here is the code: >>> >>> #################code##################### >>> #Note: Build with IronPython Community Edition, Not Standard IronPython >>> >>> #import statements >>> import ConfigParser >>> import feedparser >>> >>> >>> def generateURL(): >>> """ >>> Generates a the url for the ATOM feed by reading the username and >>> password from the config file. >>> """ >>> config = ConfigParser.ConfigParser() >>> config.read("config.ini") >>> return "https://%s:%s at gmail.google.com/gmail/feed/atom" % >>> (config.get("app:main", "username"), config.get("app:main", >>> "password")) >>> >>> >>> def checkmail(): >>> usermail = feedparser.parse(generateURL()) >>> #for testing only >>> print usermail.feed.title >>> print len(usermail['entries']) >>> >>> if __name__ == "__main__": >>> checkmail() >>> #################code##################### >>> >>> >>> and here is the output: >>> >>> ################output#################### >>> >>> >>> >>> C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail>python ipygmail.py >>> Gmail - Inbox for riltim at gmail.com >>> 9 >>> >>> C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail>ipy ipygmail.py >>> Traceback (most recent call last): >>> File C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail\ipygmail.py, l >>> ine 25, in Initialize >>> File C:\Documents and Settings\TJRiley\Desktop\testing\ipygmail\ipygmail.py, l >>> ine 20, in checkmail >>> AttributeError: title >>> >>> ################output#################### >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.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 sanxiyn at gmail.com Fri Dec 28 00:14:20 2007 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Fri, 28 Dec 2007 08:14:20 +0900 Subject: [IronPython] [python] IronPython Community Edition - FeedParser Weirdness In-Reply-To: References: <47740AF8.9050501@voidspace.org.uk> Message-ID: <5b0248170712271514j4642f90fva675b7b7c8b9eee0@mail.gmail.com> 2007/12/28, Tim Riley : > Yeah something isn't right. Can you try again after updating pyexpat.py from SVN? https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/lib/pyexpat.py I fixed a bug with CDATA handling. That might be it. -- Seo Sanghyeon From riltim at gmail.com Fri Dec 28 04:24:14 2007 From: riltim at gmail.com (Tim Riley) Date: Thu, 27 Dec 2007 22:24:14 -0500 Subject: [IronPython] [python] IronPython Community Edition - FeedParser Weirdness In-Reply-To: <5b0248170712271514j4642f90fva675b7b7c8b9eee0@mail.gmail.com> References: <47740AF8.9050501@voidspace.org.uk> <5b0248170712271514j4642f90fva675b7b7c8b9eee0@mail.gmail.com> Message-ID: I tested with the svn version of pyexpat you linked to but still no luck. Tim On Dec 27, 2007 6:14 PM, Sanghyeon Seo wrote: > 2007/12/28, Tim Riley : > > Yeah something isn't right. > > Can you try again after updating pyexpat.py from SVN? > https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/lib/pyexpat.py > > I fixed a bug with CDATA handling. That might be it. > > -- > Seo Sanghyeon > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From vizcaynot at gmail.com Fri Dec 28 18:19:56 2007 From: vizcaynot at gmail.com (Vizcayno) Date: Fri, 28 Dec 2007 09:19:56 -0800 (PST) Subject: [IronPython] IronPython 1.1.1 wish-list? In-Reply-To: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <27bd047f-8137-42a0-8b82-76d19ba4f3dd@j64g2000hsj.googlegroups.com> Hello: I have the next problem in Ipy 1.01 I would like to know if it is a bug to fix in 1.01.1 or not. Look at the next code and results running in Ipy 1.01: IronPython 1.1 (1.1) on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. ['C:\\os\\ipy\\src', 'c:\\python25\\lib', 'c:\\os\\IPY', 'c:\\os\\IPY\ \Tutorial', 'C:\\os\\ic_ora\\ nstantclient_11_1\\odp.net\\bin\\2.x', 'c:\\os\\SQLite', 'c:\\os\\IPY\ \IronPython-1.1\\Lib', 'c:\\o \\IPY\\IronPython-1.1', 'c:/os/ipy/django_src'] >>> import sys >>> import clr >>> import System >>> clr.AddReference("Oracle.DataAccess") >>> import Oracle.DataAccess.Client Traceback (most recent call last): File , line 0, in ##91 File , line 0, in __import__##4 SystemError: Object reference not set to an instance of an object. >>> >>> dir(Oracle.DataAccess.Client) Traceback (most recent call last): File , line 0, in ##92 NameError: name 'Oracle' not defined >>> When doing this in ipy 2.0A7 I have no problems: IronPython console: 2.0 Copyright (c) Microsoft Corporation. All rights reserved. ['c:\\os\\ipy\\src', 'c:\\os\\ipy\\lib', 'c:\\python25\\lib', 'c:\\os\ \IPY', 'c:\\os\\IPY\\Tutorial', 'C:\\os\\ic_ora\\i tantclient_11_1\\odp.net\\bin\\2.x', 'C:\\os\\SQLite\\bin', 'c:\\os\ \ipy\\django_src', 'c:\\os\\ipy\\django_src\\django\ in', 'c:\\os\\IPY\\IronPython-2.0A7\\Lib', 'c:\\os\\IPY\ \IronPython-2.0A7', 'c:/os/ipy/django_src'] >>> import sys >>> import clr >>> import System >>> clr.AddReference("Oracle.DataAccess") >>> import Oracle.DataAccess.Client >>> >>> dir(Oracle.DataAccess.Client) ['FailoverEvent', 'FailoverReturnCode', 'FailoverType', 'OnChangeEventHandler', 'OracleBulkCopy', 'OracleBulkCopyColumnM ping', 'OracleBulkCopyColumnMappingCollection', 'OracleBulkCopyOptions', 'OracleClientFactory', 'OracleCollectionType', racleCommand', 'OracleCommandBuilder', 'OracleConnection', 'OracleConnectionStringBuilder', 'OracleDataAdapter', 'Oracle taReader', 'OracleDataSourceEnumerator', 'OracleDbType', 'OracleDependency', 'OracleError', 'OracleErrorCollection', 'Or leException', 'OracleFailoverEventArgs', 'OracleFailoverEventHandler', 'OracleGlobalization', 'OracleInfoMessageEventArg , 'OracleInfoMessageEventHandler', 'OracleNotificationEventArgs', 'OracleNotificationInfo', 'OracleNotificationRequest', OracleNotificationSource', 'OracleNotificationType', 'OracleParameter', 'OracleParameterCollection', 'OracleParameterSta s', 'OracleRowUpdatedEventArgs', 'OracleRowUpdatedEventHandler', 'OracleRowUpdatingEventArgs', 'OracleRowUpdatingEventHa ler', 'OracleRowidInfo', 'OracleRowsCopiedEventArgs', 'OracleRowsCopiedEventHandler', 'OracleTransaction', 'OracleXmlCom ndType', 'OracleXmlQueryProperties', 'OracleXmlSaveProperties'] >>> sys.version '2.5.0 (2.0)' >>> From dinov at exchange.microsoft.com Sat Dec 29 06:37:28 2007 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 28 Dec 2007 21:37:28 -0800 Subject: [IronPython] IronPython 1.1.1 wish-list? In-Reply-To: <27bd047f-8137-42a0-8b82-76d19ba4f3dd@j64g2000hsj.googlegroups.com> References: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com>, <27bd047f-8137-42a0-8b82-76d19ba4f3dd@j64g2000hsj.googlegroups.com> Message-ID: <7AD436E4270DD54A94238001769C2227FB8E9C69D3@DF-GRTDANE-MSG.exchange.corp.microsoft.com> This sounds like a bug and could quite possibly be fixed for 1.1.1 (it's hard to brake things by not dereferncing a null pointer :) ). Could you re-run w/ the -X:ExceptionDetail command line option and give us that stack trace? ________________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Vizcayno [vizcaynot at gmail.com] Sent: Friday, December 28, 2007 9:19 AM To: users at lists.ironpython.com Subject: Re: [IronPython] IronPython 1.1.1 wish-list? Hello: I have the next problem in Ipy 1.01 I would like to know if it is a bug to fix in 1.01.1 or not. Look at the next code and results running in Ipy 1.01: IronPython 1.1 (1.1) on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. ['C:\\os\\ipy\\src', 'c:\\python25\\lib', 'c:\\os\\IPY', 'c:\\os\\IPY\ \Tutorial', 'C:\\os\\ic_ora\\ nstantclient_11_1\\odp.net\\bin\\2.x', 'c:\\os\\SQLite', 'c:\\os\\IPY\ \IronPython-1.1\\Lib', 'c:\\o \\IPY\\IronPython-1.1', 'c:/os/ipy/django_src'] >>> import sys >>> import clr >>> import System >>> clr.AddReference("Oracle.DataAccess") >>> import Oracle.DataAccess.Client Traceback (most recent call last): File , line 0, in ##91 File , line 0, in __import__##4 SystemError: Object reference not set to an instance of an object. >>> >>> dir(Oracle.DataAccess.Client) Traceback (most recent call last): File , line 0, in ##92 NameError: name 'Oracle' not defined >>> When doing this in ipy 2.0A7 I have no problems: IronPython console: 2.0 Copyright (c) Microsoft Corporation. All rights reserved. ['c:\\os\\ipy\\src', 'c:\\os\\ipy\\lib', 'c:\\python25\\lib', 'c:\\os\ \IPY', 'c:\\os\\IPY\\Tutorial', 'C:\\os\\ic_ora\\i tantclient_11_1\\odp.net\\bin\\2.x', 'C:\\os\\SQLite\\bin', 'c:\\os\ \ipy\\django_src', 'c:\\os\\ipy\\django_src\\django\ in', 'c:\\os\\IPY\\IronPython-2.0A7\\Lib', 'c:\\os\\IPY\ \IronPython-2.0A7', 'c:/os/ipy/django_src'] >>> import sys >>> import clr >>> import System >>> clr.AddReference("Oracle.DataAccess") >>> import Oracle.DataAccess.Client >>> >>> dir(Oracle.DataAccess.Client) ['FailoverEvent', 'FailoverReturnCode', 'FailoverType', 'OnChangeEventHandler', 'OracleBulkCopy', 'OracleBulkCopyColumnM ping', 'OracleBulkCopyColumnMappingCollection', 'OracleBulkCopyOptions', 'OracleClientFactory', 'OracleCollectionType', racleCommand', 'OracleCommandBuilder', 'OracleConnection', 'OracleConnectionStringBuilder', 'OracleDataAdapter', 'Oracle taReader', 'OracleDataSourceEnumerator', 'OracleDbType', 'OracleDependency', 'OracleError', 'OracleErrorCollection', 'Or leException', 'OracleFailoverEventArgs', 'OracleFailoverEventHandler', 'OracleGlobalization', 'OracleInfoMessageEventArg , 'OracleInfoMessageEventHandler', 'OracleNotificationEventArgs', 'OracleNotificationInfo', 'OracleNotificationRequest', OracleNotificationSource', 'OracleNotificationType', 'OracleParameter', 'OracleParameterCollection', 'OracleParameterSta s', 'OracleRowUpdatedEventArgs', 'OracleRowUpdatedEventHandler', 'OracleRowUpdatingEventArgs', 'OracleRowUpdatingEventHa ler', 'OracleRowidInfo', 'OracleRowsCopiedEventArgs', 'OracleRowsCopiedEventHandler', 'OracleTransaction', 'OracleXmlCom ndType', 'OracleXmlQueryProperties', 'OracleXmlSaveProperties'] >>> sys.version '2.5.0 (2.0)' >>> _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From vizcaynot at gmail.com Sat Dec 29 15:47:37 2007 From: vizcaynot at gmail.com (Vizcayno) Date: Sat, 29 Dec 2007 06:47:37 -0800 (PST) Subject: [IronPython] IronPython 1.1.1 wish-list? In-Reply-To: <7AD436E4270DD54A94238001769C2227FB8E9C69D3@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com>, <27bd047f-8137-42a0-8b82-76d19ba4f3dd@j64g2000hsj.googlegroups.com> <7AD436E4270DD54A94238001769C2227FB8E9C69D3@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Hello Dino: I send you the results running from my DOS WinXP SP2 console: .ipy -X:ExceptionDetail IronPython 1.1 (1.1) on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. ['c:\\os\\ipy\\src', 'c:\\os\\ipy\\lib', 'c:\\python25\\lib', 'c:\\os\ \IPY', 'c:\\os\\IPY\\Tutorial', 'C:\\os\\ic_ora\\ tantclient_11_1\\odp.net\\bin\\2.x', 'C:\\os\\SQLite\\bin', 'c:\\os\ \ipy\\django_src', 'c:\\os\\ipy\\django_src\\django in', 'c:\\os\\IPY\\IronPython-1.1\\Lib', 'c:\\os\\IPY\ \IronPython-1.1', 'c:/os/ipy/django_src'] >>> import sys >>> import clr >>> import System >>> clr.AddReference("Oracle.DataAccess") >>> import Oracle.DataAccess.Client Object reference not set to an instance of an object. at IronPython.Runtime.Importer.LoadPreCompiled(SystemState state, String fullName, String fileName) at IronPython.Runtime.Importer.TryLoadModule(SystemState state, String fullName, String pathName, PythonModule& ret) at IronPython.Runtime.Importer.ImportFromPath(SystemState state, String name, String fullName, List path) at IronPython.Runtime.Importer.ImportTopAbsolute(PythonModule mod, String name) at IronPython.Runtime.Importer.ImportModule(ICallerContext context, String modName, Boolean bottom) at IronPython.Modules.Builtin.__import__(ICallerContext context, String name, Object globals, Object locals, Object mList) at __import__##4(ICallerContext , Object , Object , Object , Object ) at IronPython.Runtime.Calls.FastCallableWithContextAny.Call(ICallerContext context, Object arg0, Object arg1, Object g2, Object arg3) at IronPython.Runtime.Calls.BuiltinFunction.Call(ICallerContext context, Object arg0, Object arg1, Object arg2, Obje arg3) at IronPython.Runtime.Operations.Ops.CallWithContext(ICallerContext context, Object func, Object arg0, Object arg1, ect arg2, Object arg3) at IronPython.Runtime.Operations.Ops.Import(PythonModule mod, String fullName) at ##91(ModuleScope ) at IronPython.Hosting.CompiledCode.Run(ModuleScope moduleScope) at IronPython.Hosting.PythonEngine.ExecuteToConsole(String text, EngineModule engineModule, IDictionary`2 locals) at IronPython.Hosting.PythonEngine.ExecuteToConsole(String text) at IronPythonConsole.PythonCommandLine.DoOneInteractive() at IronPythonConsole.PythonCommandLine.b__6(Boolean& continueInteractionArgument) at IronPythonConsole.PythonCommandLine.TryInteractiveAction(InteractiveAction interactiveAction, Boolean& continueIn action) SystemError: Object reference not set to an instance of an object. >>> Note. I am now testing IronPython Studio and when using and executing the same previous commands I had no errors!!. I show you the results: >>>import sys >>>print sys.version 2.4.0 (IronPython 1.1.1 (1.1.1) on .NET 2.0.50727.1433) >>>import sys >>>import clr >>>import System >>>clr.AddReference("Oracle.DataAccess") >>>import Oracle.DataAccess.Client >>>dir(Oracle.DataAccess.Client) ['FailoverEvent', 'FailoverReturnCode', 'FailoverType', 'OnChangeEventHandler', 'OracleBulkCopy', 'OracleBulkCopyColumnMapping', 'OracleBulkCopyColumnMappingCollection', 'OracleBulkCopyOptions', 'OracleClientFactory', 'OracleCollectionType', 'OracleCommand', 'OracleCommandBuilder', 'OracleConnection', 'OracleConnectionStringBuilder', 'OracleDataAdapter', 'OracleDataReader', 'OracleDataSourceEnumerator', 'OracleDbType', 'OracleDependency', 'OracleError', 'OracleErrorCollection', 'OracleException', 'OracleFailoverEventArgs', 'OracleFailoverEventHandler', 'OracleGlobalization', 'OracleInfoMessageEventArgs', 'OracleInfoMessageEventHandler', 'OracleNotificationEventArgs', 'OracleNotificationInfo', 'OracleNotificationRequest', 'OracleNotificationSource', 'OracleNotificationType', 'OracleParameter', 'OracleParameterCollection', 'OracleParameterStatus', 'OracleRowUpdatedEventArgs', 'OracleRowUpdatedEventHandler', 'OracleRowUpdatingEventArgs', 'OracleRowUpdatingEventHandler', 'OracleRowidInfo', 'OracleRowsCopiedEventArgs', 'OracleRowsCopiedEventHandler', 'OracleTransaction', 'OracleXmlCommandType', 'OracleXmlQueryProperties', 'OracleXmlSaveProperties', '__builtins__', '__dict__', '__name__'] >>> I am a little confused by this. Thanks!! From fuzzyman at voidspace.org.uk Mon Dec 31 00:57:34 2007 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 30 Dec 2007 23:57:34 +0000 Subject: [IronPython] Back to XAML, Images and Relative Locations Message-ID: <4778306E.9060207@voidspace.org.uk> Hello Guys, More adventures with XAML, images and specifying relative locations. Unfortunately I have come up against what seems to be an unsolvable problem. I want to create XAML documents that are read in with XamlReader.Load and read from a FlowDocumentViewer. If these contain images then the location of the image is specified with a tag something like: However, (of course) I don't want to have to specify an absolute location. What I *want* to be able to do, is to specify an image location relative to the document (which seems the natural and obvious thing to do). I *thought* I could do this by specifying a relative location using the Pack URI syntax [1]: Unfortunately that specifies a location relative to the executable of the current application. If executed by 'ipy.exe' then it specifies a location relative to 'ipy.exe'. Unfortunately that means that, as far as I can tell, it *isn't possible* to load XAML files containing image references without either absolute file locations or text manipulation to specify the location at runtime. This unfortunately negates the usefulness of these documents. Anyone know any better or have any workarounds? Michael http://www.manning.com/foord [1] http://msdn2.microsoft.com/en-us/library/aa970069.aspx From anthony-b at mediatel.gr Mon Dec 31 18:21:13 2007 From: anthony-b at mediatel.gr (Anthony Boudouvas) Date: Mon, 31 Dec 2007 19:21:13 +0200 Subject: [IronPython] IronPython Studio question. Message-ID: Hi, i just downloaded and installed IronPython Studio, a very impressive work indeed. Is this possible to import modules like normal CPython 2.5 usage (modules that have nothing to do with .net stuff, like win32api or PyQt, for instance) and succesfully build the project ?? I tried the following code but it says cannot import modue "win32pdh". Thanks for any help. ------------------------------ import win32pdh, string, win32api, os def procIDSs(): junk, instances = win32pdh.EnumObjectItems(None, None, "process", win32pdh.PERF_DETAIL_WIZARD) proc_ids = [] proc_dict = {} for instance in instances: if instance in proc_dict: proc_dict[instance] = proc_dict[instance] + 1 else: proc_dict[instance] = 0 for instance, max_instance in proc_dict.items(): for inum in xrange(max_instance + 1): hq = win32pdh.OpenQuery() path = win32pdh.MakeCounterPath((None, "process", instance, None, inum, "ID Process")) counter_handle = win32pdh.AddCounter(hq, path) win32pdh.CollectQueryData(hq) type, val = win32pdh.GetFormattedCounterValue(counter_handle, win32pdh.PDH_FMT_LONG) proc_ids.append((instance, str(val))) return proc_ids for process in procIDSs(): print process [mailto:users at lists.ironpython.com] -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve at holdenweb.com Mon Dec 31 19:06:29 2007 From: steve at holdenweb.com (Steve Holden) Date: Mon, 31 Dec 2007 13:06:29 -0500 Subject: [IronPython] IronPython Studio question. In-Reply-To: References: Message-ID: <47792FA5.6060201@holdenweb.com> Anthony Boudouvas wrote: > Hi, > > i just downloaded and installed IronPython Studio, a very impressive > work indeed. Is this possible to import modules like normal CPython 2.5 > usage (modules that have nothing to do with .net stuff, like win32api or > PyQt, for instance) and succesfully build the project ?? > > I tried the following code but it says cannot import modue "win32pdh". > > Thanks for any help. > Alas an extension module compiled for CPython cannot be directly imported into IronPython, as the object representations are so different. This does not apply to modules in pure Python, of course, which are mostly importable (the restrictions being mainly due to platform differences). The team at Resolver Systems has built an interesting experimental mechanism for embedding CPython in the IronPython environment and having the two communicate. This has been demonstrated to allow some uses of CPython extension modules in IronPython, but there are no guarantees. However, the functionality you seek may well be available through .NET features which are easily accessed from IronPython, in which case that would be the way to go. regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/