From dinov at exchange.microsoft.com Wed Jan 2 18:43:43 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 2 Jan 2008 09:43:43 -0800 Subject: [IronPython] IronPython 1.1.1 wish-list? In-Reply-To: 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: <7AD436E4270DD54A94238001769C2227FB8E6587BF@DF-GRTDANE-MSG.exchange.corp.microsoft.com> This is easy enough to fix for 1.1.1. The issue here (I think) is that somewhere in your sys.path you have a file called Oracle.exe that contains exactly 1 type (which, not surprisingly, is not a subtype of CompiledModule). Apparently we can create an instance of that type but because it's not a CompiledModule we get null and blow up trying to load the module. In general we just need to harden those code path to a bunch of potential failures: More than one type, types w/o public ctors, types whose ctor's throw, etc... That's an easy enough change to make for v1.1. Also this code path doesn't exist in v2.0 at all right now so it doesn't suffer from this issue. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vizcayno Sent: Saturday, December 29, 2007 6:48 AM To: users at lists.ironpython.com Subject: Re: [IronPython] IronPython 1.1.1 wish-list? 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!! _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Jan 2 19:04:00 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 2 Jan 2008 10:04:00 -0800 Subject: [IronPython] Difference in 1.1 and 2.0 with Dialog Result In-Reply-To: <20253b0c0712230620id6cdae1n4e99fe03374de04b@mail.gmail.com> References: <20253b0c0712230620id6cdae1n4e99fe03374de04b@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227FB8E6587D9@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I think this is bug - .NET conventions say that enum's should generally have a zero value (FxCop CA1008 :)). Because of that we can safely define __nonzero__ on enums and have that return true/false based upon if the value is zero/non-zero. Otherwise Python says all expressions otherwise defined return true, which is the default behavior you're getting here. This regression probably occurred when I was switching conversions over to using dynamic sites and actions. The if (expr) is implemented as a conversion to bool and that of course is now returning true (just as bool(someEnum) always returns true now). Interestingly enough neither v1.x or v2.0 have ever defined __nonzero__ on bool's - it's just that our "fast paths" (which have been slowly going away in v2.0) have caught this and done the right thing. I've opened CodePlex bug #14605 to track the issue (http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=14605). Thanks for the bug report! -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Davy Mitchell Sent: Sunday, December 23, 2007 6:21 AM To: Discussion of IronPython Subject: [IronPython] Difference in 1.1 and 2.0 with Dialog Result 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 _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Wed Jan 2 20:56:54 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 2 Jan 2008 11:56:54 -0800 Subject: [IronPython] IronPython 1.1.1 wish-list? In-Reply-To: References: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227FB8E658835@DF-GRTDANE-MSG.exchange.corp.microsoft.com> FYI this one is already fixed in the v2.0 tree, but I'll look at fixing it in v1.1.1 as well - it's a little more invasive than I'd usually want but it shouldn't be too bad. But if you want to work around it for the time being you can replace __init__ w/ __new__: class TESTINGwrite(file): def __new__(cls, fname): return file.__new__(cls,fname,"w",1) def writesomething(self): self.write("Hi there\n") x = TESTINGwrite("testing_TMP.txt") x.writesomething() We just have the functionality of __init__ in __new__ currently. And if you want to always work regardless of version it looks like you can just define both __new__ and __init__. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of HEMMI, Shigeru Sent: Sunday, December 23, 2007 4:00 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.1 wish-list? 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 dinov at exchange.microsoft.com Thu Jan 3 01:50:39 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 2 Jan 2008 16:50:39 -0800 Subject: [IronPython] [python] Re: IronPython 1.1.1 wish-list? In-Reply-To: <476E9A01.80404@voidspace.org.uk> References: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <476E9A01.80404@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227FB8E65890D@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I think all of these can be fixed w/ the exception of the first two - or at least I have fixes for them. Now I just need to make sure I haven't broken anything :). The 1st one is probably too invasive to fix in v1.x (and is fixed in v2.0). The 2nd one I'm not sure I understand. I seem to be getting identical results in both IronPython & CPython: Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> object.__gt__ Traceback (most recent call last): File "", line 1, in AttributeError: type object 'object' has no attribute '__gt__' >>> class Broken(object): ... def __getattr__(self, name): ... raise AttributeError(name) ... >>> >>> Broken().__gt__ Traceback (most recent call last): File "", line 1, in File "", line 3, in __getattr__ AttributeError: __gt__ >>> Broken() > 3 True >>> ^Z IronPython 1.1 (1.1) on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> class Broken(object): ... def __getattr__(self, name): ... raise AttributeError(name) ... >>> >>> Broken().__gt__ Traceback (most recent call last): File , line 0, in ##12 AttributeError: __gt__ >>> Broken() > 3 True >>> ^Z Am I just missing something? It is the 1st day back since vacation :) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Sunday, December 23, 2007 9:25 AM To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: IronPython 1.1.1 wish-list? (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 > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Thu Jan 3 01:54:04 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 2 Jan 2008 16:54:04 -0800 Subject: [IronPython] IronPython 1.1.1 wish-list? In-Reply-To: References: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227FB8E658914@DF-GRTDANE-MSG.exchange.corp.microsoft.com> On quit(): quit is actually not defined by the runtime implementation of Python, rather it's part of the standard library (defined in site.py and installed w/ the setquit function). Running w/ the standard library set (or just from CPython's Lib dir) will result in that functionality being available and works even in v1.0: 16:52:12.23 C:\Python25\Lib > C:\Product\Released\IronPython-1.0\ipy.exe IronPython 1.0.60816 on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> quit() 16:52:41.39 C:\Python25\Lib > I'd rather not duplicate the functionality in the runtime - is there a reason you can't use the std lib (other than we don't include it by default? :) ). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of HEMMI, Shigeru Sent: Sunday, December 23, 2007 4:00 AM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.1 wish-list? 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 textdirected at gmail.com Thu Jan 3 12:02:25 2008 From: textdirected at gmail.com (HEMMI, Shigeru) Date: Thu, 3 Jan 2008 20:02:25 +0900 Subject: [IronPython] IronPython 1.1.1 wish-list? In-Reply-To: <7AD436E4270DD54A94238001769C2227FB8E658835@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227FB8E658835@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Dear Dino, Thanks for the support. The workaround you provided is quite OK for me. The only thing I wanted to know is how to inherit "file" classs in IPY 1.1. Regards, 2008/1/3, Dino Viehland : > FYI this one is already fixed in the v2.0 tree, but I'll look at fixing it in v1.1.1 as well - it's a little more invasive than I'd usually want but it shouldn't be too bad. > > But if you want to work around it for the time being you can replace __init__ w/ __new__: > > class TESTINGwrite(file): > def __new__(cls, fname): > return file.__new__(cls,fname,"w",1) > def writesomething(self): > self.write("Hi there\n") > > x = TESTINGwrite("testing_TMP.txt") > x.writesomething() > > We just have the functionality of __init__ in __new__ currently. And if you want to always work regardless of version it looks like you can just define both __new__ and __init__. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of HEMMI, Shigeru > Sent: Sunday, December 23, 2007 4:00 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython 1.1.1 wish-list? > > 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 textdirected at gmail.com Thu Jan 3 12:16:09 2008 From: textdirected at gmail.com (HEMMI, Shigeru) Date: Thu, 3 Jan 2008 20:16:09 +0900 Subject: [IronPython] IronPython 1.1.1 wish-list? In-Reply-To: <7AD436E4270DD54A94238001769C2227FB8E658914@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227FB8E658914@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Dear Dino, Thanks again. I do not want IPY team to implement dupulicated quit() function. I have to use standard Lib at your suggession. I'm a bit confused standard Lib and runtime implementation. Since my enjoying platform is not Windows/LINUX, but Mac OS X Panther, Apple's terminal does not permit me to use Cntl+D shortcut to quit Ipy sesseion, it was annoying for me to do "import sys; sys.exit()" many times. Regards, 2008/1/3, Dino Viehland : > On quit(): quit is actually not defined by the runtime implementation of Python, rather it's part of the standard library (defined in site.py and installed w/ the setquit function). > > Running w/ the standard library set (or just from CPython's Lib dir) will result in that functionality being available and works even in v1.0: > > 16:52:12.23 > C:\Python25\Lib > C:\Product\Released\IronPython-1.0\ipy.exe > IronPython 1.0.60816 on .NET 2.0.50727.1433 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> quit() > > 16:52:41.39 > C:\Python25\Lib > > > I'd rather not duplicate the functionality in the runtime - is there a reason you can't use the std lib (other than we don't include it by default? :) ). > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of HEMMI, Shigeru > Sent: Sunday, December 23, 2007 4:00 AM > To: Discussion of IronPython > Subject: Re: [IronPython] IronPython 1.1.1 wish-list? > > 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 Thu Jan 3 12:29:58 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 03 Jan 2008 11:29:58 +0000 Subject: [IronPython] [python] Re: IronPython 1.1.1 wish-list? In-Reply-To: <7AD436E4270DD54A94238001769C2227FB8E65890D@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <476E9A01.80404@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227FB8E65890D@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <477CC736.3080007@voidspace.org.uk> Thanks Dino, I think you're right about the second one - it looks like a misunderstanding on our part at some point. I'll remove it from our test suite! Michael Dino Viehland wrote: > I think all of these can be fixed w/ the exception of the first two - or at least I have fixes for them. Now I just need to make sure I haven't broken anything :). The 1st one is probably too invasive to fix in v1.x (and is fixed in v2.0). The 2nd one I'm not sure I understand. I seem to be getting identical results in both IronPython & CPython: > > Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>>> object.__gt__ >>>> > Traceback (most recent call last): > File "", line 1, in > AttributeError: type object 'object' has no attribute '__gt__' > >>>> class Broken(object): >>>> > ... def __getattr__(self, name): > ... raise AttributeError(name) > ... > >>>> Broken().__gt__ >>>> > Traceback (most recent call last): > File "", line 1, in > File "", line 3, in __getattr__ > AttributeError: __gt__ > >>>> Broken() > 3 >>>> > True > >>>> ^Z >>>> > > > IronPython 1.1 (1.1) on .NET 2.0.50727.1433 > Copyright (c) Microsoft Corporation. All rights reserved. > >>>> class Broken(object): >>>> > ... def __getattr__(self, name): > ... raise AttributeError(name) > ... > >>>> Broken().__gt__ >>>> > Traceback (most recent call last): > File , line 0, in ##12 > AttributeError: __gt__ > >>>> Broken() > 3 >>>> > True > >>>> ^Z >>>> > > Am I just missing something? It is the 1st day back since vacation :) > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Sunday, December 23, 2007 9:25 AM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] Re: IronPython 1.1.1 wish-list? > > (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 >> >> >> > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From dinov at exchange.microsoft.com Thu Jan 3 20:53:29 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Thu, 3 Jan 2008 11:53:29 -0800 Subject: [IronPython] Updated hosting spec Message-ID: <7AD436E4270DD54A94238001769C2227FB8E658A3D@DF-GRTDANE-MSG.exchange.corp.microsoft.com> We've updated the hosting API spec for the DLR and uploaded it to: http://compilerlab.members.winisp.net/ (as DOC http://compilerlab.members.winisp.net/dlr-spec-hosting.doc or as PDF http://compilerlab.members.winisp.net/dlr-spec-hosting.pdf). We've been working on updating the code to reflect the spec and you'll see some of that in IronPython 2.0 Alpha 7. You'll continue to see new functionality in the future releases as well as our latest source code drops. Currently I believe IronRuby may be more up-to-date then IronPython's CodePlex page which is a little out of date from the holidays but will be updated soon. Our current status is that we have ScriptEngine, ScriptScope, ObjectOperations, and ScriptSource (but still named SourceUnit) fully implemented - although there are certainly some bugs still lurking. Our current planning going forward is to work on replacing ScriptEnvironment w/ ScriptRuntime, switching to use MBRO objects instead of the interfaces we use today (completing the remoting story), and other small tweaks. In February we'll be looking at finishing up the support for multiple engines in the same app domain, defining and implementing the full set of configuration/options, and general fit-and-finish work. Once again we'd appreciate any feedback you have on the spec or the current implementation. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Fri Jan 4 15:02:33 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 4 Jan 2008 06:02:33 -0800 Subject: [IronPython] Deleting a module from the host Message-ID: In a previous alpha of IPY 2.0, I deleted modules by saying PythonEngine.CurrentEngine.SystemState.modules.Remove(moduleName) (which is almost a direct analog of "del sys.modules[moduleName]"). What's the best approach in Alpha 7? And will this change as IronPython continues to migrate to the DLR? I suppose I could literally execute Python code to do what I want, but it seems so inelegant... -- Curt Hagenlocher curt at hagenlocher.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Fri Jan 4 18:23:43 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 4 Jan 2008 09:23:43 -0800 Subject: [IronPython] Deleting a module from the host In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227FB8E658BC5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Unfortunately the answer is it depends, and it's probably not supported in Alpha 7 :( The depends part is how the module got there and it all revolves around the design we've come up with for the hosting of multiple languages. We have a global object per ScriptRuntime which is (currently) a ScriptScope. That scope holds onto a bunch of name/value bindings (where a value could be another nested ScriptScope) and this is the closest concept (in the DLR) we have to a module. The idea then is that each language exposes the global object via its own mechanism picking something that makes the most sense for that language. IronPython is going to expose the global object via import much like it exposes other modules and .NET namespaces. But that doesn't mean sys.modules goes away, or that sys.modules becomes the global object. Instead what we're currently planning on doing is having import fallback to the global object just as it falls back to the namespaces today. (As I type this I realize it does complicate this scenario - so I'll ask if this sound crazy or like a bad idea? Should we instead try to merge them and have sys.modules == global object? That has its own potential quirks but they could be dealt with.) So that gives two different locations where modules can be published: Either in the global object or in sys.modules. Therefore how you added the module effects how the module gets removed. If the user did "import foo" and we pulled up a .py file it'll end up being in sys.modules. If we pulled up a .js file from the DLR then it'll be in the global object. Further complicating things is the fact that the global object isn't really implemented yet. There's some remnants of the old cross-language module support we had early on but that's not really the global object. So for now in Alpha 7 I think the answer is that you execute the code. There's also one more future possibility: And that is that to expose Python specific functionality we may need to have a PythonEngine class or something that lets you do things that aren't part of the least common denominator. There accessing sys.modules would be a likely piece of functionality to have. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Friday, January 04, 2008 6:03 AM To: Discussion of IronPython Subject: [IronPython] Deleting a module from the host In a previous alpha of IPY 2.0, I deleted modules by saying PythonEngine.CurrentEngine.SystemState.modules.Remove(moduleName) (which is almost a direct analog of "del sys.modules[moduleName]"). What's the best approach in Alpha 7? And will this change as IronPython continues to migrate to the DLR? I suppose I could literally execute Python code to do what I want, but it seems so inelegant... -- Curt Hagenlocher curt at hagenlocher.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Fri Jan 4 21:32:03 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 4 Jan 2008 12:32:03 -0800 Subject: [IronPython] Deleting a module from the host In-Reply-To: <7AD436E4270DD54A94238001769C2227FB8E658BC5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227FB8E658BC5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: I created and published the module myself using ScriptDomainManager.CurrentManager.CreateModule and ScriptDomainManager.CurrentManager.PublishModule. Hmm... I just noticed for the first time the naming inconsistency there between "Module" and "ScriptScope". To back up a step, I'm trying to TDD an integration layer between a C# app and some Python components, and I want to be able to basically "undo" the test actions so it won't influence the next test. If I understand the recent DLR hosting docs correctly, at some point I should be able to accomplish the same thing by creating new ScriptRuntimes instead -- but it looks like IronPython is not yet close to allowing this. When you consider that there might be published ScriptScopes in many different languages then, yeah, it really complicates the potential relationship between the "global object" (that's global per runtime, yes?) and sys.modules. I would certainly want to be able to use DLR modules (sorry, "ScriptScopes") from Python without worrying about their implementation language. How can I get a reference to them if not through sys.modules? How do they get loaded in the first place? What's role does the Python loader and its extensibility mechanisms play when Python code causes a Javascript module to be loaded? Plenty of fun questions! On Jan 4, 2008 9:23 AM, Dino Viehland wrote: > Unfortunately the answer is it depends, and it's probably not supported > in Alpha 7 L > > > > The depends part is how the module got there and it all revolves around > the design we've come up with for the hosting of multiple languages. We > have a global object per ScriptRuntime which is (currently) a ScriptScope. > That scope holds onto a bunch of name/value bindings (where a value could be > another nested ScriptScope) and this is the closest concept (in the DLR) we > have to a module. The idea then is that each language exposes the global > object via its own mechanism picking something that makes the most sense for > that language. IronPython is going to expose the global object via import > much like it exposes other modules and .NET namespaces. But that doesn't > mean sys.modules goes away, or that sys.modules becomes the global > object. Instead what we're currently planning on doing is having import > fallback to the global object just as it falls back to the namespaces today. > (As I type this I realize it does complicate this scenario ? so I'll ask if > this sound crazy or like a bad idea? Should we instead try to merge them > and have sys.modules == global object? That has its own potential quirks > but they could be dealt with.) > > > > So that gives two different locations where modules can be published: > Either in the global object or in sys.modules. Therefore how you added > the module effects how the module gets removed. If the user did "import > foo" and we pulled up a .py file it'll end up being in sys.modules. If we > pulled up a .js file from the DLR then it'll be in the global object. > > > > Further complicating things is the fact that the global object isn't > really implemented yet. There's some remnants of the old cross-language > module support we had early on but that's not really the global object. So > for now in Alpha 7 I think the answer is that you execute the code. > > > > There's also one more future possibility: And that is that to expose > Python specific functionality we may need to have a PythonEngine class or > something that lets you do things that aren't part of the least common > denominator. There accessing sys.modules would be a likely piece of > functionality to have. > > > > *From:* users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] > *On Behalf Of *Curt Hagenlocher > *Sent:* Friday, January 04, 2008 6:03 AM > *To:* Discussion of IronPython > *Subject:* [IronPython] Deleting a module from the host > > > > In a previous alpha of IPY 2.0, I deleted modules by saying > > PythonEngine.CurrentEngine.SystemState.modules.Remove(moduleName) > > (which is almost a direct analog of "del sys.modules[moduleName]"). > > > > What's the best approach in Alpha 7? And will this change as IronPython > continues to migrate to the DLR? > > > > I suppose I could literally execute Python code to do what I want, but it > seems so inelegant... > > > > -- > > Curt Hagenlocher > > curt at hagenlocher.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 kamil at dworakowski.name Fri Jan 4 21:36:08 2008 From: kamil at dworakowski.name (Kamil Dworakowski) Date: Fri, 04 Jan 2008 20:36:08 +0000 Subject: [IronPython] IronPython 1.1.1 wish-list? In-Reply-To: References: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227FB8E658914@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <477E98B8.9040002@dworakowski.name> 14632 looks pretty nasty and easy to fix. Good candidate for 1.1.1? WeakObject.Equals throws null pointer exception http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=14632 WeakObject is an internal class of IronPython, a component used in WeakHash. I would especially like it fixed because I think it blocks us making workarounds for 14454. Getting objects garbage collected makes us hit 14632. -- Kamil From dinov at exchange.microsoft.com Sat Jan 5 00:26:12 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 4 Jan 2008 15:26:12 -0800 Subject: [IronPython] Deleting a module from the host In-Reply-To: References: <7AD436E4270DD54A94238001769C2227FB8E658BC5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227FB8E658D28@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Yeah, I agree with you, creating a new ScriptRuntime is definitely the way to go, and we're definitely there yet :( - the good news is we think we'll be finishing that support up in February. On cross-lang modules: The way you'd get a reference to these is via the normal import mechanism rather than the more programmatic sys.modules['Foo']. The way they get loaded is that import has some special magic which will call into the current ScriptRuntime and ask it to try and load the appropriately named module. Then the ScriptRuntime would ask the host to load the ScriptScope and depending on the host it'd search the web server, the file system, the database, etc... for the appropriately named file, and load it with the appropriate engine. So it's really all comes down to Python making one call into the DLR and the DLR returning a ScriptScope which pops back out of import. From then on out additional imports would hit the DLR's cache of ScriptScope for that particular name and return it. After thinking about it some more I'm leaning towards unifying globals & sys.modules - the only downside is potentially playing more games w/ dictionary types but we already do a lot of that anyway :(. PublishModule (I suspect you mean it's on ScriptEngine) is going away in the future as well - but that is going to sys.modules so for alpha 7 I'd suggest the hacky solution of just doing the del sys.modules[] and then once we have the global object worked out you'll just be able to remove the scopes from that - at least until we get multiple runtime support. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Friday, January 04, 2008 12:32 PM To: Discussion of IronPython Subject: Re: [IronPython] Deleting a module from the host I created and published the module myself using ScriptDomainManager.CurrentManager.CreateModule and ScriptDomainManager.CurrentManager.PublishModule. Hmm... I just noticed for the first time the naming inconsistency there between "Module" and "ScriptScope". To back up a step, I'm trying to TDD an integration layer between a C# app and some Python components, and I want to be able to basically "undo" the test actions so it won't influence the next test. If I understand the recent DLR hosting docs correctly, at some point I should be able to accomplish the same thing by creating new ScriptRuntimes instead -- but it looks like IronPython is not yet close to allowing this. When you consider that there might be published ScriptScopes in many different languages then, yeah, it really complicates the potential relationship between the "global object" (that's global per runtime, yes?) and sys.modules. I would certainly want to be able to use DLR modules (sorry, "ScriptScopes") from Python without worrying about their implementation language. How can I get a reference to them if not through sys.modules ? How do they get loaded in the first place? What's role does the Python loader and its extensibility mechanisms play when Python code causes a Javascript module to be loaded? Plenty of fun questions! On Jan 4, 2008 9:23 AM, Dino Viehland > wrote: Unfortunately the answer is it depends, and it's probably not supported in Alpha 7 :( The depends part is how the module got there and it all revolves around the design we've come up with for the hosting of multiple languages. We have a global object per ScriptRuntime which is (currently) a ScriptScope. That scope holds onto a bunch of name/value bindings (where a value could be another nested ScriptScope) and this is the closest concept (in the DLR) we have to a module. The idea then is that each language exposes the global object via its own mechanism picking something that makes the most sense for that language. IronPython is going to expose the global object via import much like it exposes other modules and .NET namespaces. But that doesn't mean sys.modules goes away, or that sys.modules becomes the global object. Instead what we're currently planning on doing is having import fallback to the global object just as it falls back to the namespaces today. (As I type this I realize it does complicate this scenario - so I'll ask if this sound crazy or like a bad idea? Should we instead try to merge them and have sys.modules == global object? That has its own potential quirks but they could be dealt with.) So that gives two different locations where modules can be published: Either in the global object or in sys.modules. Therefore how you added the module effects how the module gets removed. If the user did "import foo" and we pulled up a .py file it'll end up being in sys.modules. If we pulled up a .js file from the DLR then it'll be in the global object. Further complicating things is the fact that the global object isn't really implemented yet. There's some remnants of the old cross-language module support we had early on but that's not really the global object. So for now in Alpha 7 I think the answer is that you execute the code. There's also one more future possibility: And that is that to expose Python specific functionality we may need to have a PythonEngine class or something that lets you do things that aren't part of the least common denominator. There accessing sys.modules would be a likely piece of functionality to have. From: users-bounces at lists.ironpython.com [mailto: users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Friday, January 04, 2008 6:03 AM To: Discussion of IronPython Subject: [IronPython] Deleting a module from the host In a previous alpha of IPY 2.0, I deleted modules by saying PythonEngine.CurrentEngine.SystemState.modules.Remove(moduleName) (which is almost a direct analog of "del sys.modules[moduleName]"). What's the best approach in Alpha 7? And will this change as IronPython continues to migrate to the DLR? I suppose I could literally execute Python code to do what I want, but it seems so inelegant... -- Curt Hagenlocher curt at hagenlocher.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 curt at hagenlocher.org Sat Jan 5 00:36:26 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Fri, 4 Jan 2008 15:36:26 -0800 Subject: [IronPython] Deleting a module from the host In-Reply-To: <7AD436E4270DD54A94238001769C2227FB8E658D28@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227FB8E658BC5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227FB8E658D28@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On Jan 4, 2008 3:26 PM, Dino Viehland wrote: > > Then the ScriptRuntime would ask the > host to load the ScriptScope and depending on the host it'd search the web > server, the file system, the database, etc? for the appropriately named > file, and load it with the appropriate engine. So it would be the host that would both load the source and determine the engine, and the default Pythonic behavior (for the Python engine) would be available by using a "standard Python host"? > PublishModule (I suspect you mean it's on ScriptEngine) No, I'm using it on ScriptDomainManager.CurrentManager -- I don't see one implemented on ScriptEngine in the latest drop. There's a bug in ScriptDomainManager.GetPublishedModules that I've started running into; guess I'll post it to Codeplex. -- Curt Hagenlocher curt at hagenlocher.org From dinov at exchange.microsoft.com Sat Jan 5 00:40:52 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 4 Jan 2008 15:40:52 -0800 Subject: [IronPython] IronPython 1.1.1 wish-list? In-Reply-To: <477E98B8.9040002@dworakowski.name> References: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227FB8E658914@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <477E98B8.9040002@dworakowski.name> Message-ID: <7AD436E4270DD54A94238001769C2227FB8E658D32@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Yep, I think this can be fixed. I've got a tentative fix and it looks like it works and doesn't break anything. Thanks for bringing attention to this. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kamil Dworakowski Sent: Friday, January 04, 2008 12:36 PM To: textdirected at gmail.com; Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.1 wish-list? 14632 looks pretty nasty and easy to fix. Good candidate for 1.1.1? WeakObject.Equals throws null pointer exception http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=14632 WeakObject is an internal class of IronPython, a component used in WeakHash. I would especially like it fixed because I think it blocks us making workarounds for 14454. Getting objects garbage collected makes us hit 14632. -- Kamil _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dinov at exchange.microsoft.com Sat Jan 5 01:18:07 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 4 Jan 2008 16:18:07 -0800 Subject: [IronPython] Deleting a module from the host In-Reply-To: References: <7AD436E4270DD54A94238001769C2227FB8E658BC5@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227FB8E658D28@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C2227FB8E658D57@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Yep, the host resolves the source code & the engine type (this is in ScriptHost.ResolveSourceFileUnit which returns a ScriptSource (SourceUnit today) which is already bound to an engine). We haven't yet closely reviewed the ScriptHost API but I suspect it's pretty close to what it'll end up being. Oh, I'm guessing Tomas moved the PublishModule onto ScriptEngine since Alpha 7, but it almost certainly does the same thing wherever it is :). Opening the bug sounds good - most likely this will just go away (as anything related to "modules" will), but we might end up reusing the code so it's good to have it tracked. Thanks! -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Friday, January 04, 2008 3:36 PM To: Discussion of IronPython Subject: Re: [IronPython] Deleting a module from the host On Jan 4, 2008 3:26 PM, Dino Viehland wrote: > > Then the ScriptRuntime would ask the > host to load the ScriptScope and depending on the host it'd search the web > server, the file system, the database, etc... for the appropriately named > file, and load it with the appropriate engine. So it would be the host that would both load the source and determine the engine, and the default Pythonic behavior (for the Python engine) would be available by using a "standard Python host"? > PublishModule (I suspect you mean it's on ScriptEngine) No, I'm using it on ScriptDomainManager.CurrentManager -- I don't see one implemented on ScriptEngine in the latest drop. There's a bug in ScriptDomainManager.GetPublishedModules that I've started running into; guess I'll post it to Codeplex. -- Curt Hagenlocher curt at hagenlocher.org _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From kamil at dworakowski.name Sat Jan 5 14:52:13 2008 From: kamil at dworakowski.name (Kamil Dworakowski) Date: Sat, 05 Jan 2008 13:52:13 +0000 Subject: [IronPython] Newbie, feedback/question In-Reply-To: <13a83ca10712190714s743bd4bav6aeb9a2f9c77fec6@mail.gmail.com> References: <13a83ca10712190714s743bd4bav6aeb9a2f9c77fec6@mail.gmail.com> Message-ID: <477F8B8D.90405@dworakowski.name> > 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. In WPF (includes silverlight) you can define forms using xaml (sth like defining a page in html). Have you tried it? In my opinion it is better than visual GUI designer. -- Kamil http://blog.kamil.dworakowski.name From francois.schnell at gmail.com Sat Jan 5 23:13:43 2008 From: francois.schnell at gmail.com (=?ISO-8859-1?Q?Fran=E7ois_Schnell?=) Date: Sat, 5 Jan 2008 23:13:43 +0100 Subject: [IronPython] "Visual Studio Python Express" (was: Re: Newbie, feedback/question) Message-ID: <13a83ca10801051413h3c1007c6h2f070900100eb270@mail.gmail.com> On Jan 5, 2008 2:52 PM, Kamil Dworakowski wrote: > > > 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. > > In WPF (includes silverlight) you can define forms using xaml (sth like > defining a page in html). Have you tried it? Yes, the clean separation between the 'GUI' markup language and the logic is one of the main reason I'm interested in both WPF/Silverlight and Air/Flex. In my opinion it is better > than visual GUI designer. I'm not sure of that for complex/rich GUIs. According to the Chris Anderson book I'm reading "Essential Windows Presentation Foundation" Page 13: """ XAML was created to be a markup language that integrated well with the CLRand provided for rich tools support. A secondary goal was to create a markup format that was easy to read and write. It may seem a little rude to design a feature of the platform that is optimized first for tools, then for humans, but the WPF team felt strongly that WPF applications would typically be authored with the assistance of a visual design tool like Microsoft Visual Studio of Microsoft Expression. """ (Great book BTW, Chris Anderson is one of the chief architects of WPF) Anyway, the way I'd like to develop my GUI apps. is not really important. What I'd like to see is a wide adoption of IronPython and I believe it won't happen without a sort of "Visual Studio Python Express" ("free", maintained, IDE with a GUI designer for winforms and WPF). (more on this in my next mail) Fran?ois > -------------- next part -------------- An HTML attachment was scrubbed... URL: From francois.schnell at gmail.com Sat Jan 5 23:26:03 2008 From: francois.schnell at gmail.com (=?ISO-8859-1?Q?Fran=E7ois_Schnell?=) Date: Sat, 5 Jan 2008 23:26:03 +0100 Subject: [IronPython] "Visual Studio Python Express" (was: Re: Newbie, feedback/question) Message-ID: <13a83ca10801051426seb05a22hf4f6f6f00aad2a10@mail.gmail.com> On Dec 20, 2007 12:10 AM, John Messerly wrote: > Also, just to be clear: we (IronPython team) didn't write "IronPython > Studio". Although it sure looks like a cool project! Thanks for this information which is not really a good news for me (with some distance). The author of IronPython Studio has an @microsoft.com email, I thought (from my external point of view) that the Iron Python team could have been the initiator, or at least be "in the loop" and aware of it. I think it's unfortunate because I think you're right, "it looks like" a cool project. But I'm not sure if the author has any intention to use the IDE he made himself. I hope to be wrong (holiday period effect maybe) but I suspect "Iron Python Studio" to be mainly an example/"proof of concept" for the VS shell isolated. I say this because looking at the forum: - the software installation instructions are incomplete on the website since the beginning - the author didn't reply anyone since the 12th of december (24 days ago) - had many problem with Iron Python Studio that I didn't encounter in Visual Studio C# After some perplex thinking I came to the obvious, but unnatural, solution for me (coming from CPython, wanted to make "quickly" "rich" GUIs apps on Windows): Take advantage of my holiday, dive into C# and use the well maintained free Visual Studio C# Express ... For information, one of my original entertaining plan for the holiday was: "Dive into Iron Python", use Iron Python Studio and buy the early access to Fuzzyman "IronPython in Action" book. Anyway that's fine for me (I'll probably use latter a combination of C# and IP) but I'd still like to see, one day, a kind of free "Visual Studio Python Express" (or whatever you might call it). I've seen so many people coming to Python, loving the compactness, clean syntax, dynamic nature and then asking the killer question: "How can I quickly make my GUI, you know, like in Visual Basic?" At this point they look at tkinter ("battery included" we told them), the majority find it ugly and limited and go or go back to Visual Something Express (even if they prefer Python as a language). Combine, - a concise, easy to learn, dynamic, yet powerful language like Python - an easy and powerful designer to make rich GUIs with the power of Visual Studio (Winforms,WPF,Silverlight) - being also able to leverage .Net libs - making it free for download - maintaining it a little, managing properly your new community on codeplex => my guess, this is a WINNER in term of potential adoption. But maybe Iron Python is more intended as a research/testbed for the DLR, not targeted for wide adoption (even if Resolver is using it). Or maybe it is just too early. In this case are there any plan to offer latter such an IDE (any roadmap?) If not I would appreciate if the Iron Python team consider it. Anyway, thanks for reading and all the best to the IronPython team in 2008. Fran?ois > > > - 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 > _______________________________________________ > 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 kamil at dworakowski.name Sat Jan 5 23:53:06 2008 From: kamil at dworakowski.name (Kamil Dworakowski) Date: Sat, 05 Jan 2008 22:53:06 +0000 Subject: [IronPython] IronPython 1.1.1 wish-list? In-Reply-To: <7AD436E4270DD54A94238001769C2227FB8E658D32@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227FB8E658914@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <477E98B8.9040002@dworakowski.name> <7AD436E4270DD54A94238001769C2227FB8E658D32@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <47800A52.3030302@dworakowski.name> That would be great. When may we expect 1.1.1 release? > Yep, I think this can be fixed. I've got a tentative fix and it looks like it works and doesn't break anything. Thanks for bringing attention to this. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kamil Dworakowski > Sent: Friday, January 04, 2008 12:36 PM > To: textdirected at gmail.com; Discussion of IronPython > Subject: Re: [IronPython] IronPython 1.1.1 wish-list? > > 14632 looks pretty nasty and easy to fix. Good candidate for 1.1.1? > > WeakObject.Equals throws null pointer exception > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=14632 > > WeakObject is an internal class of IronPython, a component used in WeakHash. > > I would especially like it fixed because I think it blocks us making > workarounds for 14454. Getting objects garbage collected makes us hit 14632. > > From francois.schnell at gmail.com Sun Jan 6 10:22:44 2008 From: francois.schnell at gmail.com (=?ISO-8859-1?Q?Fran=E7ois_Schnell?=) Date: Sun, 6 Jan 2008 10:22:44 +0100 Subject: [IronPython] "Visual Studio Python Express" (was: Re: Newbie, feedback/question) In-Reply-To: <13a83ca10801051426seb05a22hf4f6f6f00aad2a10@mail.gmail.com> References: <13a83ca10801051426seb05a22hf4f6f6f00aad2a10@mail.gmail.com> Message-ID: <13a83ca10801060122r729f5141o6a8aa84286c9d5fb@mail.gmail.com> On Jan 5, 2008 11:26 PM, Fran?ois Schnell wrote: > > The author of IronPython Studio has an @microsoft.com email, > EDIT(correction): It looks I've mixed up this part with an "@ discussions.microsoft.com" >From an early Blog post from the author: """IronPython Studio is now available as free download. Working with the VSX team at Microsoft""" francois -------------- next part -------------- An HTML attachment was scrubbed... URL: From daftspaniel at gmail.com Sun Jan 6 19:57:21 2008 From: daftspaniel at gmail.com (Davy Mitchell) Date: Sun, 6 Jan 2008 18:57:21 +0000 Subject: [IronPython] Encoding Issue with Hex Message-ID: <20253b0c0801061057i7075d430s8617d866e4af5efc@mail.gmail.com> Hi All, There's a few encoding issues on CodePlex. Does this fall under one of them? Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> _BYTES = '7FF80000000000007FF0000000000000'.decode('hex') IronPython console: IronPython 2.0A6 (2.0.11102.00) on .NET 2.0.50727.1433 Copyright (c) Microsoft Corporation. All rights reserved. >>> _BYTES = '7FF80000000000007FF0000000000000'.decode('hex') Traceback (most recent call last): File , line 0, in ##233 LookupError: unknown encoding: hex -- Davy Mitchell Blog - http://www.latedecember.co.uk/sites/personal/davy/ Twitter - http://twitter.com/daftspaniel Skype - daftspaniel needgod.com From khoard at gmail.com Sun Jan 6 20:56:24 2008 From: khoard at gmail.com (Keith Hoard) Date: Sun, 6 Jan 2008 13:56:24 -0600 Subject: [IronPython] Newbie questions. . . Message-ID: <6792ef120801061156h1da17689yb78c6514fc09e841@mail.gmail.com> I have a few questions about getting up and running with IronPython. I have downloaded and installed ipy.exe to the D:\IronPython directory. I have also added this directory to the Path environment varialble. However, when I try to run the examples (In this case "tutorial.py") from the web site, I get the following error: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. D:\IronPython>ipy tutorial.py Traceback (most recent call last): File D:\IronPython\tutorial.py, line 19, in Initialize File , line 0, in AddReferenceByPartialName##12 IOError: Could not add reference to assembly Microsoft.DirectX When I try to run the other samples, I get similar errors. Is there another environment variable that I'm supposed to set so that IPy can find the .NET libraries? Also, if there is some documentation that I missed, I was hoping that someone could point me in the right direction. Thanks in advance for any help. . . -------------- next part -------------- An HTML attachment was scrubbed... URL: From Martin.Maly at microsoft.com Sun Jan 6 21:14:29 2008 From: Martin.Maly at microsoft.com (Martin Maly) Date: Sun, 6 Jan 2008 12:14:29 -0800 Subject: [IronPython] Newbie questions. . . In-Reply-To: <6792ef120801061156h1da17689yb78c6514fc09e841@mail.gmail.com> References: <6792ef120801061156h1da17689yb78c6514fc09e841@mail.gmail.com> Message-ID: Some of the samples have prerequisites. I believe the DirectX tutorial comes with a great readme (readme.html) that should get you going. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith Hoard Sent: Sunday, January 06, 2008 11:56 AM To: IronPython Mailing List Subject: [IronPython] Newbie questions. . . I have a few questions about getting up and running with IronPython. I have downloaded and installed ipy.exe to the D:\IronPython directory. I have also added this directory to the Path environment varialble. However, when I try to run the examples (In this case " tutorial.py") from the web site, I get the following error: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. D:\IronPython>ipy tutorial.py Traceback (most recent call last): File D:\IronPython\tutorial.py, line 19, in Initialize File , line 0, in AddReferenceByPartialName##12 IOError: Could not add reference to assembly Microsoft.DirectX When I try to run the other samples, I get similar errors. Is there another environment variable that I'm supposed to set so that IPy can find the .NET libraries? Also, if there is some documentation that I missed, I was hoping that someone could point me in the right direction. Thanks in advance for any help. . . -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Mon Jan 7 01:00:01 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 7 Jan 2008 09:00:01 +0900 Subject: [IronPython] Encoding Issue with Hex In-Reply-To: <20253b0c0801061057i7075d430s8617d866e4af5efc@mail.gmail.com> References: <20253b0c0801061057i7075d430s8617d866e4af5efc@mail.gmail.com> Message-ID: <5b0248170801061600q3f804ce6pff5506ea22386ffb@mail.gmail.com> 2008/1/7, Davy Mitchell : > There's a few encoding issues on CodePlex. Does this fall under one of them? > > IronPython console: IronPython 2.0A6 (2.0.11102.00) on .NET 2.0.50727.1433 > Copyright (c) Microsoft Corporation. All rights reserved. > >>> _BYTES = '7FF80000000000007FF0000000000000'.decode('hex') > Traceback (most recent call last): > File , line 0, in ##233 > LookupError: unknown encoding: hex Yes. But "import encodings" should make hex encoding available. -- Seo Sanghyeon From khoard at gmail.com Mon Jan 7 06:33:03 2008 From: khoard at gmail.com (Keith Hoard) Date: Sun, 6 Jan 2008 23:33:03 -0600 Subject: [IronPython] Newbie questions. . . In-Reply-To: References: <6792ef120801061156h1da17689yb78c6514fc09e841@mail.gmail.com> Message-ID: <6792ef120801062133i738ecb90n8bdd4a02d0b54294@mail.gmail.com> Thanks!! On Jan 6, 2008 2:14 PM, Martin Maly wrote: > Some of the samples have prerequisites. I believe the DirectX tutorial > comes with a great readme (readme.html) that should get you going. > > > > *From:* users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] *On Behalf Of *Keith Hoard > *Sent:* Sunday, January 06, 2008 11:56 AM > *To:* IronPython Mailing List > *Subject:* [IronPython] Newbie questions. . . > > > > I have a few questions about getting up and running with IronPython. > > I have downloaded and installed ipy.exe to the D:\IronPython directory. I > have also added this directory to the Path environment varialble. However, > when I try to run the examples (In this case " tutorial.py") from the web > site, I get the following error: > > > Microsoft Windows XP [Version 5.1.2600] > (C) Copyright 1985-2001 Microsoft Corp. > > D:\IronPython>ipy tutorial.py > Traceback (most recent call last): > File D:\IronPython\tutorial.py, line 19, in Initialize > File , line 0, in AddReferenceByPartialName##12 > IOError: Could not add reference to assembly Microsoft.DirectX > > When I try to run the other samples, I get similar errors. Is there > another environment variable that I'm supposed to set so that IPy can find > the .NET libraries? Also, if there is some documentation that I missed, I > was hoping that someone could point me in the right direction. > > Thanks in advance for any help. . . > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- Keith Hoard Collierville, TN khoard at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Mon Jan 7 17:20:55 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 7 Jan 2008 08:20:55 -0800 Subject: [IronPython] IronPython 1.1.1 wish-list? In-Reply-To: <47800A52.3030302@dworakowski.name> References: <7AD436E4270DD54A94238001769C2227F41C65E64E@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227FB8E658914@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <477E98B8.9040002@dworakowski.name> <7AD436E4270DD54A94238001769C2227FB8E658D32@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <47800A52.3030302@dworakowski.name> Message-ID: <7AD436E4270DD54A94238001769C2227FB8E658E13@DF-GRTDANE-MSG.exchange.corp.microsoft.com> We hope to have an RC sometime soon and the final release will probably be later this month or early February. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kamil Dworakowski Sent: Saturday, January 05, 2008 2:53 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython 1.1.1 wish-list? That would be great. When may we expect 1.1.1 release? > Yep, I think this can be fixed. I've got a tentative fix and it looks like it works and doesn't break anything. Thanks for bringing attention to this. > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kamil Dworakowski > Sent: Friday, January 04, 2008 12:36 PM > To: textdirected at gmail.com; Discussion of IronPython > Subject: Re: [IronPython] IronPython 1.1.1 wish-list? > > 14632 looks pretty nasty and easy to fix. Good candidate for 1.1.1? > > WeakObject.Equals throws null pointer exception > http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=14632 > > WeakObject is an internal class of IronPython, a component used in WeakHash. > > I would especially like it fixed because I think it blocks us making > workarounds for 14454. Getting objects garbage collected makes us hit 14632. > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From khoard at gmail.com Mon Jan 7 18:51:28 2008 From: khoard at gmail.com (FireNWater) Date: Mon, 7 Jan 2008 09:51:28 -0800 (PST) Subject: [IronPython] Newbie questions. . . In-Reply-To: <6792ef120801062133i738ecb90n8bdd4a02d0b54294@mail.gmail.com> References: <6792ef120801061156h1da17689yb78c6514fc09e841@mail.gmail.com> <6792ef120801062133i738ecb90n8bdd4a02d0b54294@mail.gmail.com> Message-ID: <51b40c76-75b4-4008-b50f-50ac2b83eba1@q77g2000hsh.googlegroups.com> OK, I'm making progress. . . at least now I'm getting an error in a dialogue box, and actually got it to work once this morning!! I have updated the DirectX SDK to the November 2007 version and the Direct X version on my computer is 9.0. I also have the .NET SDK 2.0 installed. D:\IronPython\Samples\Direct3D>ipy demo1.py Traceback (most recent call last): File D:\IronPython\Samples\Direct3D\demo1.py, line 69, in Initialize File D:\IronPython\Samples\Direct3D\framework.py, line 600, in Main File D:\IronPython\Samples\Direct3D\framework.py, line 425, in InitGraphics File , line 0, in .ctor##75 File Microsoft.DirectX, line unknown, in .ctor File Microsoft.DirectX, line unknown, in CheckTimeBomb StandardError: This pre-release version of DirectX has expired, please upgrade to the latest version from http://www.microsoft.com/directx D:\IronPython\Samples\Direct3D> On Jan 6, 11:33 pm, "Keith Hoard" wrote: > Thanks!! > > On Jan 6, 2008 2:14 PM, Martin Maly wrote: > > > > > Some of the samples have prerequisites. I believe the DirectX tutorial > > comes with a great readme (readme.html) that should get you going. > > > *From:* users-boun... at lists.ironpython.com [mailto: > > users-boun... at lists.ironpython.com] *On Behalf Of *Keith Hoard > > *Sent:* Sunday, January 06, 2008 11:56 AM > > *To:* IronPython Mailing List > > *Subject:* [IronPython] Newbie questions. . . > > > I have a few questions about getting up and running with IronPython. > > > I have downloaded and installed ipy.exe to the D:\IronPython directory. I > > have also added this directory to the Path environment varialble. However, > > when I try to run the examples (In this case " tutorial.py") from the web > > site, I get the following error: > > > Microsoft Windows XP [Version 5.1.2600] > > (C) Copyright 1985-2001 Microsoft Corp. > > > D:\IronPython>ipy tutorial.py > > Traceback (most recent call last): > > File D:\IronPython\tutorial.py, line 19, in Initialize > > File , line 0, in AddReferenceByPartialName##12 > > IOError: Could not add reference to assembly Microsoft.DirectX > > > When I try to run the other samples, I get similar errors. Is there > > another environment variable that I'm supposed to set so that IPy can find > > the .NET libraries? Also, if there is some documentation that I missed, I > > was hoping that someone could point me in the right direction. > > > Thanks in advance for any help. . . > > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython.com > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- > > Keith Hoard > Collierville, TN > kho... at gmail.com > > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com From dfugate at microsoft.com Mon Jan 7 21:14:01 2008 From: dfugate at microsoft.com (Dave Fugate) Date: Mon, 7 Jan 2008 12:14:01 -0800 Subject: [IronPython] Newbie questions. . . In-Reply-To: <51b40c76-75b4-4008-b50f-50ac2b83eba1@q77g2000hsh.googlegroups.com> References: <6792ef120801061156h1da17689yb78c6514fc09e841@mail.gmail.com> <6792ef120801062133i738ecb90n8bdd4a02d0b54294@mail.gmail.com> <51b40c76-75b4-4008-b50f-50ac2b83eba1@q77g2000hsh.googlegroups.com> Message-ID: <7346A825E148B049A9AD1D3ED46A2D9116C61ABD4D@NA-EXMSG-C106.redmond.corp.microsoft.com> The "Prerequisites" section of the readme.htm distributed with the Direct3D sample contains info on fixing this (i.e., using Managed DirectX 1 instead of the 2.0 Beta). Basically please replace all occurrences of: clr.AddReference("Microsoft.DirectX") with: clr.AddReferenceByName('Microsoft.DirectX, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35') throughout the sample. Hope that helps! -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of FireNWater Sent: Monday, January 07, 2008 9:51 AM To: users at lists.ironpython.com Subject: Re: [IronPython] Newbie questions. . . OK, I'm making progress. . . at least now I'm getting an error in a dialogue box, and actually got it to work once this morning!! I have updated the DirectX SDK to the November 2007 version and the Direct X version on my computer is 9.0. I also have the .NET SDK 2.0 installed. D:\IronPython\Samples\Direct3D>ipy demo1.py Traceback (most recent call last): File D:\IronPython\Samples\Direct3D\demo1.py, line 69, in Initialize File D:\IronPython\Samples\Direct3D\framework.py, line 600, in Main File D:\IronPython\Samples\Direct3D\framework.py, line 425, in InitGraphics File , line 0, in .ctor##75 File Microsoft.DirectX, line unknown, in .ctor File Microsoft.DirectX, line unknown, in CheckTimeBomb StandardError: This pre-release version of DirectX has expired, please upgrade to the latest version from http://www.microsoft.com/directx D:\IronPython\Samples\Direct3D> On Jan 6, 11:33 pm, "Keith Hoard" wrote: > Thanks!! > > On Jan 6, 2008 2:14 PM, Martin Maly wrote: > > > > > Some of the samples have prerequisites. I believe the DirectX tutorial > > comes with a great readme (readme.html) that should get you going. > > > *From:* users-boun... at lists.ironpython.com [mailto: > > users-boun... at lists.ironpython.com] *On Behalf Of *Keith Hoard > > *Sent:* Sunday, January 06, 2008 11:56 AM > > *To:* IronPython Mailing List > > *Subject:* [IronPython] Newbie questions. . . > > > I have a few questions about getting up and running with IronPython. > > > I have downloaded and installed ipy.exe to the D:\IronPython directory. I > > have also added this directory to the Path environment varialble. However, > > when I try to run the examples (In this case " tutorial.py") from the web > > site, I get the following error: > > > Microsoft Windows XP [Version 5.1.2600] > > (C) Copyright 1985-2001 Microsoft Corp. > > > D:\IronPython>ipy tutorial.py > > Traceback (most recent call last): > > File D:\IronPython\tutorial.py, line 19, in Initialize > > File , line 0, in AddReferenceByPartialName##12 > > IOError: Could not add reference to assembly Microsoft.DirectX > > > When I try to run the other samples, I get similar errors. Is there > > another environment variable that I'm supposed to set so that IPy can find > > the .NET libraries? Also, if there is some documentation that I missed, I > > was hoping that someone could point me in the right direction. > > > Thanks in advance for any help. . . > > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython.com > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- > > Keith Hoard > Collierville, TN > kho... at gmail.com > > _______________________________________________ > Users mailing list > Us... at lists.ironpython.comhttp://lists.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 Mon Jan 7 23:43:29 2008 From: daftspaniel at gmail.com (Davy Mitchell) Date: Mon, 7 Jan 2008 22:43:29 +0000 Subject: [IronPython] Encoding Issue with Hex In-Reply-To: <5b0248170801061600q3f804ce6pff5506ea22386ffb@mail.gmail.com> References: <20253b0c0801061057i7075d430s8617d866e4af5efc@mail.gmail.com> <5b0248170801061600q3f804ce6pff5506ea22386ffb@mail.gmail.com> Message-ID: <20253b0c0801071443j36d2d463s893bdfa3dca59a62@mail.gmail.com> Thanks for the workaround Seo :-) On Jan 7, 2008 12:00 AM, Sanghyeon Seo wrote: > 2008/1/7, Davy Mitchell : > > There's a few encoding issues on CodePlex. Does this fall under one of them? > > > > IronPython console: IronPython 2.0A6 (2.0.11102.00) on .NET 2.0.50727.1433 > > Copyright (c) Microsoft Corporation. All rights reserved. > > >>> _BYTES = '7FF80000000000007FF0000000000000'.decode('hex') > > Traceback (most recent call last): > > File , line 0, in ##233 > > LookupError: unknown encoding: hex > > Yes. But "import encodings" should make hex encoding available. > > -- > Seo Sanghyeon > _______________________________________________ > 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 khoard at gmail.com Tue Jan 8 04:27:43 2008 From: khoard at gmail.com (Keith Hoard) Date: Mon, 7 Jan 2008 21:27:43 -0600 Subject: [IronPython] Newbie questions. . . In-Reply-To: <7346A825E148B049A9AD1D3ED46A2D9116C61ABD4D@NA-EXMSG-C106.redmond.corp.microsoft.com> References: <6792ef120801061156h1da17689yb78c6514fc09e841@mail.gmail.com> <6792ef120801062133i738ecb90n8bdd4a02d0b54294@mail.gmail.com> <51b40c76-75b4-4008-b50f-50ac2b83eba1@q77g2000hsh.googlegroups.com> <7346A825E148B049A9AD1D3ED46A2D9116C61ABD4D@NA-EXMSG-C106.redmond.corp.microsoft.com> Message-ID: <6792ef120801071927m6cd06868j70674621af40e2d4@mail.gmail.com> Thanks, Dave. At first I was wondering how I missed it, so I went back and re-downloaded the Direct3D samples ZIP files. When I unzipped it, there it was in the prereques section, clear as day. However, the readme file I was using was dated September 16, 2006, 12:36:38 PM and doesn't have those instructions in the Pre-req section. The correct readme file is dated Friday, December 01, 2006, 9:45:54 AM and has this information. I wish I could remember where I got a hold of the outdated file so whoever is in charge of the website can track it down. On Jan 7, 2008 2:14 PM, Dave Fugate wrote: > The "Prerequisites" section of the readme.htm distributed with the > Direct3D sample contains info on fixing this (i.e., using Managed DirectX > 1 instead of the 2.0 Beta). Basically please replace all occurrences of: > clr.AddReference("Microsoft.DirectX") > > with: > clr.AddReferenceByName('Microsoft.DirectX, Version=1.0.2902.0, > Culture=neutral, PublicKeyToken=31bf3856ad364e35') > > throughout the sample. > > Hope that helps! > > > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto: > users-bounces at lists.ironpython.com] On Behalf Of FireNWater > Sent: Monday, January 07, 2008 9:51 AM > To: users at lists.ironpython.com > Subject: Re: [IronPython] Newbie questions. . . > > OK, I'm making progress. . . at least now I'm getting an error in a > dialogue box, and actually got it to work once this morning!! > > I have updated the DirectX SDK to the November 2007 version and the > Direct X version on my computer is 9.0. I also have the .NET SDK 2.0 > installed. > > D:\IronPython\Samples\Direct3D>ipy demo1.py > Traceback (most recent call last): > File D:\IronPython\Samples\Direct3D\demo1.py, line 69, in Initialize > File D:\IronPython\Samples\Direct3D\framework.py, line 600, in Main > File D:\IronPython\Samples\Direct3D\framework.py, line 425, in > InitGraphics > File , line 0, in .ctor##75 > File Microsoft.DirectX, line unknown, in .ctor > File Microsoft.DirectX, line unknown, in CheckTimeBomb > StandardError: This pre-release version of DirectX has expired, please > upgrade to the latest version from http://www.microsoft.com/directx > > D:\IronPython\Samples\Direct3D> > > On Jan 6, 11:33 pm, "Keith Hoard" wrote: > > Thanks!! > > > > On Jan 6, 2008 2:14 PM, Martin Maly wrote: > > > > > > > > > Some of the samples have prerequisites. I believe the DirectX > tutorial > > > comes with a great readme (readme.html) that should get you going. > > > > > *From:* users-boun... at lists.ironpython.com [mailto: > > > users-boun... at lists.ironpython.com] *On Behalf Of *Keith Hoard > > > *Sent:* Sunday, January 06, 2008 11:56 AM > > > *To:* IronPython Mailing List > > > *Subject:* [IronPython] Newbie questions. . . > > > > > I have a few questions about getting up and running with IronPython. > > > > > I have downloaded and installed ipy.exe to the D:\IronPython > directory. I > > > have also added this directory to the Path environment varialble. > However, > > > when I try to run the examples (In this case " tutorial.py") from the > web > > > site, I get the following error: > > > > > Microsoft Windows XP [Version 5.1.2600] > > > (C) Copyright 1985-2001 Microsoft Corp. > > > > > D:\IronPython>ipy tutorial.py > > > Traceback (most recent call last): > > > File D:\IronPython\tutorial.py, line 19, in Initialize > > > File , line 0, in AddReferenceByPartialName##12 > > > IOError: Could not add reference to assembly Microsoft.DirectX > > > > > When I try to run the other samples, I get similar errors. Is there > > > another environment variable that I'm supposed to set so that IPy can > find > > > the .NET libraries? Also, if there is some documentation that I > missed, I > > > was hoping that someone could point me in the right direction. > > > > > Thanks in advance for any help. . . > > > > > _______________________________________________ > > > Users mailing list > > > Us... at lists.ironpython.com > > >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > -- > > > > Keith Hoard > > Collierville, TN > > kho... at gmail.com > > > > _______________________________________________ > > Users mailing list > > Us... at lists.ironpython > .comhttp://lists.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 > -- Keith Hoard Collierville, TN khoard at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From marcus.patino-pan at Systemc.com Tue Jan 8 11:18:26 2008 From: marcus.patino-pan at Systemc.com (Marcus Patino Pan) Date: Tue, 8 Jan 2008 10:18:26 -0000 Subject: [IronPython] Getting window properties Message-ID: Hello, I wondered if you could help me. I have IronPython working fine, but what I would like to do is use it to test another application. I have worked out how to use sendkeys but to do proper testing I need to be able to check if the correct window has appeared on screen, so need to check some of its properties, like its title. I've been looking on the internet for examples but with no luck. Could someone point me in the right direction? Many Thanks Marcus This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed ("the addressee"). If you have received this email in error please notify the system manager at System C Healthcare plc. This email and its attachments (if any) contain(s) confidential information the property of System C Healthcare plc and is/are intended only for the addressee. If you are not the addressee you should not use, disseminate, distribute or copy this e-mail or any attachment. System C Healthcare plc, Registered Office, Brenchley House, Week Street, Maidstone, Kent ME14 1RF Registered in England no: 1754990 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Tue Jan 8 11:34:03 2008 From: fuzzyman at voidspace.org.uk (Fuzzyman) Date: Tue, 08 Jan 2008 10:34:03 +0000 Subject: [IronPython] Getting window properties In-Reply-To: References: Message-ID: <4783519B.6080806@voidspace.org.uk> Marcus Patino Pan wrote: > Hello, > > I wondered if you could help me. I have IronPython working fine, but > what I would like to do is use it to test another application. I have > worked out how to use sendkeys but to do proper testing I need to be > able to check if the correct window has appeared on screen, so need to > check some of its properties, like its title. I?ve been looking on the > internet for examples but with no luck. > > Could someone point me in the right direction? > We do a bit of this at Resolver, but mainly do 'in process' testing where we have access to the forms as .NET objects. The functions you want live mainly in User32.dll, which is unmanaged code. There are functions like GetForegroundWindow, which returns a window handle. From this you can determine the title of the window etc. You can also send mouse moves and button clicks, so it is possible to interact with applications in a completely 'black-box' manner. Unfortunately, although some parts of this are straightforward, we had real problems when trying to do things like interact with menus (particularly context menus) using this technique. The bad news is that because these functions live in unmanaged code, you need attributes to work with them. We have some stub C# at Resolver that exposes those functions to IronPython. *However*, I recently discovered Seo's implementation of ctypes for IronPython (part of FePy but should work fine with a standard build of IronPython). This allows you to do 'dynamic platform invoke', meaning you can call these functions from straight IronPython! There is a minimal example at: http://www.ironpython.info/index.php/Access_Unmanaged_Code_with_Dynamic_P/Invoke I hope this is helpful. Michael Foord http://www.manning.com/foord > Many Thanks > > Marcus > > This email and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed ("the addressee"). If you have received this email in > error please notify the system manager at System C Healthcare plc. > This email and its attachments (if any) contain(s) confidential > information the property of System C Healthcare plc and is/are > intended only for the addressee. If you are not the addressee you > should not use, disseminate, distribute or copy this e-mail or any > attachment. > > System C Healthcare plc, Registered Office, Brenchley House, Week > Street, Maidstone, Kent ME14 1RF Registered in England no: 1754990 > >------------------------------------------------------------------------ > >_______________________________________________ >Users mailing list >Users at lists.ironpython.com >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From slide.o.mix at gmail.com Tue Jan 8 15:58:59 2008 From: slide.o.mix at gmail.com (Slide) Date: Tue, 8 Jan 2008 07:58:59 -0700 Subject: [IronPython] Hosting and globals Message-ID: I am trying to update my application to use the Hosting APIs from alpha 7, one thing that I can't seem to figure out is how to access "globals" to add stuff from my application to be used by the script. Any help would be appreciated. Thanks, slide From curt at hagenlocher.org Tue Jan 8 17:17:32 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 8 Jan 2008 08:17:32 -0800 Subject: [IronPython] Hosting and globals In-Reply-To: References: Message-ID: On Jan 8, 2008 6:58 AM, Slide wrote: > I am trying to update my application to use the Hosting APIs from > alpha 7, one thing that I can't seem to figure out is how to access > "globals" to add stuff from my application to be used by the script. What kind of reference do you have to the script from the hosting code? If you've got a ScriptScope for the module, you can just say PythonEngine.CurrentEngine.SetVariable(module, "varName", varValue) where module is the ScriptScope. -- Curt Hagenlocher curt at hagenlocher.org From slide.o.mix at gmail.com Tue Jan 8 17:27:14 2008 From: slide.o.mix at gmail.com (Slide) Date: Tue, 8 Jan 2008 09:27:14 -0700 Subject: [IronPython] Hosting and globals In-Reply-To: References: Message-ID: On Jan 8, 2008 9:17 AM, Curt Hagenlocher wrote: > On Jan 8, 2008 6:58 AM, Slide wrote: > > I am trying to update my application to use the Hosting APIs from > > alpha 7, one thing that I can't seem to figure out is how to access > > "globals" to add stuff from my application to be used by the script. > > What kind of reference do you have to the script from the hosting > code? If you've got a ScriptScope for the module, you can just say > > PythonEngine.CurrentEngine.SetVariable(module, "varName", varValue) > > where module is the ScriptScope. > > -- So, if I have a module and inside that module I have an import statement. Does that imported module reside below the ScriptScope of the module I created? The reason I ask is that I have a file that I create a module from called __main__. I then add some variables to that module __main__.SetVariable("name", value). I would think that I need to access them by importing my original script and referencing them that way; what I want to do is access them via the globals(). Adding them in the way you mention does not add them to globals. Thanks, slide From curt at hagenlocher.org Tue Jan 8 17:38:47 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 8 Jan 2008 08:38:47 -0800 Subject: [IronPython] Hosting and globals In-Reply-To: References: Message-ID: On Jan 8, 2008 8:27 AM, Slide wrote: > > So, if I have a module and inside that module I have an import > statement. Does that imported module reside below the ScriptScope of > the module I created? No, each module is its own ScriptScope. When you import one module from another in Python, you're really doing two things: 1) Load the module if it's not already loaded 2) Create a reference to that module in the current module There's nothing like a hierarchical relationship here. > Adding them in the way you mention does not add them to globals. There isn't really such a thing as a "global" global in Python in the sense of (say) a C++ global variable. Globals are always scoped to the module they're in. The closest thing there is to this in Python is the list of loaded modules -- and even that can be manipulated, given that it's really just a dictionary contained within the "sys" module. If you've done the equivalent of poking "a = 1" into module "foo", you can access this value from __main__ by saying "from foo import a". -- Curt Hagenlocher curt at hagenlocher.org From Jim.Hugunin at microsoft.com Tue Jan 8 20:06:59 2008 From: Jim.Hugunin at microsoft.com (Jim Hugunin) Date: Tue, 8 Jan 2008 11:06:59 -0800 Subject: [IronPython] Getting window properties In-Reply-To: <4783519B.6080806@voidspace.org.uk> References: <4783519B.6080806@voidspace.org.uk> Message-ID: Another option would be to use the System.Windows.Automation library - new in .NET 3.0. It's a lot easier to use than the native APIs when it works for you. This sample will print the titles of all the top-level windows. -------------------------------------- import clr clr.AddReference('UIAutomationClient') clr.AddReference('UIAutomationTypes') from System.Windows.Automation import * tops = AutomationElement.RootElement.FindAll(TreeScope.Children, Condition.TrueCondition) for elem in tops: print elem.GetCurrentPropertyValue(AutomationElement.NameProperty) ---------------------------------------- Thanks - Jim -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fuzzyman Sent: Tuesday, January 08, 2008 2:34 AM To: Discussion of IronPython Subject: Re: [IronPython] Getting window properties Marcus Patino Pan wrote: > Hello, > > I wondered if you could help me. I have IronPython working fine, but > what I would like to do is use it to test another application. I have > worked out how to use sendkeys but to do proper testing I need to be > able to check if the correct window has appeared on screen, so need to > check some of its properties, like its title. I've been looking on the > internet for examples but with no luck. > > Could someone point me in the right direction? > We do a bit of this at Resolver, but mainly do 'in process' testing where we have access to the forms as .NET objects. The functions you want live mainly in User32.dll, which is unmanaged code. There are functions like GetForegroundWindow, which returns a window handle. From this you can determine the title of the window etc. You can also send mouse moves and button clicks, so it is possible to interact with applications in a completely 'black-box' manner. Unfortunately, although some parts of this are straightforward, we had real problems when trying to do things like interact with menus (particularly context menus) using this technique. The bad news is that because these functions live in unmanaged code, you need attributes to work with them. We have some stub C# at Resolver that exposes those functions to IronPython. *However*, I recently discovered Seo's implementation of ctypes for IronPython (part of FePy but should work fine with a standard build of IronPython). This allows you to do 'dynamic platform invoke', meaning you can call these functions from straight IronPython! There is a minimal example at: http://www.ironpython.info/index.php/Access_Unmanaged_Code_with_Dynamic_P/Invoke I hope this is helpful. Michael Foord http://www.manning.com/foord > Many Thanks > > Marcus > > This email and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed ("the addressee"). If you have received this email in > error please notify the system manager at System C Healthcare plc. > This email and its attachments (if any) contain(s) confidential > information the property of System C Healthcare plc and is/are > intended only for the addressee. If you are not the addressee you > should not use, disseminate, distribute or copy this e-mail or any > attachment. > > System C Healthcare plc, Registered Office, Brenchley House, Week > Street, Maidstone, Kent ME14 1RF Registered in England no: 1754990 > >------------------------------------------------------------------------ > >_______________________________________________ >Users mailing list >Users at lists.ironpython.com >http://lists.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 Jan 8 20:15:13 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Tue, 8 Jan 2008 11:15:13 -0800 Subject: [IronPython] Getting window properties In-Reply-To: References: <4783519B.6080806@voidspace.org.uk> Message-ID: On Jan 8, 2008 11:06 AM, Jim Hugunin wrote: > Another option would be to use the System.Windows.Automation > library - new in .NET 3.0. Oooh, nice! For some reason I had thought that this was only for WPF apps. Perhaps that's because the docs[1] describe this as "Provides support for Windows Presentation Foundation (WPF) UI Automation clients." Given its general utility, I'm surprised that this hasn't gotten more airplay. 1: http://msdn2.microsoft.com/en-us/library/system.windows.automation.aspx -- Curt Hagenlocher curt at hagenlocher.org From fuzzyman at voidspace.org.uk Tue Jan 8 20:17:10 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 08 Jan 2008 19:17:10 +0000 Subject: [IronPython] [python] Re: Getting window properties In-Reply-To: References: <4783519B.6080806@voidspace.org.uk> Message-ID: <4783CC36.3020708@voidspace.org.uk> Jim Hugunin wrote: > Another option would be to use the System.Windows.Automation library - new in .NET 3.0. It's a lot easier to use than the native APIs when it works for you. This sample will print the titles of all the top-level windows. > > -------------------------------------- > import clr > clr.AddReference('UIAutomationClient') > clr.AddReference('UIAutomationTypes') > from System.Windows.Automation import * > > tops = AutomationElement.RootElement.FindAll(TreeScope.Children, Condition.TrueCondition) > for elem in tops: > print elem.GetCurrentPropertyValue(AutomationElement.NameProperty) > Wow - I didn't know there was an automation library in .NET 3! Thanks Michael > ---------------------------------------- > > Thanks - Jim > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fuzzyman > Sent: Tuesday, January 08, 2008 2:34 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Getting window properties > > Marcus Patino Pan wrote: > > >> Hello, >> >> I wondered if you could help me. I have IronPython working fine, but >> what I would like to do is use it to test another application. I have >> worked out how to use sendkeys but to do proper testing I need to be >> able to check if the correct window has appeared on screen, so need to >> check some of its properties, like its title. I've been looking on the >> internet for examples but with no luck. >> >> Could someone point me in the right direction? >> >> > > We do a bit of this at Resolver, but mainly do 'in process' testing > where we have access to the forms as .NET objects. > > The functions you want live mainly in User32.dll, which is unmanaged > code. There are functions like GetForegroundWindow, which returns a > window handle. From this you can determine the title of the window etc. > You can also send mouse moves and button clicks, so it is possible to > interact with applications in a completely 'black-box' manner. > > Unfortunately, although some parts of this are straightforward, we had > real problems when trying to do things like interact with menus > (particularly context menus) using this technique. > > The bad news is that because these functions live in unmanaged code, you > need attributes to work with them. We have some stub C# at Resolver that > exposes those functions to IronPython. *However*, I recently discovered > Seo's implementation of ctypes for IronPython (part of FePy but should > work fine with a standard build of IronPython). This allows you to do > 'dynamic platform invoke', meaning you can call these functions from > straight IronPython! > > There is a minimal example at: > http://www.ironpython.info/index.php/Access_Unmanaged_Code_with_Dynamic_P/Invoke > > I hope this is helpful. > > Michael Foord > http://www.manning.com/foord > > > >> Many Thanks >> >> Marcus >> >> This email and any files transmitted with it are confidential and >> intended solely for the use of the individual or entity to whom they >> are addressed ("the addressee"). If you have received this email in >> error please notify the system manager at System C Healthcare plc. >> This email and its attachments (if any) contain(s) confidential >> information the property of System C Healthcare plc and is/are >> intended only for the addressee. If you are not the addressee you >> should not use, disseminate, distribute or copy this e-mail or any >> attachment. >> >> System C Healthcare plc, Registered Office, Brenchley House, Week >> Street, Maidstone, Kent ME14 1RF Registered in England no: 1754990 >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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 marcus.patino-pan at Systemc.com Wed Jan 9 10:55:54 2008 From: marcus.patino-pan at Systemc.com (Marcus Patino Pan) Date: Wed, 9 Jan 2008 09:55:54 -0000 Subject: [IronPython] [python] Re: Getting window properties Message-ID: That's brilliant!! Thanks everyone for your help. I'll probably be back for more advice soon. Marcus -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: 08 January 2008 19:17 To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Getting window properties Jim Hugunin wrote: > Another option would be to use the System.Windows.Automation library - new in .NET 3.0. It's a lot easier to use than the native APIs when it works for you. This sample will print the titles of all the top-level windows. > > -------------------------------------- > import clr > clr.AddReference('UIAutomationClient') > clr.AddReference('UIAutomationTypes') > from System.Windows.Automation import * > > tops = AutomationElement.RootElement.FindAll(TreeScope.Children, Condition.TrueCondition) > for elem in tops: > print elem.GetCurrentPropertyValue(AutomationElement.NameProperty) > Wow - I didn't know there was an automation library in .NET 3! Thanks Michael > ---------------------------------------- > > Thanks - Jim > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fuzzyman > Sent: Tuesday, January 08, 2008 2:34 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Getting window properties > > Marcus Patino Pan wrote: > > >> Hello, >> >> I wondered if you could help me. I have IronPython working fine, but >> what I would like to do is use it to test another application. I have >> worked out how to use sendkeys but to do proper testing I need to be >> able to check if the correct window has appeared on screen, so need to >> check some of its properties, like its title. I've been looking on the >> internet for examples but with no luck. >> >> Could someone point me in the right direction? >> >> > > We do a bit of this at Resolver, but mainly do 'in process' testing > where we have access to the forms as .NET objects. > > The functions you want live mainly in User32.dll, which is unmanaged > code. There are functions like GetForegroundWindow, which returns a > window handle. From this you can determine the title of the window etc. > You can also send mouse moves and button clicks, so it is possible to > interact with applications in a completely 'black-box' manner. > > Unfortunately, although some parts of this are straightforward, we had > real problems when trying to do things like interact with menus > (particularly context menus) using this technique. > > The bad news is that because these functions live in unmanaged code, you > need attributes to work with them. We have some stub C# at Resolver that > exposes those functions to IronPython. *However*, I recently discovered > Seo's implementation of ctypes for IronPython (part of FePy but should > work fine with a standard build of IronPython). This allows you to do > 'dynamic platform invoke', meaning you can call these functions from > straight IronPython! > > There is a minimal example at: > http://www.ironpython.info/index.php/Access_Unmanaged_Code_with_Dynamic_ P/Invoke > > I hope this is helpful. > > Michael Foord > http://www.manning.com/foord > > > >> Many Thanks >> >> Marcus >> >> This email and any files transmitted with it are confidential and >> intended solely for the use of the individual or entity to whom they >> are addressed ("the addressee"). If you have received this email in >> error please notify the system manager at System C Healthcare plc. >> This email and its attachments (if any) contain(s) confidential >> information the property of System C Healthcare plc and is/are >> intended only for the addressee. If you are not the addressee you >> should not use, disseminate, distribute or copy this e-mail or any >> attachment. >> >> System C Healthcare plc, Registered Office, Brenchley House, Week >> Street, Maidstone, Kent ME14 1RF Registered in England no: 1754990 >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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 This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed ("the addressee"). If you have received this email in error please notify the system manager at System C Healthcare plc. This email and its attachments (if any) contain(s) confidential information the property of System C Healthcare plc and is/are intended only for the addressee. If you are not the addressee you should not use, disseminate, distribute or copy this e-mail or any attachment. System C Healthcare plc, Registered Office, Brenchley House, Week Street, Maidstone, Kent ME14 1RF Registered in England no: 1754990 From marcus.patino-pan at Systemc.com Wed Jan 9 11:56:24 2008 From: marcus.patino-pan at Systemc.com (Marcus Patino Pan) Date: Wed, 9 Jan 2008 10:56:24 -0000 Subject: [IronPython] [python] Re: Getting window properties Message-ID: Im back!!! What do I need to change in the example to get the active window?? Im using an example where word is opened and then the document is wrote in then is attempted to be saved. The example below finds the parent window "Document1 - Mircosoft Word" but wont find the pop up window asking if you would like to save the document. Any ideas? Also if there is a way of retrieving the text in the pop up box that would be amazing. I'll continue playing with it to see what I can find out. Many Thanks Marcus -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Marcus Patino Pan Sent: 09 January 2008 09:56 To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Getting window properties That's brilliant!! Thanks everyone for your help. I'll probably be back for more advice soon. Marcus -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: 08 January 2008 19:17 To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Getting window properties Jim Hugunin wrote: > Another option would be to use the System.Windows.Automation library - new in .NET 3.0. It's a lot easier to use than the native APIs when it works for you. This sample will print the titles of all the top-level windows. > > -------------------------------------- > import clr > clr.AddReference('UIAutomationClient') > clr.AddReference('UIAutomationTypes') > from System.Windows.Automation import * > > tops = AutomationElement.RootElement.FindAll(TreeScope.Children, Condition.TrueCondition) > for elem in tops: > print elem.GetCurrentPropertyValue(AutomationElement.NameProperty) > Wow - I didn't know there was an automation library in .NET 3! Thanks Michael > ---------------------------------------- > > Thanks - Jim > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fuzzyman > Sent: Tuesday, January 08, 2008 2:34 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Getting window properties > > Marcus Patino Pan wrote: > > >> Hello, >> >> I wondered if you could help me. I have IronPython working fine, but >> what I would like to do is use it to test another application. I have >> worked out how to use sendkeys but to do proper testing I need to be >> able to check if the correct window has appeared on screen, so need to >> check some of its properties, like its title. I've been looking on the >> internet for examples but with no luck. >> >> Could someone point me in the right direction? >> >> > > We do a bit of this at Resolver, but mainly do 'in process' testing > where we have access to the forms as .NET objects. > > The functions you want live mainly in User32.dll, which is unmanaged > code. There are functions like GetForegroundWindow, which returns a > window handle. From this you can determine the title of the window etc. > You can also send mouse moves and button clicks, so it is possible to > interact with applications in a completely 'black-box' manner. > > Unfortunately, although some parts of this are straightforward, we had > real problems when trying to do things like interact with menus > (particularly context menus) using this technique. > > The bad news is that because these functions live in unmanaged code, you > need attributes to work with them. We have some stub C# at Resolver that > exposes those functions to IronPython. *However*, I recently discovered > Seo's implementation of ctypes for IronPython (part of FePy but should > work fine with a standard build of IronPython). This allows you to do > 'dynamic platform invoke', meaning you can call these functions from > straight IronPython! > > There is a minimal example at: > http://www.ironpython.info/index.php/Access_Unmanaged_Code_with_Dynamic_ P/Invoke > > I hope this is helpful. > > Michael Foord > http://www.manning.com/foord > > > >> Many Thanks >> >> Marcus >> >> This email and any files transmitted with it are confidential and >> intended solely for the use of the individual or entity to whom they >> are addressed ("the addressee"). If you have received this email in >> error please notify the system manager at System C Healthcare plc. >> This email and its attachments (if any) contain(s) confidential >> information the property of System C Healthcare plc and is/are >> intended only for the addressee. If you are not the addressee you >> should not use, disseminate, distribute or copy this e-mail or any >> attachment. >> >> System C Healthcare plc, Registered Office, Brenchley House, Week >> Street, Maidstone, Kent ME14 1RF Registered in England no: 1754990 >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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 This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed ("the addressee"). If you have received this email in error please notify the system manager at System C Healthcare plc. This email and its attachments (if any) contain(s) confidential information the property of System C Healthcare plc and is/are intended only for the addressee. If you are not the addressee you should not use, disseminate, distribute or copy this e-mail or any attachment. System C Healthcare plc, Registered Office, Brenchley House, Week Street, Maidstone, Kent ME14 1RF Registered in England no: 1754990 _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed ("the addressee"). If you have received this email in error please notify the system manager at System C Healthcare plc. This email and its attachments (if any) contain(s) confidential information the property of System C Healthcare plc and is/are intended only for the addressee. If you are not the addressee you should not use, disseminate, distribute or copy this e-mail or any attachment. System C Healthcare plc, Registered Office, Brenchley House, Week Street, Maidstone, Kent ME14 1RF Registered in England no: 1754990 From anakinnani at hotmail.com Wed Jan 9 11:57:15 2008 From: anakinnani at hotmail.com (jane janet) Date: Wed, 9 Jan 2008 10:57:15 +0000 Subject: [IronPython] wxPython and Ironpython Message-ID: Dear all, I was wondering if IronPython can use wxPython. The important reason is my big old application was written in Python using wxPython to create GUI. But I have to use IronPython because my new application must use .NET library. How can I integrate these stuff. Please tell me what is the best way for me. I have little time to develop my project now. All the best Jane _________________________________________________________________ Put your friends on the big screen with Windows Vista? + Windows Live?. http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=TXT_TAGLM_CPC_MediaCtr_bigscreen_012008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Wed Jan 9 12:11:13 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Wed, 9 Jan 2008 20:11:13 +0900 Subject: [IronPython] wxPython and Ironpython In-Reply-To: References: Message-ID: <5b0248170801090311m113d124bl8c9cdfe7e0d3fef7@mail.gmail.com> 2008/1/9, jane janet : > The important reason is my big old application was written in Python using > wxPython to create GUI. > But I have to use IronPython because my new application must use .NET > library. > How can I integrate these stuff. > Please tell me what is the best way for me. This sounds like a good fit for Python.NET. Python.NET allows you to use .NET libraries with vanilla Python (so you can use wxPython too). http://pythonnet.sourceforge.net/ Or you can write .NET part in IronPython (or anything, really) and use IPC to communicate with GUI. -- Seo Sanghyeon From slide.o.mix at gmail.com Wed Jan 9 17:54:43 2008 From: slide.o.mix at gmail.com (Slide) Date: Wed, 9 Jan 2008 09:54:43 -0700 Subject: [IronPython] Clearing context Message-ID: I have embedded IronPython into my C# app to use as a scripting engine. I am having a problem with reloading the context when a dependent module changes. What I mean is I have something like the following as my main script. from mymod import myfunc class MyClass(SomeNameSpace.IMyInterface): def SomeFunc(self): myfunc() If I change this file and try reloading my script, it takes the modifications just fine and runs the new code. If I modify mymod, but not the main script, I get the old code from mymod run. Is there something I can do to force it to reload the imported scripts as well? Thanks slide From curt at hagenlocher.org Wed Jan 9 18:15:53 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 9 Jan 2008 09:15:53 -0800 Subject: [IronPython] Clearing context In-Reply-To: References: Message-ID: On Jan 9, 2008 8:54 AM, Slide wrote: > > If I change this file and try reloading my script, it takes the > modifications just fine and runs the new code. If I modify mymod, but > not the main script, I get the old code from mymod run. Is there > something I can do to force it to reload the imported scripts as well? There's no straightforward and reliable way to track usage, so the only thing you could do generically is to reload *all* your modules. One thing you could do would be to say "import mymod" in any other module using mymod. After a reload of mymod, you could then iterate over sys.modules and reload any module containing the symbol "mymod". It's not foolproof, but it's probably good enough. Another alternative would be to change your code to look like this: class MyClass(SomeNameSpace.IMyInterface): def SomeFunc(self): from mymod import myfunc myfunc() That way, the import gets re-run each time you run SomeFunc, and you'll always get the latest version of the module. -- Curt Hagenlocher curt at hagenlocher.org From leculver at microsoft.com Wed Jan 9 18:42:51 2008 From: leculver at microsoft.com (Lee Culver) Date: Wed, 9 Jan 2008 09:42:51 -0800 Subject: [IronPython] Clearing context In-Reply-To: References: Message-ID: <6512F99DEFF77C418E6738CE6E12FD4E5BCA50B4ED@NA-EXMSG-C105.redmond.corp.microsoft.com> I don't know the answer to the original question, but this is not exactly correct: Another alternative would be to change your code to look like this: class MyClass(SomeNameSpace.IMyInterface): def SomeFunc(self): from mymod import myfunc myfunc() That way, the import gets re-run each time you run SomeFunc, and you'll always get the latest version of the module. This will not re-import mymod every time the function is run. Once you run "from foo import bar" or "import foo" then the "foo" module is loaded into python and will not be reloaded from python without an explicit call to the reload function. For example, let's say you have the following code in mymod.py: def foo(): print "called foo()" def bar(): print "called bar()" print "Loaded..." And then you run this code: def test1(): from mymod import foo foo() def test2(): from mymod import bar bar() test1() test2() import mymod mymod.foo() "Loaded..." will be printed only once, because the module is only loaded once, and never reloaded. This is a very useful feature which Python has supported for quite some time, allowing you to sprinkle "from foo import blah" around your code, and if and only if you hit one of these will the module be loaded, and it will only be loaded once. Back to the original question, are you saying that if you restart your C# program that the changed "mymod" is not loaded properly, or are you modifying the script while the C# program is running? -Lee -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Wednesday, January 09, 2008 9:16 AM To: Discussion of IronPython Subject: Re: [IronPython] Clearing context On Jan 9, 2008 8:54 AM, Slide wrote: > > If I change this file and try reloading my script, it takes the > modifications just fine and runs the new code. If I modify mymod, but > not the main script, I get the old code from mymod run. Is there > something I can do to force it to reload the imported scripts as well? There's no straightforward and reliable way to track usage, so the only thing you could do generically is to reload *all* your modules. One thing you could do would be to say "import mymod" in any other module using mymod. After a reload of mymod, you could then iterate over sys.modules and reload any module containing the symbol "mymod". It's not foolproof, but it's probably good enough. Another alternative would be to change your code to look like this: class MyClass(SomeNameSpace.IMyInterface): def SomeFunc(self): from mymod import myfunc myfunc() That way, the import gets re-run each time you run SomeFunc, and you'll always get the latest version of the module. -- Curt Hagenlocher curt at hagenlocher.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 curt at hagenlocher.org Wed Jan 9 18:49:29 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 9 Jan 2008 09:49:29 -0800 Subject: [IronPython] Clearing context In-Reply-To: <6512F99DEFF77C418E6738CE6E12FD4E5BCA50B4ED@NA-EXMSG-C105.redmond.corp.microsoft.com> References: <6512F99DEFF77C418E6738CE6E12FD4E5BCA50B4ED@NA-EXMSG-C105.redmond.corp.microsoft.com> Message-ID: On Jan 9, 2008 9:42 AM, Lee Culver wrote: > >> class MyClass(SomeNameSpace.IMyInterface): >> def SomeFunc(self): >> from mymod import myfunc >> myfunc() >> >> That way, the import gets re-run each time you run SomeFunc, and >> you'll always get the latest version of the module. > > This will not re-import mymod every time the function is run. Once you > run "from foo import bar" or "import foo" then the "foo" module is loaded > into python and will not be reloaded from python without an explicit call > to the reload function. Poor wording on my part, sorry. What I should have said was that the "myfunc" symbol will be reimported from the "mymod" module at that point in time, and will therefore pick up any changes to "mymod" that have been made -- including changes made by a reload. I did not mean to imply that "mymod" itself would be reloaded. -- Curt Hagenlocher curt at hagenlocher.org From srivatsn at microsoft.com Wed Jan 9 19:18:56 2008 From: srivatsn at microsoft.com (Srivatsn N) Date: Wed, 9 Jan 2008 10:18:56 -0800 Subject: [IronPython] [python] Re: Getting window properties In-Reply-To: References: Message-ID: <3FA51E96F92363468CF062D992DC846810E3B408C0@NA-EXMSG-C106.redmond.corp.microsoft.com> The pop-up window might be one level below the top-level in the UI tree. You can use UISpy (http://msdn2.microsoft.com/en-us/library/ms727247.aspx) to inspect the UI Tree hierarchy for UIAutomation and also the properties that are exposed. The text in the popup should also be exposed - generally through the value property (you can verify that in UISpy). You should have the tool installed if you have the SDK. Srivatsn -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Marcus Patino Pan Sent: Wednesday, January 09, 2008 2:56 AM To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Getting window properties Im back!!! What do I need to change in the example to get the active window?? Im using an example where word is opened and then the document is wrote in then is attempted to be saved. The example below finds the parent window "Document1 - Mircosoft Word" but wont find the pop up window asking if you would like to save the document. Any ideas? Also if there is a way of retrieving the text in the pop up box that would be amazing. I'll continue playing with it to see what I can find out. Many Thanks Marcus -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Marcus Patino Pan Sent: 09 January 2008 09:56 To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Getting window properties That's brilliant!! Thanks everyone for your help. I'll probably be back for more advice soon. Marcus -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: 08 January 2008 19:17 To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Getting window properties Jim Hugunin wrote: > Another option would be to use the System.Windows.Automation library - new in .NET 3.0. It's a lot easier to use than the native APIs when it works for you. This sample will print the titles of all the top-level windows. > > -------------------------------------- > import clr > clr.AddReference('UIAutomationClient') > clr.AddReference('UIAutomationTypes') > from System.Windows.Automation import * > > tops = AutomationElement.RootElement.FindAll(TreeScope.Children, Condition.TrueCondition) > for elem in tops: > print elem.GetCurrentPropertyValue(AutomationElement.NameProperty) > Wow - I didn't know there was an automation library in .NET 3! Thanks Michael > ---------------------------------------- > > Thanks - Jim > > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Fuzzyman > Sent: Tuesday, January 08, 2008 2:34 AM > To: Discussion of IronPython > Subject: Re: [IronPython] Getting window properties > > Marcus Patino Pan wrote: > > >> Hello, >> >> I wondered if you could help me. I have IronPython working fine, but >> what I would like to do is use it to test another application. I have >> worked out how to use sendkeys but to do proper testing I need to be >> able to check if the correct window has appeared on screen, so need to >> check some of its properties, like its title. I've been looking on the >> internet for examples but with no luck. >> >> Could someone point me in the right direction? >> >> > > We do a bit of this at Resolver, but mainly do 'in process' testing > where we have access to the forms as .NET objects. > > The functions you want live mainly in User32.dll, which is unmanaged > code. There are functions like GetForegroundWindow, which returns a > window handle. From this you can determine the title of the window etc. > You can also send mouse moves and button clicks, so it is possible to > interact with applications in a completely 'black-box' manner. > > Unfortunately, although some parts of this are straightforward, we had > real problems when trying to do things like interact with menus > (particularly context menus) using this technique. > > The bad news is that because these functions live in unmanaged code, you > need attributes to work with them. We have some stub C# at Resolver that > exposes those functions to IronPython. *However*, I recently discovered > Seo's implementation of ctypes for IronPython (part of FePy but should > work fine with a standard build of IronPython). This allows you to do > 'dynamic platform invoke', meaning you can call these functions from > straight IronPython! > > There is a minimal example at: > http://www.ironpython.info/index.php/Access_Unmanaged_Code_with_Dynamic_ P/Invoke > > I hope this is helpful. > > Michael Foord > http://www.manning.com/foord > > > >> Many Thanks >> >> Marcus >> >> This email and any files transmitted with it are confidential and >> intended solely for the use of the individual or entity to whom they >> are addressed ("the addressee"). If you have received this email in >> error please notify the system manager at System C Healthcare plc. >> This email and its attachments (if any) contain(s) confidential >> information the property of System C Healthcare plc and is/are >> intended only for the addressee. If you are not the addressee you >> should not use, disseminate, distribute or copy this e-mail or any >> attachment. >> >> System C Healthcare plc, Registered Office, Brenchley House, Week >> Street, Maidstone, Kent ME14 1RF Registered in England no: 1754990 >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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 This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed ("the addressee"). If you have received this email in error please notify the system manager at System C Healthcare plc. This email and its attachments (if any) contain(s) confidential information the property of System C Healthcare plc and is/are intended only for the addressee. If you are not the addressee you should not use, disseminate, distribute or copy this e-mail or any attachment. System C Healthcare plc, Registered Office, Brenchley House, Week Street, Maidstone, Kent ME14 1RF Registered in England no: 1754990 _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed ("the addressee"). If you have received this email in error please notify the system manager at System C Healthcare plc. This email and its attachments (if any) contain(s) confidential information the property of System C Healthcare plc and is/are intended only for the addressee. If you are not the addressee you should not use, disseminate, distribute or copy this e-mail or any attachment. System C Healthcare plc, Registered Office, Brenchley House, Week Street, Maidstone, Kent ME14 1RF Registered in England no: 1754990 _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From slide.o.mix at gmail.com Wed Jan 9 22:42:39 2008 From: slide.o.mix at gmail.com (Slide) Date: Wed, 9 Jan 2008 14:42:39 -0700 Subject: [IronPython] Clearing context In-Reply-To: <6512F99DEFF77C418E6738CE6E12FD4E5BCA50B4ED@NA-EXMSG-C105.redmond.corp.microsoft.com> References: <6512F99DEFF77C418E6738CE6E12FD4E5BCA50B4ED@NA-EXMSG-C105.redmond.corp.microsoft.com> Message-ID: On Jan 9, 2008 10:42 AM, Lee Culver wrote: > > > > > I don't know the answer to the original question, but this is not exactly > correct: > > > > > Another alternative would be to change your code to look like this: > > > > class MyClass(SomeNameSpace.IMyInterface): > > def SomeFunc(self): > > from mymod import myfunc > > myfunc() > > > > That way, the import gets re-run each time you run SomeFunc, and > > you'll always get the latest version of the module. > > > > This will not re-import mymod every time the function is run. Once you run > "from foo import bar" or "import foo" then the "foo" module is loaded into > python and will not be reloaded from python without an explicit call to the > reload function. For example, let's say you have the following code in > mymod.py: > > > > def foo(): > > print "called foo()" > > > > def bar(): > > print "called bar()" > > > > print "Loaded..." > > > > And then you run this code: > > def test1(): > > from mymod import foo > > foo() > > def test2(): > > from mymod import bar > > bar() > > > > test1() > > test2() > > > > import mymod > > mymod.foo() > > > > "Loaded?" will be printed only once, because the module is only loaded once, > and never reloaded. This is a very useful feature which Python has > supported for quite some time, allowing you to sprinkle "from foo import > blah" around your code, and if and only if you hit one of these will the > module be loaded, and it will only be loaded once. > > > > Back to the original question, are you saying that if you restart your C# > program that the changed "mymod" is not loaded properly, or are you > modifying the script while the C# program is running? > > > > -Lee > I am modifying the script while the C# application is running. I did find one solution, which was similar to something Curt suggested. foreach (KeyValuePair item in ScriptDomainManager.CurrentManager.GetPublishedModules()) item.Value.Reload(); This reloaded the modules in the CurrentManager. I assume that once the Hosting APIs are completed (soon hopefully!!) this will be changed so I have an unloadable script scope which I can just recreate when I do my calls as necessary. Thanks slide From timr at probo.com Wed Jan 9 23:45:43 2008 From: timr at probo.com (Tim Roberts) Date: Wed, 09 Jan 2008 14:45:43 -0800 Subject: [IronPython] Clearing context In-Reply-To: References: Message-ID: <47854E97.9040907@probo.com> On Wed, 9 Jan 2008 09:49:29 -0800, "Curt Hagenlocher" wrote: > On Jan 9, 2008 9:42 AM, Lee Culver wrote: > >> > >> >>> >> class MyClass(SomeNameSpace.IMyInterface): >>> >> def SomeFunc(self): >>> >> from mymod import myfunc >>> >> myfunc() >>> >> >>> >> That way, the import gets re-run each time you run SomeFunc, and >>> >> you'll always get the latest version of the module. >>> >> > >> > This will not re-import mymod every time the function is run. Once you >> > run "from foo import bar" or "import foo" then the "foo" module is loaded >> > into python and will not be reloaded from python without an explicit call >> > to the reload function. >> > > Poor wording on my part, sorry. What I should have said was that the > "myfunc" symbol will be reimported from the "mymod" module at that > point in time, and will therefore pick up any changes to "mymod" that > have been made -- including changes made by a reload. I did not mean > to imply that "mymod" itself would be reloaded. This is an important point, and I still don't think you have it exactly right. When you say "including changes made by a reload", that really should say "ONLY IF the module has been reloaded". Unless you reload it, the "mymod" that is in the module cache will never change, and therefore SomeFunc will always get the same version of myfunc(). -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From curt at hagenlocher.org Thu Jan 10 00:19:33 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 9 Jan 2008 15:19:33 -0800 Subject: [IronPython] Clearing context In-Reply-To: <47854E97.9040907@probo.com> References: <47854E97.9040907@probo.com> Message-ID: On Jan 9, 2008 2:45 PM, Tim Roberts wrote: > > This is an important point, and I still don't think you have it exactly > right. When you say "including changes made by a reload", that really > should say "ONLY IF the module has been reloaded". Unless you reload it, > the "mymod" that is in the module cache will never change, and therefore > SomeFunc will always get the same version of myfunc(). There are many ways to update module contents; reloading is only one of them. If I said (from hypothetical module foo): import mymod mymod.myfunc = lambda obj: obj + 1 I will successfully have modified the value of myfunc without doing a reload. And saying "from mymod import myfunc" will pickup the new function that's been assigned to that symbol. -- Curt Hagenlocher curt at hagenlocher.org From xmlhacker at gmail.com Fri Jan 11 12:55:39 2008 From: xmlhacker at gmail.com (M. David Peterson) Date: Fri, 11 Jan 2008 04:55:39 -0700 Subject: [IronPython] wxPython and Ironpython In-Reply-To: <5b0248170801090311m113d124bl8c9cdfe7e0d3fef7@mail.gmail.com> References: <5b0248170801090311m113d124bl8c9cdfe7e0d3fef7@mail.gmail.com> Message-ID: On Jan 9, 2008 4:11 AM, Sanghyeon Seo wrote: > > This sounds like a good fit for Python.NET. Python.NET allows you to > use .NET libraries with vanilla Python (so you can use wxPython too). > > http://pythonnet.sourceforge.net/ > > Or you can write .NET part in IronPython (or anything, really) and use > IPC to communicate with GUI. For what it's worth you might also try looking at wx.NET ( http://wxnet.sourceforge.net/ ), using IronPython to call into wx.NET and then porting the wxPython code to IronPython + wx.NET, though my guess is that Seo's suggesting will be both your fastest (in terms of the time to write the code) and most portable option. -- /M:D M. David Peterson Co-Founder & Chief Architect, 3rd&Urban, LLC Email: m.david at 3rdandUrban.com | m.david at amp.fm Mobile: (206) 418-9027 http://3rdandUrban.com | http://amp.fm | http://www.oreillynet.com/pub/au/2354 -------------- next part -------------- An HTML attachment was scrubbed... URL: From illium37 at yahoo.com Sat Jan 12 04:32:10 2008 From: illium37 at yahoo.com (illium) Date: Fri, 11 Jan 2008 19:32:10 -0800 (PST) Subject: [IronPython] Where to submit project related to IronPython? Message-ID: <864366.24169.qm@web53809.mail.re2.yahoo.com> Background: I was reading through the open issues on the IronPython Codeplex site, and I noticed there was a somewhat popular open issue relating to PInvoke/externs support. I have some utility code laying around that I adapted to use with IronPython. I made a small helper library in C# that can be used by a IronPython developer to make extern calls from the python code. I would like to upload that somewhere where people can find it and use it if they want to... Where is the appropriate place? Should I bother to make a new "project" site just for that, or is there a central repository for this kind of "community code" that isn't part of the main project? Thanks, Troy ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs From dinov at exchange.microsoft.com Sat Jan 12 11:08:44 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Sat, 12 Jan 2008 02:08:44 -0800 Subject: [IronPython] Where to submit project related to IronPython? In-Reply-To: <864366.24169.qm@web53809.mail.re2.yahoo.com> References: <864366.24169.qm@web53809.mail.re2.yahoo.com> Message-ID: <7AD436E4270DD54A94238001769C2227FB8E9C69D6@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Currently IronPython is not directly accepting contributions but FePy is the IronPython "Community Edition" and does except contributions. Seo Sanghyeon, who also maintains FePy, also has (in the past?) worked on a ctypes implementation to enable similar functionality as well. My best recommendation would be to check with him and see how your contribution meshs w/ that implementation, may offer more, etc... and if/how it could be distributed with FePy. Otherwise if you do choose to create a seperate project we'd be happy to link to it from the IronPython home page on CodePlex as we do other community various projects (apparently FePy wasn't linked from our CodePlex page so I just added it under the More Information link on the top page). ________________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of illium [illium37 at yahoo.com] Sent: Friday, January 11, 2008 7:32 PM To: Discussion of IronPython Subject: [IronPython] Where to submit project related to IronPython? Background: I was reading through the open issues on the IronPython Codeplex site, and I noticed there was a somewhat popular open issue relating to PInvoke/externs support. I have some utility code laying around that I adapted to use with IronPython. I made a small helper library in C# that can be used by a IronPython developer to make extern calls from the python code. I would like to upload that somewhere where people can find it and use it if they want to... Where is the appropriate place? Should I bother to make a new "project" site just for that, or is there a central repository for this kind of "community code" that isn't part of the main project? Thanks, Troy ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From consolejoker at yahoo.com Sun Jan 13 09:26:31 2008 From: consolejoker at yahoo.com (console shark) Date: Sun, 13 Jan 2008 00:26:31 -0800 (PST) Subject: [IronPython] How to call a c dll from IronPython? Message-ID: <266103.94368.qm@web63404.mail.re1.yahoo.com> I wrote a function and built it to a dll in C. For traditional CPython I then used SWIG to generate the module files and can call it easily. However I am not sure how to call this same dll and function from IronPython? The function looks like: int func(char* p, int i, int j); Any easy way to do this? Does this require pInvoke and if so how do you do this from IronPython? ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Sun Jan 13 13:18:14 2008 From: slide.o.mix at gmail.com (Slide) Date: Sun, 13 Jan 2008 05:18:14 -0700 Subject: [IronPython] How to call a c dll from IronPython? In-Reply-To: <266103.94368.qm@web63404.mail.re1.yahoo.com> References: <266103.94368.qm@web63404.mail.re1.yahoo.com> Message-ID: On Jan 13, 2008 1:26 AM, console shark wrote: > > I wrote a function and built it to a dll in C. For traditional CPython I > then used SWIG to generate the module files and can call it easily. > > However I am not sure how to call this same dll and function from > IronPython? The function looks like: > > int func(char* p, int i, int j); > > Any easy way to do this? Does this require pInvoke and if so how do you do > this from IronPython? > Check into FePy (http://fepy.sourceforge.net), they have an implementation of ctypes which should let you do what you want. slide From khoard at gmail.com Sun Jan 13 15:43:42 2008 From: khoard at gmail.com (Keith Hoard) Date: Sun, 13 Jan 2008 08:43:42 -0600 Subject: [IronPython] .NET vs. Tk vs. PyQt . . Message-ID: <6792ef120801130643q3381094bo6c892427dc7a43b7@mail.gmail.com> What are the "big picture" differences between these three? I've figured out that all three give Python GUI capability. I also know that .NET is specific to Windows and in addition gives access to sound and graphics capability of the computer. Tk and PyQt are available for both Windows and Linux. I'm sure there are other extensions out there that I'm not aware of that provide the same functionality. Do any of these three systems rely on each other? When you write an application, would I ever use .NET in one part and Tk in another and PyQt in another? If I write an application in Python using one of these systems, would another user on a different OS have to make extensive changes to the program to run it on their system, or is that the beauty of the multi-platform extensions? I'm not looking for extensive in-depth tutorial (I'll get to that in a few months!!), just trying to figure out in my mind the differences of these three systems. Thanks in advance. . . -- Keith Hoard Collierville, TN khoard at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Sun Jan 13 18:54:31 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Sun, 13 Jan 2008 09:54:31 -0800 Subject: [IronPython] How to call a c dll from IronPython? In-Reply-To: References: <266103.94368.qm@web63404.mail.re1.yahoo.com>, Message-ID: <7AD436E4270DD54A94238001769C2227FB8E9C69DA@DF-GRTDANE-MSG.exchange.corp.microsoft.com> The other possibility is P/Invoke but we don't expose that from IronPython. Instead you need to write a C# wrapper. Then you do a clr.AddReference to the wrapper assembly, import it, and call the helper function. ________________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Slide [slide.o.mix at gmail.com] Sent: Sunday, January 13, 2008 4:18 AM To: Discussion of IronPython Subject: Re: [IronPython] How to call a c dll from IronPython? On Jan 13, 2008 1:26 AM, console shark wrote: > > I wrote a function and built it to a dll in C. For traditional CPython I > then used SWIG to generate the module files and can call it easily. > > However I am not sure how to call this same dll and function from > IronPython? The function looks like: > > int func(char* p, int i, int j); > > Any easy way to do this? Does this require pInvoke and if so how do you do > this from IronPython? > Check into FePy (http://fepy.sourceforge.net), they have an implementation of ctypes which should let you do what you want. slide _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Sun Jan 13 19:23:31 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 13 Jan 2008 18:23:31 +0000 Subject: [IronPython] .NET vs. Tk vs. PyQt . . In-Reply-To: <6792ef120801130643q3381094bo6c892427dc7a43b7@mail.gmail.com> References: <6792ef120801130643q3381094bo6c892427dc7a43b7@mail.gmail.com> Message-ID: <478A5723.2030500@voidspace.org.uk> Keith Hoard wrote: > What are the "big picture" differences between these three? > > I've figured out that all three give Python GUI capability. I also > know that .NET is specific to Windows and in addition gives access to > sound and graphics capability of the computer. Tk and PyQt are > available for both Windows and Linux. I'm sure there are other > extensions out there that I'm not aware of that provide the same > functionality. You're really comparing apples and oranges here. .NET (and Mono) are *platforms* for creating and running applications. They give access to libraries (like Windows Forms) for creating GUIs. PyQt and Tkinter are GUI libraries that run *on* CPython (and not on .NET). There are lots of GUI toolkits available for CPython, but very few that are easy to use from both CPython and IronPython. The Mono implementation of Windows Forms is getting very capable now, so it is a good target for creating attractive cross-platform applications with IronPython. Tk is a bit of an odd user interface - and by default it looks quite ugly. You can tweak to produce modern looking applications, but it wouldn't be my first choice of GUI toolkit. Other libraries like PyQt, wxPython, GTK etc, are good ways of creating good looking desktop applications with CPython. Choosing which one to use is a difficult task... I hope this helps. Michael Foord http://www.manning.com/foord > > Do any of these three systems rely on each other? When you write an > application, would I ever use .NET in one part and Tk in another and > PyQt in another? If I write an application in Python using one of > these systems, would another user on a different OS have to make > extensive changes to the program to run it on their system, or is that > the beauty of the multi-platform extensions? > > I'm not looking for extensive in-depth tutorial (I'll get to that in a > few months!!), just trying to figure out in my mind the differences of > these three systems. > > Thanks in advance. . . > > -- > > Keith Hoard > Collierville, TN > khoard at gmail.com > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From nytrokiss at gmail.com Sun Jan 13 19:27:39 2008 From: nytrokiss at gmail.com (James Matthews) Date: Sun, 13 Jan 2008 19:27:39 +0100 Subject: [IronPython] .NET vs. Tk vs. PyQt . . In-Reply-To: <6792ef120801130643q3381094bo6c892427dc7a43b7@mail.gmail.com> References: <6792ef120801130643q3381094bo6c892427dc7a43b7@mail.gmail.com> Message-ID: <8a6b8e350801131027g67f47ec6pe7799af266057d1@mail.gmail.com> Well .Net's gui library is Forms, PyQt is python binding that allow it to connect to the QT library, Same thing with TK and WxPython! Enjoy On Jan 13, 2008 3:43 PM, Keith Hoard wrote: > What are the "big picture" differences between these three? > > I've figured out that all three give Python GUI capability. I also know > that .NET is specific to Windows and in addition gives access to sound and > graphics capability of the computer. Tk and PyQt are available for both > Windows and Linux. I'm sure there are other extensions out there that I'm > not aware of that provide the same functionality. > > Do any of these three systems rely on each other? When you write an > application, would I ever use .NET in one part and Tk in another and PyQt in > another? If I write an application in Python using one of these systems, > would another user on a different OS have to make extensive changes to the > program to run it on their system, or is that the beauty of the > multi-platform extensions? > > I'm not looking for extensive in-depth tutorial (I'll get to that in a few > months!!), just trying to figure out in my mind the differences of these > three systems. > > Thanks in advance. . . > > -- > > Keith Hoard > Collierville, TN > khoard at gmail.com > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- http://search.goldwatches.com/?Search=Movado+Watches http://www.jewelerslounge.com http://www.goldwatches.com From khoard at gmail.com Sun Jan 13 20:12:15 2008 From: khoard at gmail.com (Keith Hoard) Date: Sun, 13 Jan 2008 13:12:15 -0600 Subject: [IronPython] .NET vs. Tk vs. PyQt . . In-Reply-To: <478A5723.2030500@voidspace.org.uk> References: <6792ef120801130643q3381094bo6c892427dc7a43b7@mail.gmail.com> <478A5723.2030500@voidspace.org.uk> Message-ID: <6792ef120801131112l3b733112m3dc2d8c4120dc4e0@mail.gmail.com> Michael, Thanks for the reply. I have to learn how to tell the difference between an apple and an orange before I can start cooking!! On Jan 13, 2008 12:23 PM, Michael Foord wrote: > Keith Hoard wrote: > > What are the "big picture" differences between these three? > > > > I've figured out that all three give Python GUI capability. I also > > know that .NET is specific to Windows and in addition gives access to > > sound and graphics capability of the computer. Tk and PyQt are > > available for both Windows and Linux. I'm sure there are other > > extensions out there that I'm not aware of that provide the same > > functionality. > > You're really comparing apples and oranges here. > > .NET (and Mono) are *platforms* for creating and running applications. > They give access to libraries (like Windows Forms) for creating GUIs. > > PyQt and Tkinter are GUI libraries that run *on* CPython (and not on > .NET). > > There are lots of GUI toolkits available for CPython, but very few that > are easy to use from both CPython and IronPython. > > The Mono implementation of Windows Forms is getting very capable now, so > it is a good target for creating attractive cross-platform applications > with IronPython. > > Tk is a bit of an odd user interface - and by default it looks quite > ugly. You can tweak to produce modern looking applications, but it > wouldn't be my first choice of GUI toolkit. > > Other libraries like PyQt, wxPython, GTK etc, are good ways of creating > good looking desktop applications with CPython. Choosing which one to > use is a difficult task... > > I hope this helps. > > Michael Foord > http://www.manning.com/foord > > > > > Do any of these three systems rely on each other? When you write an > > application, would I ever use .NET in one part and Tk in another and > > PyQt in another? If I write an application in Python using one of > > these systems, would another user on a different OS have to make > > extensive changes to the program to run it on their system, or is that > > the beauty of the multi-platform extensions? > > > > I'm not looking for extensive in-depth tutorial (I'll get to that in a > > few months!!), just trying to figure out in my mind the differences of > > these three systems. > > > > Thanks in advance. . . > > > > -- > > > > Keith Hoard > > Collierville, TN > > khoard at gmail.com > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- Keith Hoard Collierville, TN khoard at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From corrin.lakeland at loyalty.co.nz Sun Jan 13 21:03:40 2008 From: corrin.lakeland at loyalty.co.nz (Corrin Lakeland) Date: Mon, 14 Jan 2008 09:03:40 +1300 Subject: [IronPython] .NET vs. Tk vs. PyQt . . In-Reply-To: <6792ef120801130643q3381094bo6c892427dc7a43b7@mail.gmail.com> References: <6792ef120801130643q3381094bo6c892427dc7a43b7@mail.gmail.com> Message-ID: <950F61F2E4D1A74E8BBB28C50D06D1BF011E6FB1@LNZLWLGSEX01.lnzl.co.nz> Also worth mentioning that TK is really ugly and a pain to code for compared to windows forms or QT. I?d drop it from the options even before I dropped wx (which I view as better than TK but not as good as QT or windows forms). PS: I imagine most of windows forms is available cross-platform via mono, though I haven?t tried myself. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Keith Hoard Sent: Monday, 14 January 2008 3:44 a.m. To: IronPython Mailing List Subject: [IronPython] .NET vs. Tk vs. PyQt . . What are the "big picture" differences between these three? ______________________________________________________________________________ CAUTION: This e-mail message and accompanying data or attachments may contain information that is confidential, proprietary and/or subject to legal privilege. If you are not the intended recipient, you must not directly or indirectly read, use, disseminate, distribute, print or copy this email or attachments. If you have received this e-mail in error, please notify us immediately and delete all material pertaining to this e-mail. Please also note that the opinions expressed in this document are those of the author, and not necessarily those of Loyalty New Zealand Limited. DISCLAIMER: To the maximum extent permitted by law, Loyalty New Zealand Limited is not liable (including in respect for negligence) for viruses or other defects or for changes made to this email or to any attachments. Before opening or using attachments, check them for viruses and other defects. ______________________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From idmkid at yahoo.com Mon Jan 14 19:53:20 2008 From: idmkid at yahoo.com (David Seruyange) Date: Mon, 14 Jan 2008 10:53:20 -0800 (PST) Subject: [IronPython] No import this? Message-ID: <699167.29960.qm@web30808.mail.mud.yahoo.com> Does IronPython strip the easter egg? ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Mon Jan 14 20:04:06 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 14 Jan 2008 11:04:06 -0800 Subject: [IronPython] No import this? In-Reply-To: <699167.29960.qm@web30808.mail.mud.yahoo.com> References: <699167.29960.qm@web30808.mail.mud.yahoo.com> Message-ID: <7AD436E4270DD54A94238001769C2227FB8EC17643@DF-GRTDANE-MSG.exchange.corp.microsoft.com> We just don't include the standard library by default (which is where this comes from). If you set IRONPYTHONPATH=C:\Python25\Lib (or wherever your Python lib dir is) or you start IronPython from the lib dir it'll work. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of David Seruyange Sent: Monday, January 14, 2008 10:53 AM To: Discussion of IronPython Subject: [IronPython] No import this? Does IronPython strip the easter egg? ________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Tue Jan 15 00:38:14 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Tue, 15 Jan 2008 08:38:14 +0900 Subject: [IronPython] No import this? In-Reply-To: <7AD436E4270DD54A94238001769C2227FB8EC17643@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <699167.29960.qm@web30808.mail.mud.yahoo.com> <7AD436E4270DD54A94238001769C2227FB8EC17643@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <5b0248170801141538v7c75e4e8x36e0fe669da5a4c8@mail.gmail.com> David Seruyange wrote: > Does IronPython strip the easter egg? 2008/1/15, Dino Viehland : > We just don't include the standard library by default (which is where this > comes from). If you set IRONPYTHONPATH=C:\Python25\Lib (or wherever your > Python lib dir is) or you start IronPython from the lib dir it'll work. If we are to discuss the easter egg... How about this? >>> from __future__ import braces Hehe. -- Seo Sanghyeon From dinov at exchange.microsoft.com Tue Jan 15 02:02:58 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 14 Jan 2008 17:02:58 -0800 Subject: [IronPython] No import this? In-Reply-To: <5b0248170801141538v7c75e4e8x36e0fe669da5a4c8@mail.gmail.com> References: <699167.29960.qm@web30808.mail.mud.yahoo.com> <7AD436E4270DD54A94238001769C2227FB8EC17643@DF-GRTDANE-MSG.exchange.corp.microsoft.com>, <5b0248170801141538v7c75e4e8x36e0fe669da5a4c8@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C222701041BD3E7E0@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Wow, that's cute, and it's actually implemented in the runtime. ________________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo [sanxiyn at gmail.com] Sent: Monday, January 14, 2008 3:38 PM To: Discussion of IronPython Subject: Re: [IronPython] No import this? David Seruyange wrote: > Does IronPython strip the easter egg? 2008/1/15, Dino Viehland : > We just don't include the standard library by default (which is where this > comes from). If you set IRONPYTHONPATH=C:\Python25\Lib (or wherever your > Python lib dir is) or you start IronPython from the lib dir it'll work. If we are to discuss the easter egg... How about this? >>> from __future__ import braces Hehe. -- Seo Sanghyeon _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From rpigneri at LavaStorm.com Tue Jan 15 17:09:05 2008 From: rpigneri at LavaStorm.com (Pigneri, Rocco) Date: Tue, 15 Jan 2008 11:09:05 -0500 Subject: [IronPython] Roadmap for IronPython 2.0 Message-ID: Dear all, I am new to IronPython. IP 1.1 looks really great, and I have really enjoyed learning to use it over the last few weeks. I'm impressed with both its power and ease of use. One thing that I would love to learn more about, however, is the planned features and goals for 2.0, particularly with regard to the DLR, but I haven't been able to find a feature roadmap or anything like that yet. I have looked at the release notes and the documentation download for IP 2.0 itself, but those documents were either very specific to each release or focused on documenting the code of the interpreter rather than the features/goals of 2.0. Would someone be able to point me towards that document? Thank you, Rocco Pigneri -------------- next part -------------- An HTML attachment was scrubbed... URL: From rpigneri at LavaStorm.com Tue Jan 15 17:22:44 2008 From: rpigneri at LavaStorm.com (Pigneri, Rocco) Date: Tue, 15 Jan 2008 11:22:44 -0500 Subject: [IronPython] Reloading Modules Message-ID: Dear all, While I know that this could be a more general Python question, since IronPython has its own interpreter, I thought that I should probably ask this question here in case it actually is IPy specific. Also, I am new to Python so if there is a document somewhere that answers this question, I am more than happy to read it if someone points me to it. So, the question. I have a program that has multiple classes. Since I have a C#/Java background, I have so far put all these classes in a separate file, and thus in a separate module. They are organized like this: - Main.py calls - ApplicationForm Class which contains - Widget Class Main pretty much just creates a new ApplicatoinForm instance and displays it. ApplicationForm then has some Widget instances on it. When I make a change to the Widgets, I find myself reloading the Widget module, then the ApplicationForm module, and then finally Main.py in order to have my changes reflected on the form. However, I know that this is somewhat against the Python philosophy of dynamic changes while running a program. Is there a better way to do this, or do I have to use this process because I'm using Windows Forms? Also, if I do have to continue using this process, is there a quick one-liner that I could use to reload all my changes without having to reload each module by hand? Thank you, Rocco -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Jan 15 18:40:55 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 15 Jan 2008 09:40:55 -0800 Subject: [IronPython] Reloading Modules In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C222701041BC43197@DF-GRTDANE-MSG.exchange.corp.microsoft.com> You could always make a 4th module which reloads the 1st three :) The other option would be to just put them all in one module - that's certainly not unprecedented and if you're not planning on reusing the components/modules individually might make the most sense. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pigneri, Rocco Sent: Tuesday, January 15, 2008 8:23 AM To: users at lists.ironpython.com Subject: [IronPython] Reloading Modules Dear all, While I know that this could be a more general Python question, since IronPython has its own interpreter, I thought that I should probably ask this question here in case it actually is IPy specific. Also, I am new to Python so if there is a document somewhere that answers this question, I am more than happy to read it if someone points me to it. So, the question. I have a program that has multiple classes. Since I have a C#/Java background, I have so far put all these classes in a separate file, and thus in a separate module. They are organized like this: - Main.py calls - ApplicationForm Class which contains - Widget Class Main pretty much just creates a new ApplicatoinForm instance and displays it. ApplicationForm then has some Widget instances on it. When I make a change to the Widgets, I find myself reloading the Widget module, then the ApplicationForm module, and then finally Main.py in order to have my changes reflected on the form. However, I know that this is somewhat against the Python philosophy of dynamic changes while running a program. Is there a better way to do this, or do I have to use this process because I'm using Windows Forms? Also, if I do have to continue using this process, is there a quick one-liner that I could use to reload all my changes without having to reload each module by hand? Thank you, Rocco -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Jan 15 20:16:18 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 15 Jan 2008 11:16:18 -0800 Subject: [IronPython] Roadmap for IronPython 2.0 In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C222701041BC43204@DF-GRTDANE-MSG.exchange.corp.microsoft.com> We don't really have a document like this but the general goal is to ship IronPython 2.0 by the end of the year. The goals for IronPython generally include CPython 2.5 compatibility and fully running on top of the DLR. And of course we've already seen numerous improvements from IronPython 1.1 -> 2.0 and I expect to see a bunch more random improvements as we continue (e.g. bug fixes, performance, etc...). For the DLR its self the plan is to ship a v1.0 around the same time as IronPython 2.0. The goal for DLR v1.0 is to get great hosting support so that apps can consume multiple languages and languages can plug into the DLR and run inside of applications in a reasonable manner. The really interesting question at this point for DLR v1.0 is how finalized the language implementer API will be. We still have some work to know if that'll be finalized in time or if we'll be expecting some breaking changes in that area post DLR 1.0. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pigneri, Rocco Sent: Tuesday, January 15, 2008 8:09 AM To: users at lists.ironpython.com Subject: [IronPython] Roadmap for IronPython 2.0 Dear all, I am new to IronPython. IP 1.1 looks really great, and I have really enjoyed learning to use it over the last few weeks. I'm impressed with both its power and ease of use. One thing that I would love to learn more about, however, is the planned features and goals for 2.0, particularly with regard to the DLR, but I haven't been able to find a feature roadmap or anything like that yet. I have looked at the release notes and the documentation download for IP 2.0 itself, but those documents were either very specific to each release or focused on documenting the code of the interpreter rather than the features/goals of 2.0. Would someone be able to point me towards that document? Thank you, Rocco Pigneri -------------- next part -------------- An HTML attachment was scrubbed... URL: From rpigneri at LavaStorm.com Tue Jan 15 20:31:17 2008 From: rpigneri at LavaStorm.com (Pigneri, Rocco) Date: Tue, 15 Jan 2008 14:31:17 -0500 Subject: [IronPython] Roadmap for IronPython 2.0 In-Reply-To: <7AD436E4270DD54A94238001769C222701041BC43204@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C222701041BC43204@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Dino, Thank you for your response. Funny that I would check my e-mail seconds before this message hit my mail box :-). We don't really have a document like this but the general goal is to ship IronPython 2.0 by the end of the year. The goals for IronPython generally include CPython 2.5 compatibility and fully running on top of the DLR. And of course we've already seen numerous improvements from IronPython 1.1 -> 2.0 and I expect to see a bunch more random improvements as we continue (e.g. bug fixes, performance, etc...). Excuse my ignorance--again, I am new to Python--but why is it important to have CPython 2.5 compatibility as opposed to, say, Python 2.5 compatibility? Or are the two identical from a "user" perspective? For the DLR its self the plan is to ship a v1.0 around the same time as IronPython 2.0. The goal for DLR v1.0 is to get great hosting support so that apps can consume multiple languages and languages can plug into the DLR and run inside of applications in a reasonable manner. When you say this, do you mean that this will allow for situations such as letting C# instantiate a type that defined in IronPython and then manipulate this object? This would be useful in a situation where you have a unit testing framework written in a static language (like NUnit) or an analysis tool that expects to consume a static language. Or is the goal more to ensure that different dynamic languages can talk to each other (such as Python and Ruby) across assembly boundaries? Thank you, Rocco ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Tuesday, January 15, 2008 2:16 PM To: Discussion of IronPython Subject: Re: [IronPython] Roadmap for IronPython 2.0 We don't really have a document like this but the general goal is to ship IronPython 2.0 by the end of the year. The goals for IronPython generally include CPython 2.5 compatibility and fully running on top of the DLR. And of course we've already seen numerous improvements from IronPython 1.1 -> 2.0 and I expect to see a bunch more random improvements as we continue (e.g. bug fixes, performance, etc...). For the DLR its self the plan is to ship a v1.0 around the same time as IronPython 2.0. The goal for DLR v1.0 is to get great hosting support so that apps can consume multiple languages and languages can plug into the DLR and run inside of applications in a reasonable manner. The really interesting question at this point for DLR v1.0 is how finalized the language implementer API will be. We still have some work to know if that'll be finalized in time or if we'll be expecting some breaking changes in that area post DLR 1.0. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pigneri, Rocco Sent: Tuesday, January 15, 2008 8:09 AM To: users at lists.ironpython.com Subject: [IronPython] Roadmap for IronPython 2.0 Dear all, I am new to IronPython. IP 1.1 looks really great, and I have really enjoyed learning to use it over the last few weeks. I'm impressed with both its power and ease of use. One thing that I would love to learn more about, however, is the planned features and goals for 2.0, particularly with regard to the DLR, but I haven't been able to find a feature roadmap or anything like that yet. I have looked at the release notes and the documentation download for IP 2.0 itself, but those documents were either very specific to each release or focused on documenting the code of the interpreter rather than the features/goals of 2.0. Would someone be able to point me towards that document? Thank you, Rocco Pigneri -------------- next part -------------- An HTML attachment was scrubbed... URL: From rpigneri at LavaStorm.com Tue Jan 15 20:32:28 2008 From: rpigneri at LavaStorm.com (Pigneri, Rocco) Date: Tue, 15 Jan 2008 14:32:28 -0500 Subject: [IronPython] Reloading Modules In-Reply-To: <7AD436E4270DD54A94238001769C222701041BC43197@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C222701041BC43197@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Hmm, I hadn't thought of those two approaches. Right now, I am simply running "ipy main.py" whenever I make a change. However, that takes almost as long as compiling a C# assembly, which is what I thought we were trying to avoid :-). Thank you, Rocco ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Tuesday, January 15, 2008 12:41 PM To: Discussion of IronPython Subject: Re: [IronPython] Reloading Modules You could always make a 4th module which reloads the 1st three J The other option would be to just put them all in one module - that's certainly not unprecedented and if you're not planning on reusing the components/modules individually might make the most sense. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pigneri, Rocco Sent: Tuesday, January 15, 2008 8:23 AM To: users at lists.ironpython.com Subject: [IronPython] Reloading Modules Dear all, While I know that this could be a more general Python question, since IronPython has its own interpreter, I thought that I should probably ask this question here in case it actually is IPy specific. Also, I am new to Python so if there is a document somewhere that answers this question, I am more than happy to read it if someone points me to it. So, the question. I have a program that has multiple classes. Since I have a C#/Java background, I have so far put all these classes in a separate file, and thus in a separate module. They are organized like this: - Main.py calls - ApplicationForm Class which contains - Widget Class Main pretty much just creates a new ApplicatoinForm instance and displays it. ApplicationForm then has some Widget instances on it. When I make a change to the Widgets, I find myself reloading the Widget module, then the ApplicationForm module, and then finally Main.py in order to have my changes reflected on the form. However, I know that this is somewhat against the Python philosophy of dynamic changes while running a program. Is there a better way to do this, or do I have to use this process because I'm using Windows Forms? Also, if I do have to continue using this process, is there a quick one-liner that I could use to reload all my changes without having to reload each module by hand? Thank you, Rocco -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfugate at microsoft.com Tue Jan 15 20:34:47 2008 From: dfugate at microsoft.com (Dave Fugate) Date: Tue, 15 Jan 2008 11:34:47 -0800 Subject: [IronPython] IronPython 1.1.1 RC 1 In-Reply-To: <7346A825E148B049A9AD1D3ED46A2D9116C658D971@NA-EXMSG-C106.redmond.corp.microsoft.com> References: <7346A825E148B049A9AD1D3ED46A2D9116C658D7E6@NA-EXMSG-C106.redmond.corp.microsoft.com> <7AD436E4270DD54A94238001769C222701041BD3E7E1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <50B69702CA6E6D4E849D30CD4989AB8ED7584CAA0F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7346A825E148B049A9AD1D3ED46A2D9116C658D923@NA-EXMSG-C106.redmond.corp.microsoft.com> <7AD436E4270DD54A94238001769C222701041BC43194@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7346A825E148B049A9AD1D3ED46A2D9116C658D971@NA-EXMSG-C106.redmond.corp.microsoft.com> Message-ID: <7346A825E148B049A9AD1D3ED46A2D9116C658DA22@NA-EXMSG-C106.redmond.corp.microsoft.com> Hello IronPython Community, I'm pleased to announce the release of IronPython 1.1.1 Release Candidate 1. For this release we fixed the most requested CodePlex bugs and also a handful of trivial bugs. In total around twenty bugs have been resolved for 1.1.1 RC1. Additionally, an issue that was reported directly on the IronPython mailing list was fixed - testComparingClrObjects (see http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2008-January/006171.html for details). Assuming no major issues are discovered in this build, we hope to rerelease it as IronPython 1.1.1 in a couple of weeks. Please let us know if you encounter any issues as soon as possible. We'd like to thank everyone in the community for your bug reports and suggestions that helped make this a better release: Seo Sanghyeon. Pobrien, Giles Thomas, sdahlbac, grizlupo, Tony Djordjevski, ayarrow, Michael Foord, milind, Kristof Wagemans, and Jan Szumiec. You can download IronPython 1.1.1 RC 1 from http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=9910. The IronPython Team Complete list of bug fixes: * 10825 Sockets and Standard Library Modules in IronPython * 5682 System.Single boolean ops w/ integer types broken * 7594 type.__call__ always passes type(type) as 1st parameter * 6332 DataGridView doesn't support a list of Python class instances as its DataSource * 6489 Backslash on the interactive console causes syntax error * 8246 Bug in handling of keyword arguments for __call__ (resolver request) * 7987 Trivial: help(clr.AddReference) not helpful * 9262 not override __eq__ at derived float Title is required * 9807 When a .DLL exists we may improperly try to load it as a pre-compiled module when we should load it as a .NET DLL * 9453 += works differently on lists * 10474 Need to ignore null paths in sys.path * 11759 Zero-length regex split * 2206 with statement broken in commandline * 2248 Missing debug information for IL offset 0 of generated methods * 3529 Trivial: int.__int__ does not exist * 6266 re.compile(...).match(...) does not permit certain integer pos/endpos keyword parameter values * 6271 re.compile(...).match(...).groupdict() broken WRT to unnamed groups * 6272 re.compile(...).match(...).endpos has an incorrect value * 6273 re.sub(..., "...\?...", ...) broken * 6275 re.match(..., ...).regs is nearly always incorrect -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Tue Jan 15 21:15:20 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Tue, 15 Jan 2008 12:15:20 -0800 Subject: [IronPython] Roadmap for IronPython 2.0 In-Reply-To: References: <7AD436E4270DD54A94238001769C222701041BC43204@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7AD436E4270DD54A94238001769C222701041BC4322A@DF-GRTDANE-MSG.exchange.corp.microsoft.com> When I say CPython 2.5 compatibility I really just mean Python 2.5 compatibility. When speaking of multiple Python implementations CPython is just what everyone calls the original implementation of Python which is written in C that all the alternate implementations track. The goal for the DLR is to get great cross-language interop between the dynamic languages, not the ability to use Python objects from C#. But this is possible to a certain extent already via interfaces or common base classes. The most important missing feature is you can't do new SomePythonType() and that won't change in IronPython 2.0 / DLR 1.0. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pigneri, Rocco Sent: Tuesday, January 15, 2008 11:31 AM To: Discussion of IronPython Subject: Re: [IronPython] Roadmap for IronPython 2.0 Dino, Thank you for your response. Funny that I would check my e-mail seconds before this message hit my mail box :-). We don't really have a document like this but the general goal is to ship IronPython 2.0 by the end of the year. The goals for IronPython generally include CPython 2.5 compatibility and fully running on top of the DLR. And of course we've already seen numerous improvements from IronPython 1.1 -> 2.0 and I expect to see a bunch more random improvements as we continue (e.g. bug fixes, performance, etc...). Excuse my ignorance--again, I am new to Python--but why is it important to have CPython 2.5 compatibility as opposed to, say, Python 2.5 compatibility? Or are the two identical from a "user" perspective? For the DLR its self the plan is to ship a v1.0 around the same time as IronPython 2.0. The goal for DLR v1.0 is to get great hosting support so that apps can consume multiple languages and languages can plug into the DLR and run inside of applications in a reasonable manner. When you say this, do you mean that this will allow for situations such as letting C# instantiate a type that defined in IronPython and then manipulate this object? This would be useful in a situation where you have a unit testing framework written in a static language (like NUnit) or an analysis tool that expects to consume a static language. Or is the goal more to ensure that different dynamic languages can talk to each other (such as Python and Ruby) across assembly boundaries? Thank you, Rocco ________________________________ From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Tuesday, January 15, 2008 2:16 PM To: Discussion of IronPython Subject: Re: [IronPython] Roadmap for IronPython 2.0 We don't really have a document like this but the general goal is to ship IronPython 2.0 by the end of the year. The goals for IronPython generally include CPython 2.5 compatibility and fully running on top of the DLR. And of course we've already seen numerous improvements from IronPython 1.1 -> 2.0 and I expect to see a bunch more random improvements as we continue (e.g. bug fixes, performance, etc...). For the DLR its self the plan is to ship a v1.0 around the same time as IronPython 2.0. The goal for DLR v1.0 is to get great hosting support so that apps can consume multiple languages and languages can plug into the DLR and run inside of applications in a reasonable manner. The really interesting question at this point for DLR v1.0 is how finalized the language implementer API will be. We still have some work to know if that'll be finalized in time or if we'll be expecting some breaking changes in that area post DLR 1.0. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pigneri, Rocco Sent: Tuesday, January 15, 2008 8:09 AM To: users at lists.ironpython.com Subject: [IronPython] Roadmap for IronPython 2.0 Dear all, I am new to IronPython. IP 1.1 looks really great, and I have really enjoyed learning to use it over the last few weeks. I'm impressed with both its power and ease of use. One thing that I would love to learn more about, however, is the planned features and goals for 2.0, particularly with regard to the DLR, but I haven't been able to find a feature roadmap or anything like that yet. I have looked at the release notes and the documentation download for IP 2.0 itself, but those documents were either very specific to each release or focused on documenting the code of the interpreter rather than the features/goals of 2.0. Would someone be able to point me towards that document? Thank you, Rocco Pigneri -------------- next part -------------- An HTML attachment was scrubbed... URL: From SomethingNew2_0 at hotmail.com Wed Jan 16 00:20:27 2008 From: SomethingNew2_0 at hotmail.com (Herny Johnson) Date: Tue, 15 Jan 2008 17:20:27 -0600 Subject: [IronPython] Newbie .Net Message-ID: This is a general .NET question, but since I use IronPython for the .NET I guess I will ask it here: I was wondering the type of control that is used by many applications, including IronPython Studio, that is a pop-out menu that can be pinned down or closed. Also if it is unpinned is will snap back to a tab on the side of the form. Also it can be grabbed and either turned into an MDI Client form (I think) or it can be redocked on any side of the form, kind of like a ToolStripContainer. I have been Googling this for awhile, but I just can't figure out what it is or if it is even on the ,NET framework. -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Wed Jan 16 06:40:01 2008 From: slide.o.mix at gmail.com (Slide) Date: Tue, 15 Jan 2008 22:40:01 -0700 Subject: [IronPython] Newbie .Net In-Reply-To: References: Message-ID: On Jan 15, 2008 4:20 PM, Herny Johnson wrote: > > > > This is a general .NET question, but since I use IronPython for the .NET I > guess I will ask it here: > > I was wondering the type of control that is used by many applications, > including IronPython Studio, that is a pop-out menu that can be pinned down > or closed. Also if it is unpinned is will snap back to a tab on the side of > the form. Also it can be grabbed and either turned into an MDI Client form > (I think) or it can be redocked on any side of the form, kind of like a > ToolStripContainer. I have been Googling this for awhile, but I just can't > figure out what it is or if it is even on the ,NET framework. Docking Windows http://sourceforge.net/projects/dockpanelsuite/ slide From anakinnani at hotmail.com Wed Jan 16 15:47:33 2008 From: anakinnani at hotmail.com (jane janet) Date: Wed, 16 Jan 2008 14:47:33 +0000 Subject: [IronPython] Need help with Multiple forms Message-ID: Hello all,I need help again.I don't know how to handle this Error. I wanna create mulitiple forms in one project.I did the same as I used to deal with Ironpython IDE.But it doesn't work because I use Visual Studio 2005 SDK to implement this project.I've already attached my project sample. I really don't know what to do now.Please let me know if I have to go back to the old way immediately. Thank you,Jane _________________________________________________________________ Put your friends on the big screen with Windows Vista? + Windows Live?. http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=TXT_TAGLM_CPC_MediaCtr_bigscreen_012008 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Form1.txt URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: Form2.txt URL: From fuzzyman at voidspace.org.uk Wed Jan 16 15:48:10 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 16 Jan 2008 14:48:10 +0000 Subject: [IronPython] Need help with Multiple forms In-Reply-To: References: Message-ID: <478E192A.5000700@voidspace.org.uk> jane janet wrote: > > Hello all, > I need help again. > I don't know how to handle this Error. Could you let us know what the error is? If you want to run the attached files with IronPython you will (as a minimum) need to add references to the assemblies used: import clr clr.AddReference('System.Windows.Forms') clr.AddReference('System.Drawing') and possibly others. All the best, Michael Foord http://www.manning.com/foord > > I wanna create mulitiple forms in one project. > I did the same as I used to deal with Ironpython IDE. > But it doesn't work because I use Visual Studio 2005 SDK to implement > this project. > I've already attached my project sample. > > I really don't know what to do now. > Please let me know if I have to go back to the old way immediately. > > Thank you, > Jane > > > > ------------------------------------------------------------------------ > Put your friends on the big screen with Windows Vista? + Windows > Live?. Start now! > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From SomethingNew2_0 at hotmail.com Thu Jan 17 02:48:53 2008 From: SomethingNew2_0 at hotmail.com (Herny Johnson) Date: Wed, 16 Jan 2008 19:48:53 -0600 Subject: [IronPython] Newbie .Net Message-ID: Thanks for the help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vkhaskel at hotmail.com Thu Jan 17 20:17:46 2008 From: vkhaskel at hotmail.com (Vadim Khaskel) Date: Thu, 17 Jan 2008 19:17:46 +0000 Subject: [IronPython] Installing IronPython Studio Message-ID: Hi all, I try to install IronPython Studio and I have message instead that states the following: "The installation was interrupted before IronPython could be installed. You need to restart the installed to try again" I tried numerous times and after my PC was restarted too. VS 2008 Shell isolated mode already installed, but the thing about it is that I don't see it in Programs list... thanks for help, Vadim _________________________________________________________________ Connect and share in new ways with Windows Live. http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Thu Jan 17 20:54:02 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 17 Jan 2008 19:54:02 +0000 Subject: [IronPython] [spam] Need help with Multiple forms : Error Message In-Reply-To: References: Message-ID: <478FB25A.9020708@voidspace.org.uk> jane janet wrote: > hi, > I got an error message : "name 'Form2' not defined". > I don't understand what it is differrent from normal IronPython. > Please let me know if you know that. Please reply to the list rather than to me, other people can also answer these questions. This error means that your main script (the one you are running) is not importing Form2. Michael http://www.manning.com/foord > Thank you. > jane > > > ------------------------------------------------------------------------ > Get the power of Windows + Web with the new Windows Live. Get it now! > From fuzzyman at voidspace.org.uk Thu Jan 17 21:09:34 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 17 Jan 2008 20:09:34 +0000 Subject: [IronPython] [python] Installing IronPython Studio In-Reply-To: References: Message-ID: <478FB5FE.1050401@voidspace.org.uk> Vadim Khaskel wrote: > Hi all, > > I try to install IronPython Studio and I have message instead that > states the following: > > "The installation was interrupted before IronPython could be > installed. You need to restart the installed to try again" > > I tried numerous times and after my PC was restarted too. > > VS 2008 Shell isolated mode already installed, but the thing about it > is that I don't see it in Programs list... Running the 'installer' only decompresses the archive (which is not at all obvious). After running the downloaded installer for the shell, you need to go the folder it decompressed into (something like "C:VS 2008 Shell RedistIsolated Mode") and click on: "vsshellisolated_enu.exe" to actually install the redistributable runtime. I did a blog entry on this, with some other problems I had to fix: http://www.voidspace.org.uk/python/weblog/arch_d7_2007_12_15.shtml Michael http://www.manning.com/foord > > thanks for help, > > Vadim > > > ------------------------------------------------------------------------ > Connect and share in new ways with Windows Live. Get it now! > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From giles.thomas at resolversystems.com Thu Jan 17 15:00:42 2008 From: giles.thomas at resolversystems.com (Giles Thomas) Date: Thu, 17 Jan 2008 14:00:42 +0000 Subject: [IronPython] Resolver One 1.0 released Message-ID: <478F5F8A.2010206@resolversystems.com> Hi all, We are proud to announce the release of Resolver One, version 1.0 - the largest IronPython application in the world, we think, at 30,000 lines of production code backed up by 110,000 lines of unit and functional tests. Resolver One is a Rapid Application Development tool for analysing and presenting business data using a familiar spreadsheet interface, combined with a powerful IronPython-based scripting capability that allows you to insert your own code directly into the recalculation loop. It's free for non-commercial use (and for the introductory period quite cheap for commercial use :-), so if you would like to take a look, you can download it from our website (free registration required): Best regards, Giles -- Giles Thomas MD & CTO, Resolver Systems Ltd. giles.thomas at resolversystems.com +44 (0) 20 7253 6372 Try out Resolver One! (Free registration required) 17a Clerkenwell Road, London EC1M 5RD, UK VAT No.: GB 893 5643 79 Registered in England and Wales as company number 5467329. Registered address: 843 Finchley Road, London NW11 8NA, UK From vkhaskel at hotmail.com Sat Jan 19 00:19:00 2008 From: vkhaskel at hotmail.com (Vadim Khaskel) Date: Fri, 18 Jan 2008 23:19:00 +0000 Subject: [IronPython] invoking new form Message-ID: Hi all, I?m trying to invoke a form from python module (mod1) (which is not in the same name space as Form1 class like this: #in mod1 def newWinOpen(): Application.Run(Form2()) #I did import Form2 into this module# Doesn?t work? in my next attempt I put mod1 where I calling Form2 put into the same namespace as Form1 and Form2 In this case namespace class in Form1 doesn't see the mod1... What is the right way to do that....??? Thank you, Vadim _________________________________________________________________ Climb to the top of the charts!? Play the word scramble challenge with star power. http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Sat Jan 19 00:22:41 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Fri, 18 Jan 2008 15:22:41 -0800 Subject: [IronPython] invoking new form In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C222701041BC43AC3@DF-GRTDANE-MSG.exchange.corp.microsoft.com> What happens when you do this? Is an exception thrown? Does it just hang waiting w/ nothing happening? Also, are you doing this from the console or from modules which just get executed stand alone (e.g. ipy foo.py)? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vadim Khaskel Sent: Friday, January 18, 2008 3:19 PM To: users at lists.ironpython.com Subject: [IronPython] invoking new form Hi all, I'm trying to invoke a form from python module (mod1) (which is not in the same name space as Form1 class like this: #in mod1 def newWinOpen(): Application.Run(Form2()) #I did import Form2 into this module# Doesn't work... in my next attempt I put mod1 where I calling Form2 put into the same namespace as Form1 and Form2 In this case namespace class in Form1 doesn't see the mod1... What is the right way to do that....??? Thank you, Vadim ________________________________ Climb to the top of the charts! Play the word scramble challenge with star power. Play now! -------------- next part -------------- An HTML attachment was scrubbed... URL: From vkhaskel at hotmail.com Sat Jan 19 01:27:34 2008 From: vkhaskel at hotmail.com (Vadim Khaskel) Date: Sat, 19 Jan 2008 00:27:34 +0000 Subject: [IronPython] Users Digest, Vol 42, Issue 25 In-Reply-To: References: Message-ID: Here is my project tree: webA1 + Form1 + Form2 Program.py StartIt.py Form1, Form2 and StarIt are in class webA1: # namespace Form1.py ... def _button2_Click(self, sender, e): StartItK.newWinOpen() ... StarIt.py: import Form2 class webA1: class StartItK: ... def newWinOpen(): newf=Application.Run(webA1.Form2()) ----------------------------------------------------------------- when I run application - I get Unhandled exeption - "name StartItK not defined Detailes: See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box. ************** Exception Text **************IronPython.Runtime.Exceptions.PythonNameErrorException: name 'StartItK' not defined at IronPython.Runtime.Operations.Ops.CheckInitializedOrBuiltin(Object o, ICallerContext context, String name) at Form1._button2_Click$f188(FunctionEnvironment16Dictionary $env, Object self, Object sender, Object e) in Form1.py:line 126 at IronPython.Runtime.Calls.Function3.Call(ICallerContext context, Object arg0, Object arg1, Object arg2) at IronPython.Runtime.Calls.Function3.Call(ICallerContext context, Object[] args) at IronPython.Runtime.Operations.Ops.Call(Object func, Object[] args) at IronPython.Modules.ClrModule.ReturnChecker.RuntimeChecker.Call(Object[] args) at IronPython.Runtime.Operations.Ops.Call(Object func, Object[] args) at IronPython.Modules.ClrModule.ArgChecker.RuntimeChecker.Call(Object[] args) at IronPython.Runtime.Operations.Ops.Call(Object func, Object[] args) at IronPython.Runtime.Types.ReflectedEvent.EventDispatcher.Call(Object[] args) at IronPython.Runtime.Operations.Ops.Call(Object func, Object[] args) at IronPython.Runtime.Operations.Ops.Call(Object func, Object arg0, Object arg1) at System.Void(Object, EventArgs)##65(Object , Object , EventArgs ) at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) ************** Loaded Assemblies **************mscorlib Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///c:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll----------------------------------------webA1 Assembly Version: 0.0.0.0 Win32 Version: 0.0.0.0 CodeBase: file:///C:/Documents%20and%20Settings/vkhask/My%20Documents/IronPython%20Studio/webA1/webA1/bin/Debug/webA1.exe----------------------------------------IronPython Assembly Version: 1.1.0.0 Win32 Version: 1.1.1 CodeBase: file:///C:/Documents%20and%20Settings/vkhask/My%20Documents/IronPython%20Studio/webA1/webA1/bin/Debug/IronPython.DLL----------------------------------------IronMath Assembly Version: 1.1.0.0 Win32 Version: 1.1.1 CodeBase: file:///C:/Documents%20and%20Settings/vkhask/My%20Documents/IronPython%20Studio/webA1/webA1/bin/Debug/IronMath.DLL----------------------------------------System Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll----------------------------------------snippets1 Assembly Version: 0.0.0.0 Win32 Version: 1.1.1 CodeBase: file:///C:/Documents%20and%20Settings/vkhask/My%20Documents/IronPython%20Studio/webA1/webA1/bin/Debug/IronPython.dll----------------------------------------System.Xml Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll----------------------------------------System.Data Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll----------------------------------------System.Configuration Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll----------------------------------------System.Drawing Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll----------------------------------------System.Windows.Forms Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll----------------------------------------Accessibility Assembly Version: 2.0.0.0 Win32 Version: 2.0.50727.1433 (REDBITS.050727-1400) CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll----------------------------------------ArtOfTest.WebAii Assembly Version: 1.0.500.0 Win32 Version: 1.0.500.0 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/ArtOfTest.WebAii/1.0.500.0__4fd5f65be123776c/ArtOfTest.WebAii.dll---------------------------------------- ************** JIT Debugging **************To enable just-in-time (JIT) debugging, the .config file for thisapplication or computer (machine.config) must have thejitDebugging value set in the system.windows.forms section.The application must also be compiled with debuggingenabled. For example: When JIT debugging is enabled, any unhandled exceptionwill be sent to the JIT debugger registered on the computerrather than be handled by this dialog box. > From: users-request at lists.ironpython.com> Subject: Users Digest, Vol 42, Issue 25> To: users at lists.ironpython.com> Date: Fri, 18 Jan 2008 16:08:50 -0800> > 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. invoking new form (Vadim Khaskel)> 2. Re: invoking new form (Dino Viehland)> > > ----------------------------------------------------------------------> > Message: 1> Date: Fri, 18 Jan 2008 23:19:00 +0000> From: Vadim Khaskel > Subject: [IronPython] invoking new form> To: > Message-ID: > Content-Type: text/plain; charset="windows-1252"> > > Hi all,> > I?m trying to invoke a form from python module (mod1) (which is not in the same name space as Form1 class like this:> #in mod1> def newWinOpen():> Application.Run(Form2()) #I did import Form2 into this module#> > Doesn?t work?> > in my next attempt I put mod1 where I calling Form2 put into the same namespace as Form1 and Form2> > > In this case namespace class in Form1 doesn't see the mod1...> > > What is the right way to do that....???> > Thank you,> > Vadim> _________________________________________________________________> Climb to the top of the charts!? Play the word scramble challenge with star power.> http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan> -------------- next part --------------> An HTML attachment was scrubbed...> URL: http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20080118/87e30be6/attachment.html > > ------------------------------> > Message: 2> Date: Fri, 18 Jan 2008 15:22:41 -0800> From: Dino Viehland > Subject: Re: [IronPython] invoking new form> To: Discussion of IronPython > Message-ID:> <7AD436E4270DD54A94238001769C222701041BC43AC3 at DF-GRTDANE-MSG.exchange.corp.microsoft.com>> > Content-Type: text/plain; charset="us-ascii"> > What happens when you do this? Is an exception thrown? Does it just hang waiting w/ nothing happening? Also, are you doing this from the console or from modules which just get executed stand alone (e.g. ipy foo.py)?> > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vadim Khaskel> Sent: Friday, January 18, 2008 3:19 PM> To: users at lists.ironpython.com> Subject: [IronPython] invoking new form> > Hi all,> > I'm trying to invoke a form from python module (mod1) (which is not in the same name space as Form1 class like this:> #in mod1> def newWinOpen():> Application.Run(Form2()) #I did import Form2 into this module#> > Doesn't work...> > in my next attempt I put mod1 where I calling Form2 put into the same namespace as Form1 and Form2> > > In this case namespace class in Form1 doesn't see the mod1...> > > What is the right way to do that....???> > Thank you,> > Vadim> > ________________________________> Climb to the top of the charts! Play the word scramble challenge with star power. Play now!> -------------- next part --------------> An HTML attachment was scrubbed...> URL: http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20080118/acd7c2df/attachment.html > > ------------------------------> > _______________________________________________> Users mailing list> Users at lists.ironpython.com> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com> > > End of Users Digest, Vol 42, Issue 25> ************************************* _________________________________________________________________ Climb to the top of the charts!? Play the word scramble challenge with star power. http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan -------------- next part -------------- An HTML attachment was scrubbed... URL: From anakinnani at hotmail.com Sat Jan 19 02:03:20 2008 From: anakinnani at hotmail.com (jane janet) Date: Sat, 19 Jan 2008 01:03:20 +0000 Subject: [IronPython] invoking new form In-Reply-To: <7AD436E4270DD54A94238001769C222701041BC43AC3@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C222701041BC43AC3@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Hi all, I think you should try this. #in mod1 import NameofFile #(the .py file that contains Form2()) def newWinOpen(): self.Hide() self.form2 = NameofFile.Form2() self.form2.ShowDialog() I was wandering if this can solve your problem exactly. All the best, Jane From: dinov at exchange.microsoft.comTo: users at lists.ironpython.comDate: Fri, 18 Jan 2008 15:22:41 -0800Subject: Re: [IronPython] invoking new form What happens when you do this? Is an exception thrown? Does it just hang waiting w/ nothing happening? Also, are you doing this from the console or from modules which just get executed stand alone (e.g. ipy foo.py)? From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vadim KhaskelSent: Friday, January 18, 2008 3:19 PMTo: users at lists.ironpython.comSubject: [IronPython] invoking new form Hi all, I?m trying to invoke a form from python module (mod1) (which is not in the same name space as Form1 class like this: #in mod1 def newWinOpen(): Application.Run(Form2()) #I did import Form2 into this module# Doesn?t work? in my next attempt I put mod1 where I calling Form2 put into the same namespace as Form1 and Form2 In this case namespace class in Form1 doesn't see the mod1... What is the right way to do that....??? Thank you, Vadim Climb to the top of the charts! Play the word scramble challenge with star power. Play now! _________________________________________________________________ Connect and share in new ways with Windows Live. http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Sun Jan 20 21:55:29 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 20 Jan 2008 20:55:29 +0000 Subject: [IronPython] The __hello__ Module Message-ID: <4793B541.40006@voidspace.org.uk> Hello guys, Any plans to implement the '__hello__' module for IronPython? Michael http://www.manning.com/foord From sanxiyn at gmail.com Mon Jan 21 03:56:45 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Mon, 21 Jan 2008 11:56:45 +0900 Subject: [IronPython] Priting with comma Message-ID: <5b0248170801201856i6819840ck67d7a37009dc6ba1@mail.gmail.com> The following program produces different output on CPython and IronPython 1 and 2. print 1, A strange corner case indeed. -- Seo Sanghyeon From dinov at exchange.microsoft.com Mon Jan 21 05:53:00 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Sun, 20 Jan 2008 20:53:00 -0800 Subject: [IronPython] The __hello__ Module In-Reply-To: <4793B541.40006@voidspace.org.uk> References: <4793B541.40006@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C222701041BC43C01@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I was planning on focusing on bugs this week so I guess I'll kick it off with the silly bugs: this one and from future import braces. :) -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Sunday, January 20, 2008 12:55 PM To: Discussion of IronPython Subject: [IronPython] The __hello__ Module Hello guys, Any plans to implement the '__hello__' module for IronPython? Michael http://www.manning.com/foord _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Mon Jan 21 13:58:13 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 21 Jan 2008 12:58:13 +0000 Subject: [IronPython] [python] Re: The __hello__ Module In-Reply-To: <7AD436E4270DD54A94238001769C222701041BC43C01@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <4793B541.40006@voidspace.org.uk> <7AD436E4270DD54A94238001769C222701041BC43C01@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <479496E5.8040403@voidspace.org.uk> Dino Viehland wrote: > I was planning on focusing on bugs this week so I guess I'll kick it off with the silly bugs: this one and from future import braces. :) > That's great news, I don't think IronPython can claim true compatibility with CPython until these are in... ;-) Great work on the 1.1.1 RC by the way. Much appreciated. Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Sunday, January 20, 2008 12:55 PM > To: Discussion of IronPython > Subject: [IronPython] The __hello__ Module > > Hello guys, > > Any plans to implement the '__hello__' module for IronPython? > > Michael > http://www.manning.com/foord > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > From dinov at exchange.microsoft.com Mon Jan 21 20:48:12 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Mon, 21 Jan 2008 11:48:12 -0800 Subject: [IronPython] [python] Re: The __hello__ Module In-Reply-To: <479496E5.8040403@voidspace.org.uk> References: <4793B541.40006@voidspace.org.uk> <7AD436E4270DD54A94238001769C222701041BC43C01@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <479496E5.8040403@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C222701041BC43D27@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Actually, on 2nd thought, I'm not going to do __hello__ right now. It's interesting because it's the top of the frozen module iceberg. I think what we want to do here is revisit this when we also revisit saving compiled assemblies to disk. Then we can call those 'frozen modules' and include the __hello__ module as a default one of those. Just adding support for some __hello__ written in C# doesn't make much sense because it'll be wrong. I'll still change the error message for Seo's from __future__ import braces :). -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Monday, January 21, 2008 4:58 AM To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: The __hello__ Module Dino Viehland wrote: > I was planning on focusing on bugs this week so I guess I'll kick it off with the silly bugs: this one and from future import braces. :) > That's great news, I don't think IronPython can claim true compatibility with CPython until these are in... ;-) Great work on the 1.1.1 RC by the way. Much appreciated. Michael > -----Original Message----- > From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Sunday, January 20, 2008 12:55 PM > To: Discussion of IronPython > Subject: [IronPython] The __hello__ Module > > Hello guys, > > Any plans to implement the '__hello__' module for IronPython? > > Michael > http://www.manning.com/foord > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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 dfugate at microsoft.com Mon Jan 21 21:16:27 2008 From: dfugate at microsoft.com (Dave Fugate) Date: Mon, 21 Jan 2008 12:16:27 -0800 Subject: [IronPython] Priting with comma In-Reply-To: <5b0248170801201856i6819840ck67d7a37009dc6ba1@mail.gmail.com> References: <5b0248170801201856i6819840ck67d7a37009dc6ba1@mail.gmail.com> Message-ID: <7346A825E148B049A9AD1D3ED46A2D911A48BCC2B8@NA-EXMSG-C106.redmond.corp.microsoft.com> Thanks for the report Seo! Filed at http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=14835. -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Sanghyeon Seo Sent: Sunday, January 20, 2008 6:57 PM To: Discussion of IronPython Subject: [IronPython] Priting with comma The following program produces different output on CPython and IronPython 1 and 2. print 1, A strange corner case indeed. -- Seo Sanghyeon _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From Craig.S.Perler.04 at Alum.Dartmouth.ORG Tue Jan 22 05:31:23 2008 From: Craig.S.Perler.04 at Alum.Dartmouth.ORG (Craig S. Perler 04) Date: 21 Jan 2008 23:31:23 -0500 Subject: [IronPython] IronPython & Silverlight Message-ID: <39620598@lorax.Dartmouth.ORG> Hello, I'm having problems accessing .NET libraries from IronPython hosted within a Silverlight application and have hit a wall. If you have any advice, I'd be most appreciative! To describe my setup... I'm first initializing the PlatformAdaptationLayer with the details described here [http://www.voidspace.org.uk/ironpython/silverlight/embeddi ng_ironpython.shtml]. I'm not certain what exactly that does, but it seems clear that no amount of fiddling around in IronPython works without detailing the ScriptEnvironmentSetup. With that in place, I see a bit of progress: I can execute the script "def func():\r\n return 'in Func()'" and then retrieve the result by evaluating the script "func()". I've tried a variety of combinations to gain access to System.DateTime from the Python script, but they all end up with an error like the one below. Additionally, this error is also similar to the one I receive when attempting to call PythonEngine.ExecuteFile(string path), which I have thus far been unable to get to work. Any thoughts? Please let me know if you need more details to help me debug! Thanks in advance, -Craig ************************************* A first chance exception of type 'System.NotImplementedException' occurred in Unknown Module. System.NotImplementedException: The method or operation is not implemented. at Microsoft.Scripting.Hosting.PlatformAdaptationLayer.OpenInp utFileStream(String path) at Microsoft.Scripting.SourceFileUnit.OpenStream() at Microsoft.Scripting.SourceFileUnit.GetReader() at IronPython.Compiler.Parser.CreateParser(CompilerContext context, PythonEngineOptions options, Boolean verbatim) at IronPython.Compiler.Parser.CreateParser(CompilerContext context, PythonEngineOptions options) at IronPython.Compiler.Generation.PythonScriptCompiler.ParseFi le(CompilerContext cc) at Microsoft.Scripting.SourceFileUnit.Parse (CompilerContext compilerContext) at Microsoft.Scripting.SourceUnit.Compile(CompilerOptions options, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.CompileToModule (CompilerOptions options, ErrorSink errorSink) at Microsoft.Scripting.SourceUnit.CompileToModule() at IronPython.Runtime.Importer.LoadFromSourceUnit (SourceFileUnit sourceUnit) at IronPython.Runtime.Importer.LoadModuleFromSource (CodeContext context, String name, String path) at IronPython.Runtime.Importer.ImportFromPath(CodeContext context, String name, String fullName, List path) at IronPython.Runtime.Importer.ImportTopAbsolute (CodeContext context, String name) at IronPython.Runtime.Importer.ImportModule(CodeContext context, String modName, Boolean bottom) at IronPython.Runtime.Builtin.Import(CodeContext context, String name, Object globals, Object locals, Object fromList) at Import##7(CodeContext , Object , Object , Object , Object ) at Microsoft.Scripting.FastCallableWithContextAny.Call (CodeContext context, Object arg0, Object arg1, Object arg2, Object arg3) at Microsoft.Scripting.FastCallableWithContextAny.Call (CodeContext context, Object[] args) at Microsoft.Scripting.BuiltinFunction.Call(CodeContext context, Object[] args) at IronPython.Runtime.Operations.Ops.CallWithContext (CodeContext context, Object func, Object[] args) at IronPython.Runtime.Importer.Import(CodeContext context, String fullName, List from) at IronPython.Runtime.PythonOps.ImportWithNames (CodeContext context, String fullName, String[] names) at References: <4793B541.40006@voidspace.org.uk> <7AD436E4270DD54A94238001769C222701041BC43C01@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <479496E5.8040403@voidspace.org.uk> <7AD436E4270DD54A94238001769C222701041BC43D27@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <5b0248170801212051u4363e96brd5db808328056469@mail.gmail.com> 2008/1/22, Dino Viehland : > Actually, on 2nd thought, I'm not going to do __hello__ right now. It's interesting because it's the top of the frozen module iceberg. Indeed, and I'm not sure whether the frozen module makes any sense in IronPython world. It's hardly used in CPython these days. -- Seo Sanghyeon From sraju at zeomega.com Tue Jan 22 11:29:55 2008 From: sraju at zeomega.com (Raju Sivalingam) Date: Tue, 22 Jan 2008 15:59:55 +0530 Subject: [IronPython] how to enable ironpython in iss Message-ID: <4795C5A3.7010709@zeomega.com> In my .aspx page, if i mention language=IronPython, and access the page, it says it is invalid language. Please help me, How to configure this? thanks -Raju From empirebuilder at gmail.com Tue Jan 22 11:33:48 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Tue, 22 Jan 2008 12:33:48 +0200 Subject: [IronPython] how to enable ironpython in iss In-Reply-To: <4795C5A3.7010709@zeomega.com> References: <4795C5A3.7010709@zeomega.com> Message-ID: <8cd017b80801220233h701df8cbr8e1658aba0730f5c@mail.gmail.com> Install asp.net 3.5 web extension. On Jan 22, 2008 12:29 PM, Raju Sivalingam wrote: > In my .aspx page, if i mention language=IronPython, and access the page, > it says it is invalid language. > Please help me, How to configure this? > > thanks > -Raju > _______________________________________________ > 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 sraju at zeomega.com Tue Jan 22 13:19:28 2008 From: sraju at zeomega.com (Raju Sivalingam) Date: Tue, 22 Jan 2008 17:49:28 +0530 Subject: [IronPython] how to enable ironpython in iss In-Reply-To: <8cd017b80801220233h701df8cbr8e1658aba0730f5c@mail.gmail.com> References: <4795C5A3.7010709@zeomega.com> <8cd017b80801220233h701df8cbr8e1658aba0730f5c@mail.gmail.com> Message-ID: <4795DF50.8090709@zeomega.com> Hi, Are you talking about "ASP.NET 3.5 Extensions Preview" ? Dody Gunawinata wrote: > Install asp.net 3.5 web extension. > > On Jan 22, 2008 12:29 PM, Raju Sivalingam > wrote: > > In my .aspx page, if i mention language=IronPython, and access the > page, > it says it is invalid language. > Please help me, How to configure this? > > thanks > -Raju > _______________________________________________ > 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 > From Jimmy.Schementi at microsoft.com Tue Jan 22 23:13:34 2008 From: Jimmy.Schementi at microsoft.com (Jimmy Schementi) Date: Tue, 22 Jan 2008 14:13:34 -0800 Subject: [IronPython] IronPython & Silverlight In-Reply-To: <39620598@lorax.Dartmouth.ORG> References: <39620598@lorax.Dartmouth.ORG> Message-ID: <5283CA0A4168DF4FBBD71AE9ECA5A32844F221B863@NA-EXMSG-C116.redmond.corp.microsoft.com> > Craig S. Perler wrote: > > I'm having problems accessing .NET libraries from > IronPython hosted within a Silverlight application and > have hit a wall. If you have any advice, I'd be most > appreciative! The work around for hosting IronPython in Silverlight 1.1 is a little messy, since the DLR should take care of this and not require the user's app to override the PAL. We are revisiting this for the next release of Silverlight to make it work well. I assume you'd like to host IronPython in an existing C# SL app? If you can do without C# code, and without the bleeding edge IronPython version ... you could just use the IronPython version shipped in Silverlight. There are samples on silverlight.net if you'd like examples on how to do it. > To describe my setup... I'm first initializing the > PlatformAdaptationLayer with the details described here > [http://www.voidspace.org.uk/ironpython/silverlight/embeddi > ng_ironpython.shtml]. I'm not certain what exactly that > does, but it seems clear that no amount of fiddling around > in IronPython works without detailing the > ScriptEnvironmentSetup. With that in place, I see a bit of > progress: I can execute the script "def func():\r\n > return 'in Func()'" and then retrieve the result by > evaluating the script "func()". > > I've tried a variety of combinations to gain access to > System.DateTime from the Python script, but they all end > up with an error like the one below. Additionally, this > error is also similar to the one I receive when attempting > to call PythonEngine.ExecuteFile(string path), which I > have thus far been unable to get to work. Can you send me the source or a smaller repro of the issue? Michael, did you run into any of these issues? ~Jimmy From Craig.S.Perler.04 at Alum.Dartmouth.ORG Wed Jan 23 01:38:29 2008 From: Craig.S.Perler.04 at Alum.Dartmouth.ORG (Craig S. Perler 04) Date: 22 Jan 2008 19:38:29 -0500 Subject: [IronPython] IronPython & Silverlight Message-ID: <39659798@lorax.Dartmouth.ORG> Hi Jimmy, You're correct, I'm trying to host IronPython in an existing C# SL app and I would like to use the .NET libraries from IronPython. I hadn't realized or noticed, however, that the dlls shipped with SL are not the same as those available for production use from IronPython directly. My app references IronPython.dll version 2.0.0.0, runtime version 2.0.50727, file version 1.1.20625.0. Is there a more appropriate and still SL compatible version to use? That aside, the IronPython-relevant aspect of my app is straightforward: grab a string from a textbox, pass it via JavaScript to SL, and then attempt to execute it via IronPython. The C# method that handles this process is below. It takes the string from JavaScript, and then executes it as Python code. For the sake of debugging at first at least, it then assumes that a function "func" was defined, as that's then evaluated. [Scriptable] public void Execute(string script) { try { PythonEngine engine = PythonEngine.CurrentEngine; engine.Execute(script); object result = engine.Evaluate("func()"); if (result != null) { Debug.WriteLine(result); } } catch (Exception e) { Debug.WriteLine(e); } } Prior to any execution as per above, I initialize PAL exactly as described here: [http://www.voidspace.org.uk/ironpython/silverlight/embeddi ng_ironpython.shtml]. Thoughts on what I'm doing wrong? Thanks again, -Craig ---Discussion of IronPython wrote --- > Craig S. Perler wrote: > > I'm having problems accessing .NET libraries from > IronPython hosted within a Silverlight application and > have hit a wall. If you have any advice, I'd be most > appreciative! The work around for hosting IronPython in Silverlight 1.1 is a little messy, since the DLR should take care of this and not require the user's app to override the PAL. We are revisiting this for the next release of Silverlight to make it work well. I assume you'd like to host IronPython in an existing C# SL app? If you can do without C# code, and without the bleeding edge IronPython version ... you could just use the IronPython version shipped in Silverlight. There are samples on silverlight.net if you'd like examples on how to do it. > To describe my setup... I'm first initializing the > PlatformAdaptationLayer with the details described here > [http://www.voidspace.org.uk/ironpython/silverlight/embeddi > ng_ironpython.shtml]. I'm not certain what exactly that > does, but it seems clear that no amount of fiddling around > in IronPython works without detailing the > ScriptEnvironmentSetup. With that in place, I see a bit of > progress: I can execute the script "def func():\r\n > return 'in Func()'" and then retrieve the result by > evaluating the script "func()". > > I've tried a variety of combinations to gain access to > System.DateTime from the Python script, but they all end > up with an error like the one below. Additionally, this > error is also similar to the one I receive when attempting > to call PythonEngine.ExecuteFile(string path), which I > have thus far been unable to get to work. Can you send me the source or a smaller repro of the issue? Michael, did you run into any of these issues? ~Jimmy _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users- ironpython.com --- End of quote --- From miha.valencic at gmail.com Wed Jan 23 12:11:42 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Wed, 23 Jan 2008 12:11:42 +0100 Subject: [IronPython] IronPython and polymorphism? Help with interfaces Message-ID: <233dfa1d0801230311q78c6ec9cj631b38d0aa2b47fd@mail.gmail.com> Hi! I'm having troubles accessing .NET object properties from ipy. Object is passed to IronPython 1.1 and IronPython breaks with error: Unhandled Exception: System.MissingMemberException: 'Person' object has no attribute 'Name' This is all due to the fact, that this object is based on an interface, which is based on an interface. To make things clearer I've created a simple problem-statement program, which demonstrates the behavior. Problem: IronPython can NOT access class members of an explicitly implemented interface. The program that exhibits this is below, and also on http://www.mihavalencic.com/temp/Program.txt (for easier reading). Just compile it with IronPython.dll and it will break where it shouldn't (IMHO). I was searching information on how could I explicitly cast this object to IPerson (in the example), but could not find anyhing -- Python as a language apparently does not support interfaces. Ideas, suggestions are very welcome! update: I even tried something like this: person_explicit = IPerson("Wrapped.person); print person_explicit.Name; but I alwyas get the same error: Either the object does not have Name property or that NoneType is not callable. Thanks, Miha. The progarm: using System; using IronPython.Hosting; using IronPython.Modules; using System.Collections.Generic; namespace ProblemStatement { public interface IPerson { string Name {get;set;} } public class Person : IPerson { string IPerson.Name { get { return "Default name"; } set { } } } public class Wrapper { public IPerson person; public Wrapper(IPerson personIn) { person = personIn; } } class Program { static void Main(string[] args) { PythonEngine eng = new PythonEngine(); EngineModule mod = eng.CreateModule(); ClrModule clr = eng.Import("clr") as ClrModule; clr.AddReferenceByPartialName("ProblemStatement"); Dictionary locals = new Dictionary(); locals["Env"] = new Person(); Wrapper wrapped = new Wrapper(new Person()); locals["Wrapped"] = wrapped; // this works Console.WriteLine(wrapped.person.Name ); // this breaks eng.Execute("print Env.Name", mod, locals); // this breaks as well eng.Execute("print Wrapped.person.Name"); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Wed Jan 23 13:13:06 2008 From: slide.o.mix at gmail.com (Slide) Date: Wed, 23 Jan 2008 05:13:06 -0700 Subject: [IronPython] IronPython and polymorphism? Help with interfaces In-Reply-To: <233dfa1d0801230311q78c6ec9cj631b38d0aa2b47fd@mail.gmail.com> References: <233dfa1d0801230311q78c6ec9cj631b38d0aa2b47fd@mail.gmail.com> Message-ID: What if you don't implement the interface explicitly? You have IPerson.Name as the property name. That means that the object you need to pass in to the IronPython MUST be an IPerson rather than any type implementing IPerson. If you change it to just public string Name { } instead, does that work? >From an MSDN explicit interface tutorial "A class that implements an interface can explicitly implement a member of that interface. When a member is explicitly implemented, it cannot be accessed through a class instance, but only through an instance of the interface." Which means you either need to not implement the interface explicitly for that member, or you need to cast to IPerson before passing the object in. Thanks, slide On Jan 23, 2008 4:11 AM, Miha Valencic wrote: > Hi! > > I'm having troubles accessing .NET object properties from ipy. Object > is passed to IronPython 1.1 and IronPython breaks with error: > Unhandled Exception: System.MissingMemberException: 'Person' object > has no attribute 'Name' > > This is all due to the fact, that this object is based on an > interface, which is based on an interface. To make things clearer I've > created a simple problem-statement program, which demonstrates the > behavior. > > Problem: IronPython can NOT access class members of an explicitly > implemented interface. The program that exhibits this is below, and > also on http://www.mihavalencic.com/temp/Program.txt (for easier > reading). Just compile it with IronPython.dll and it will break where > it shouldn't (IMHO). > > I was searching information on how could I explicitly cast this object > to IPerson (in the example), but could not find anyhing -- Python as a > language apparently does not support interfaces. > > Ideas, suggestions are very welcome! > > update: I even tried something like this: > > person_explicit = IPerson("Wrapped.person); > print person_explicit.Name; > > but I alwyas get the same error: Either the object does not have Name > property or that NoneType is not callable. > > Thanks, > Miha. > > The progarm: > using System; > using IronPython.Hosting; > using IronPython.Modules; > using System.Collections.Generic; > > namespace ProblemStatement > { > public interface IPerson > { > string Name {get;set;} > } > public class Person : IPerson > { > string IPerson.Name > { > get > { > return "Default name"; > } > set > { > } > } > } > > public class Wrapper > { > public IPerson person; > public Wrapper(IPerson personIn) > { > person = personIn; > } > > } > > class Program > { > static void Main(string[] args) > { > PythonEngine eng = new PythonEngine(); > EngineModule mod = eng.CreateModule(); > ClrModule clr = eng.Import("clr") as ClrModule; > clr.AddReferenceByPartialName("ProblemStatement"); > > Dictionary locals = new Dictionary object>(); > > locals["Env"] = new Person(); > Wrapper wrapped = new Wrapper(new Person()); > locals["Wrapped"] = wrapped; > > // this works > Console.WriteLine(wrapped.person.Name); > > // this breaks > eng.Execute("print Env.Name", mod, locals); > > // this breaks as well > eng.Execute("print Wrapped.person.Name"); > } > } > } > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > -- slide-o-blog http://slide-o-blog.blogspot.com/ From empirebuilder at gmail.com Wed Jan 23 13:22:23 2008 From: empirebuilder at gmail.com (Dody Gunawinata) Date: Wed, 23 Jan 2008 14:22:23 +0200 Subject: [IronPython] how to enable ironpython in iss In-Reply-To: <4795DF50.8090709@zeomega.com> References: <4795C5A3.7010709@zeomega.com> <8cd017b80801220233h701df8cbr8e1658aba0730f5c@mail.gmail.com> <4795DF50.8090709@zeomega.com> Message-ID: <8cd017b80801230422t2b6fc789g1d334af194a84a8@mail.gmail.com> Yes. That preview contains the July version of IronPython support for ASP.Net On Jan 22, 2008 2:19 PM, Raju Sivalingam wrote: > Hi, > > Are you talking about "ASP.NET 3.5 Extensions Preview" ? > > Dody Gunawinata wrote: > > Install asp.net 3.5 web extension. > > > > On Jan 22, 2008 12:29 PM, Raju Sivalingam > > wrote: > > > > In my .aspx page, if i mention language=IronPython, and access the > > page, > > it says it is invalid language. > > Please help me, How to configure this? > > > > thanks > > -Raju > > _______________________________________________ > > 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 > > > > > -- nomadlife.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From sraju at zeomega.com Wed Jan 23 14:01:13 2008 From: sraju at zeomega.com (Raju Sivalingam) Date: Wed, 23 Jan 2008 18:31:13 +0530 Subject: [IronPython] Is it possible to create assemblies from Ironpython script? Message-ID: <47973A99.9010205@zeomega.com> Hi, Can i create assemblies from ironpython? How? thanks Raju From Jon.Cooper at arrowgrass.com Wed Jan 23 14:01:56 2008 From: Jon.Cooper at arrowgrass.com (Jon Cooper) Date: Wed, 23 Jan 2008 13:01:56 +0000 Subject: [IronPython] WinForms UserComponent binding a IronPythonConsole Message-ID: Hello, I've been enjoying using IronPython. I'm now going to embed it in my C# WinForms application to provide a way for users to perform simple ad-hoc scripting. Unfortunately this has been less easy than I thought it would be! I've built a subclass of TextBox that I can use to display and input the text coming to/from my user. Now I just need to connect it to a PythonEngine. In the article at http://blogs.msdn.com/jmstall/archive/2005/09/01/Howto_embed_ironpython.aspx, one gets the impression that a PythonEngine has a MyConsole property where one can connect an IConsole. Perfect! Unfortunately, that's not the case on my 1.1 build. Digging through the source I find that this stuff exists on IronPythonConsole, but that class appears to be designed for use statically. Before I go to the trouble of ripping apart IronPythonConsole and likely reinventing the wheel, is there something I'm missing here? Thanks, jon ________________________________ Arrowgrass Capital Partners (US) LP is a limited partnership registered in the State of Delaware. This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any transmission errors. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. -------------- next part -------------- An HTML attachment was scrubbed... URL: From miha.valencic at gmail.com Wed Jan 23 14:46:18 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Wed, 23 Jan 2008 14:46:18 +0100 Subject: [IronPython] IronPython and polymorphism? Help with interfaces In-Reply-To: References: <233dfa1d0801230311q78c6ec9cj631b38d0aa2b47fd@mail.gmail.com> Message-ID: <233dfa1d0801230546g6ef61d83lfc499b92fbbb9ba@mail.gmail.com> Slide, thanks for a quick response. My answers are inline: On Jan 23, 2008 1:13 PM, Slide wrote: > What if you don't implement the interface explicitly? You have > That of course works. > > >From an MSDN explicit interface tutorial > > Well, if you are the developer of the library in question this is one way to solve it. But in my case, this is really a 3rd party library that I want to access. And I can do so with .NET language, but no can do with Ipy. You mentioned explicit cast to IPerson. I think this is the language problem in python, since Python does not support interfaces. Thus, code explicit_cast = IPerson(objectInQuestion) throws an exception NoneType yada yada. Am I missing something here? Thanks, Miha. -------------- next part -------------- An HTML attachment was scrubbed... URL: From slide.o.mix at gmail.com Wed Jan 23 15:55:30 2008 From: slide.o.mix at gmail.com (Slide) Date: Wed, 23 Jan 2008 07:55:30 -0700 Subject: [IronPython] IronPython and polymorphism? Help with interfaces In-Reply-To: <233dfa1d0801230546g6ef61d83lfc499b92fbbb9ba@mail.gmail.com> References: <233dfa1d0801230311q78c6ec9cj631b38d0aa2b47fd@mail.gmail.com> <233dfa1d0801230546g6ef61d83lfc499b92fbbb9ba@mail.gmail.com> Message-ID: On Jan 23, 2008 6:46 AM, Miha Valencic wrote: > Slide, thanks for a quick response. My answers are inline: > > > On Jan 23, 2008 1:13 PM, Slide wrote: > > What if you don't implement the interface explicitly? You have > > > > That of course works. > > > > > >From an MSDN explicit interface tutorial > > > > > > Well, if you are the developer of the library in question this is one way to > solve it. But in my case, this is really a 3rd party library that I want to > access. And I can do so with .NET language, but no can do with Ipy. You > mentioned explicit cast to IPerson. I think this is the language problem in > python, since Python does not support interfaces. Thus, code > > explicit_cast = IPerson(objectInQuestion) > > throws an exception NoneType yada yada. Am I missing something here? > > Thanks, > Miha. > Try this: class Program { static void Main(string[] args) { PythonEngine eng = new PythonEngine(); EngineModule mod = eng.CreateModule(); ClrModule clr = eng.Import("clr") as ClrModule; clr.AddReferenceByPartialName("ProblemStatement"); Dictionary locals = new Dictionary(); Person p = new Person(); locals["Env"] = p as IPerson; // this breaks eng.Execute("print Env.Name", mod, locals); } } } As you can see, I just made the reference in the locals an IPerson explicitly. From miha.valencic at gmail.com Wed Jan 23 16:18:00 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Wed, 23 Jan 2008 16:18:00 +0100 Subject: [IronPython] IronPython and polymorphism? Help with interfaces In-Reply-To: References: <233dfa1d0801230311q78c6ec9cj631b38d0aa2b47fd@mail.gmail.com> <233dfa1d0801230546g6ef61d83lfc499b92fbbb9ba@mail.gmail.com> Message-ID: <233dfa1d0801230718w3f5bb770g9c7c67a3b72922ba@mail.gmail.com> Slide, doesn't work: I get. Unhandled Exception: IronPython.Runtime.Exceptions.ArgumentTypeException: NoneType object is not callable I passed as IPerson and I even casted to IPerson in IPY. The script: print IPerson(Env).Name produces NoneType object is not callable exception and the script print Env.Name produces Unhandled Exception: System.MissingMemberException: 'Person' object has no attribute 'Name' Is there anything else I could try? It seems weird that explicitly defined interfaces are not callable. There are probably some even in .NET fx.. I even tried: IPerson pers = new Person() as IPerson; locals["Env"] = pers as IPerson; still no go. Funny thing is, that dir(IPerson) lists the "Name" attribute (property): ['Name', '__class__', '__doc__', '__init__', '__module__', '__repr__'] Miha On Jan 23, 2008 3:55 PM, Slide wrote: > On Jan 23, 2008 6:46 AM, Miha Valencic wrote: > > Slide, thanks for a quick response. My answers are inline: > Person p = new Person(); > locals["Env"] = p as IPerson; > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rpigneri at LavaStorm.com Wed Jan 23 16:28:39 2008 From: rpigneri at LavaStorm.com (Pigneri, Rocco) Date: Wed, 23 Jan 2008 10:28:39 -0500 Subject: [IronPython] Is it possible to create assemblies from Ironpythonscript? In-Reply-To: <47973A99.9010205@zeomega.com> References: <47973A99.9010205@zeomega.com> Message-ID: Dear Raju, I know that you can create executable assemblies using the -X:SaveAssemblies option on ipy.exe. I have seen IronPython Studio create assembly DLL's, but I am not sure how to do that by hand. They could even just be renamed executable assemblies for all I know. Let me give you a quick warning about the -X:SaveAssemblies option: it doesn't produce types in the same way as C# or another language. It looks like all the types are emitted at runtime rather than compiled at compile time. This makes calling into IPY from a static language at compile time impossible--at least, the IL that it produces doesn't define types like a C# assembly would. Hope that helps, Rocco -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Raju Sivalingam Sent: Wednesday, January 23, 2008 8:01 AM To: Discussion of IronPython Subject: [IronPython] Is it possible to create assemblies from Ironpythonscript? Hi, Can i create assemblies from ironpython? How? thanks Raju _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From slide.o.mix at gmail.com Wed Jan 23 16:42:24 2008 From: slide.o.mix at gmail.com (Slide) Date: Wed, 23 Jan 2008 08:42:24 -0700 Subject: [IronPython] IronPython and polymorphism? Help with interfaces In-Reply-To: <233dfa1d0801230718w3f5bb770g9c7c67a3b72922ba@mail.gmail.com> References: <233dfa1d0801230311q78c6ec9cj631b38d0aa2b47fd@mail.gmail.com> <233dfa1d0801230546g6ef61d83lfc499b92fbbb9ba@mail.gmail.com> <233dfa1d0801230718w3f5bb770g9c7c67a3b72922ba@mail.gmail.com> Message-ID: On Jan 23, 2008 8:18 AM, Miha Valencic wrote: > Slide, doesn't work: > I get. Unhandled Exception: > IronPython.Runtime.Exceptions.ArgumentTypeException: NoneType object is not > callable > > I passed as IPerson and I even casted to IPerson in IPY. > The script: > print IPerson(Env).Name > produces NoneType object is not callable exception and the script > print Env.Name > produces Unhandled Exception: System.MissingMemberException: 'Person' object > has no attribute 'Name' > > Is there anything else I could try? It seems weird that explicitly defined > interfaces are not callable. There are probably some even in .NET fx.. I > even tried: > IPerson pers = new Person() as IPerson; > locals["Env"] = pers as IPerson; > still no go. > > Funny thing is, that dir(IPerson) lists the "Name" attribute (property): > ['Name', '__class__', '__doc__', '__init__', '__module__', '__repr__'] > > Miha > > > On Jan 23, 2008 3:55 PM, Slide wrote: > > > > > > > > > > On Jan 23, 2008 6:46 AM, Miha Valencic wrote: > > > Slide, thanks for a quick response. My answers are inline: > > > > Person p = new Person(); > > locals["Env"] = p as IPerson; > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > I don't have a working IP 1.1 installation right now (I've been playing with 2.0 A7). I'll install 1.1 and give your code a try. slide -- slide-o-blog http://slide-o-blog.blogspot.com/ From slide.o.mix at gmail.com Wed Jan 23 17:55:14 2008 From: slide.o.mix at gmail.com (Slide) Date: Wed, 23 Jan 2008 09:55:14 -0700 Subject: [IronPython] IronPython and polymorphism? Help with interfaces In-Reply-To: References: <233dfa1d0801230311q78c6ec9cj631b38d0aa2b47fd@mail.gmail.com> <233dfa1d0801230546g6ef61d83lfc499b92fbbb9ba@mail.gmail.com> <233dfa1d0801230718w3f5bb770g9c7c67a3b72922ba@mail.gmail.com> Message-ID: I tried your code and a few tricks, I couldn't get it working either. I'd file a bug if I were you. slide From haiboluo at exchange.microsoft.com Wed Jan 23 18:00:29 2008 From: haiboluo at exchange.microsoft.com (Haibo Luo) Date: Wed, 23 Jan 2008 09:00:29 -0800 Subject: [IronPython] IronPython and polymorphism? Help with interfaces In-Reply-To: <233dfa1d0801230311q78c6ec9cj631b38d0aa2b47fd@mail.gmail.com> References: <233dfa1d0801230311q78c6ec9cj631b38d0aa2b47fd@mail.gmail.com> Message-ID: Expect IPerson.Name.GetValue(person_object) to work (and IPerson.Name.__get__) From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Miha Valencic Sent: Wednesday, January 23, 2008 3:12 AM To: users at lists.ironpython.com Subject: [IronPython] IronPython and polymorphism? Help with interfaces Hi! I'm having troubles accessing .NET object properties from ipy. Object is passed to IronPython 1.1 and IronPython breaks with error: Unhandled Exception: System.MissingMemberException: 'Person' object has no attribute 'Name' This is all due to the fact, that this object is based on an interface, which is based on an interface. To make things clearer I've created a simple problem-statement program, which demonstrates the behavior. Problem: IronPython can NOT access class members of an explicitly implemented interface. The program that exhibits this is below, and also on http://www.mihavalencic.com/temp/Program.txt (for easier reading). Just compile it with IronPython.dll and it will break where it shouldn't (IMHO). I was searching information on how could I explicitly cast this object to IPerson (in the example), but could not find anyhing -- Python as a language apparently does not support interfaces. Ideas, suggestions are very welcome! update: I even tried something like this: person_explicit = IPerson("Wrapped.person); print person_explicit.Name; but I alwyas get the same error: Either the object does not have Name property or that NoneType is not callable. Thanks, Miha. The progarm: using System; using IronPython.Hosting; using IronPython.Modules; using System.Collections.Generic; namespace ProblemStatement { public interface IPerson { string Name {get;set;} } public class Person : IPerson { string IPerson.Name { get { return "Default name"; } set { } } } public class Wrapper { public IPerson person; public Wrapper(IPerson personIn) { person = personIn; } } class Program { static void Main(string[] args) { PythonEngine eng = new PythonEngine(); EngineModule mod = eng.CreateModule(); ClrModule clr = eng.Import("clr") as ClrModule; clr.AddReferenceByPartialName("ProblemStatement"); Dictionary locals = new Dictionary(); locals["Env"] = new Person(); Wrapper wrapped = new Wrapper(new Person()); locals["Wrapped"] = wrapped; // this works Console.WriteLine(wrapped.person.Name); // this breaks eng.Execute("print Env.Name", mod, locals); // this breaks as well eng.Execute("print Wrapped.person.Name"); } } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jan 23 18:28:53 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 23 Jan 2008 09:28:53 -0800 Subject: [IronPython] WinForms UserComponent binding a IronPythonConsole In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227010FC838B2A1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Generally speaking you want to do 2 things: 1. Wire up std out / std err to a stream you can send to your window. You can do this via PythonEngine.SetStandardOutput/PythonEngine.SetStandardInput. You could also wire up std-in but that'll be less important (it's only going to matter if someone calls something like raw_input). 2. When you get input from the user call PythonEngine.ExecuteToConsole("input") Between those two you should have your console up and running. The IConsole interface is actually just used by the command line implementation and isn't part of the hosting APIs. That's why you're not finding it anywhere on the engine - the linked blog came before IronPython 1.0. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jon Cooper Sent: Wednesday, January 23, 2008 5:02 AM To: users at lists.ironpython.com Subject: [IronPython] WinForms UserComponent binding a IronPythonConsole Hello, I've been enjoying using IronPython. I'm now going to embed it in my C# WinForms application to provide a way for users to perform simple ad-hoc scripting. Unfortunately this has been less easy than I thought it would be! I've built a subclass of TextBox that I can use to display and input the text coming to/from my user. Now I just need to connect it to a PythonEngine. In the article at http://blogs.msdn.com/jmstall/archive/2005/09/01/Howto_embed_ironpython.aspx, one gets the impression that a PythonEngine has a MyConsole property where one can connect an IConsole. Perfect! Unfortunately, that's not the case on my 1.1 build. Digging through the source I find that this stuff exists on IronPythonConsole, but that class appears to be designed for use statically. Before I go to the trouble of ripping apart IronPythonConsole and likely reinventing the wheel, is there something I'm missing here? Thanks, jon ________________________________ Arrowgrass Capital Partners (US) LP is a limited partnership registered in the State of Delaware. This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any transmission errors. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jon.Cooper at arrowgrass.com Wed Jan 23 20:24:29 2008 From: Jon.Cooper at arrowgrass.com (Jon Cooper) Date: Wed, 23 Jan 2008 19:24:29 +0000 Subject: [IronPython] WinForms UserComponent binding a IronPythonConsole In-Reply-To: <7AD436E4270DD54A94238001769C2227010FC838B2A1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227010FC838B2A1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Thanks. I apologize for this followup, as it's not really a question about IronPython, but on the off chance someone else has dealt with this issue I post it here. I've PythonEngine.SetStandardOutput to an instance of a MemoryStream, and then created a StreamReader off of that MemoryStream. When I execute Python code with ExecuteToConsole, I get output in my MemoryStream (I can see it by looking in the buffer in the debugger), but my StreamReader doesn't believe it has data from the MemoryStream (StreamReader.EndOfStream = true, Peek() returns nothing, etc). Is this some kind of flushing issue? Any help would be fantastic. I'm nearly there! From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: 23 January 2008 17:29 To: Discussion of IronPython Subject: Re: [IronPython] WinForms UserComponent binding a IronPythonConsole Generally speaking you want to do 2 things: 1. Wire up std out / std err to a stream you can send to your window. You can do this via PythonEngine.SetStandardOutput/PythonEngine.SetStandardInput. You could also wire up std-in but that'll be less important (it's only going to matter if someone calls something like raw_input). 2. When you get input from the user call PythonEngine.ExecuteToConsole("input") Between those two you should have your console up and running. The IConsole interface is actually just used by the command line implementation and isn't part of the hosting APIs. That's why you're not finding it anywhere on the engine - the linked blog came before IronPython 1.0. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jon Cooper Sent: Wednesday, January 23, 2008 5:02 AM To: users at lists.ironpython.com Subject: [IronPython] WinForms UserComponent binding a IronPythonConsole Hello, I've been enjoying using IronPython. I'm now going to embed it in my C# WinForms application to provide a way for users to perform simple ad-hoc scripting. Unfortunately this has been less easy than I thought it would be! I've built a subclass of TextBox that I can use to display and input the text coming to/from my user. Now I just need to connect it to a PythonEngine. In the article at http://blogs.msdn.com/jmstall/archive/2005/09/01/Howto_embed_ironpython.aspx, one gets the impression that a PythonEngine has a MyConsole property where one can connect an IConsole. Perfect! Unfortunately, that's not the case on my 1.1 build. Digging through the source I find that this stuff exists on IronPythonConsole, but that class appears to be designed for use statically. Before I go to the trouble of ripping apart IronPythonConsole and likely reinventing the wheel, is there something I'm missing here? Thanks, jon ________________________________ Arrowgrass Capital Partners (US) LP is a limited partnership registered in the State of Delaware. This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any transmission errors. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. ________________________________ Arrowgrass Capital Partners (US) LP is a limited partnership registered in the State of Delaware. This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any transmission errors. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jon.Cooper at arrowgrass.com Wed Jan 23 20:43:15 2008 From: Jon.Cooper at arrowgrass.com (Jon Cooper) Date: Wed, 23 Jan 2008 19:43:15 +0000 Subject: [IronPython] WinForms UserComponent binding a IronPythonConsole In-Reply-To: References: <7AD436E4270DD54A94238001769C2227010FC838B2A1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: Aha. I've answered my own question. One needs to set the output stream's position to the beginning of the stream, i.e.: public String handleInput(String inputLine) { // execute python.ExecuteToConsole(inputLine + Environment.NewLine); pythonOutputStream.Position = 0; String returnValue = pythonReader.ReadToEnd(); return returnValue; } From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jon Cooper Sent: 23 January 2008 19:24 To: Discussion of IronPython Subject: Re: [IronPython] WinForms UserComponent binding a IronPythonConsole Thanks. I apologize for this followup, as it's not really a question about IronPython, but on the off chance someone else has dealt with this issue I post it here. I've PythonEngine.SetStandardOutput to an instance of a MemoryStream, and then created a StreamReader off of that MemoryStream. When I execute Python code with ExecuteToConsole, I get output in my MemoryStream (I can see it by looking in the buffer in the debugger), but my StreamReader doesn't believe it has data from the MemoryStream (StreamReader.EndOfStream = true, Peek() returns nothing, etc). Is this some kind of flushing issue? Any help would be fantastic. I'm nearly there! From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: 23 January 2008 17:29 To: Discussion of IronPython Subject: Re: [IronPython] WinForms UserComponent binding a IronPythonConsole Generally speaking you want to do 2 things: 1. Wire up std out / std err to a stream you can send to your window. You can do this via PythonEngine.SetStandardOutput/PythonEngine.SetStandardInput. You could also wire up std-in but that'll be less important (it's only going to matter if someone calls something like raw_input). 2. When you get input from the user call PythonEngine.ExecuteToConsole("input") Between those two you should have your console up and running. The IConsole interface is actually just used by the command line implementation and isn't part of the hosting APIs. That's why you're not finding it anywhere on the engine - the linked blog came before IronPython 1.0. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jon Cooper Sent: Wednesday, January 23, 2008 5:02 AM To: users at lists.ironpython.com Subject: [IronPython] WinForms UserComponent binding a IronPythonConsole Hello, I've been enjoying using IronPython. I'm now going to embed it in my C# WinForms application to provide a way for users to perform simple ad-hoc scripting. Unfortunately this has been less easy than I thought it would be! I've built a subclass of TextBox that I can use to display and input the text coming to/from my user. Now I just need to connect it to a PythonEngine. In the article at http://blogs.msdn.com/jmstall/archive/2005/09/01/Howto_embed_ironpython.aspx, one gets the impression that a PythonEngine has a MyConsole property where one can connect an IConsole. Perfect! Unfortunately, that's not the case on my 1.1 build. Digging through the source I find that this stuff exists on IronPythonConsole, but that class appears to be designed for use statically. Before I go to the trouble of ripping apart IronPythonConsole and likely reinventing the wheel, is there something I'm missing here? Thanks, jon ________________________________ Arrowgrass Capital Partners (US) LP is a limited partnership registered in the State of Delaware. This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any transmission errors. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. ________________________________ Arrowgrass Capital Partners (US) LP is a limited partnership registered in the State of Delaware. This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any transmission errors. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. ________________________________ Arrowgrass Capital Partners (US) LP is a limited partnership registered in the State of Delaware. This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any transmission errors. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. -------------- next part -------------- An HTML attachment was scrubbed... URL: From miha.valencic at gmail.com Wed Jan 23 21:18:05 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Wed, 23 Jan 2008 21:18:05 +0100 Subject: [IronPython] IronPython and polymorphism? Help with interfaces In-Reply-To: References: <233dfa1d0801230311q78c6ec9cj631b38d0aa2b47fd@mail.gmail.com> Message-ID: <233dfa1d0801231218s4fe113dfx47d5c7c9d3e09b91@mail.gmail.com> Thanks for help, everybody! Both methods work: print IPerson.Name.GetValue(Env); print IPerson.Name.__get__(Env, None); The downside of this approach is that one has to import the interface in question into Python explicitly. Is this a bug or a feature? (meaning that Env.Name does not work and IPerson.Name.__get__(Env, None) works) Thanks, Miha. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jan 23 21:21:21 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 23 Jan 2008 12:21:21 -0800 Subject: [IronPython] IronPython and polymorphism? Help with interfaces In-Reply-To: <233dfa1d0801231218s4fe113dfx47d5c7c9d3e09b91@mail.gmail.com> References: <233dfa1d0801230311q78c6ec9cj631b38d0aa2b47fd@mail.gmail.com> <233dfa1d0801231218s4fe113dfx47d5c7c9d3e09b91@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227010FC838B37F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> It's a feature, explicit interfaces require an explicit call :). From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Miha Valencic Sent: Wednesday, January 23, 2008 12:18 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython and polymorphism? Help with interfaces Thanks for help, everybody! Both methods work: print IPerson.Name.GetValue(Env); print IPerson.Name.__get__(Env, None); The downside of this approach is that one has to import the interface in question into Python explicitly. Is this a bug or a feature? (meaning that Env.Name does not work and IPerson.Name.__get__(Env, None) works) Thanks, Miha. -------------- next part -------------- An HTML attachment was scrubbed... URL: From miha.valencic at gmail.com Wed Jan 23 21:28:13 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Wed, 23 Jan 2008 21:28:13 +0100 Subject: [IronPython] IronPython and polymorphism? Help with interfaces In-Reply-To: <7AD436E4270DD54A94238001769C2227010FC838B37F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <233dfa1d0801230311q78c6ec9cj631b38d0aa2b47fd@mail.gmail.com> <233dfa1d0801231218s4fe113dfx47d5c7c9d3e09b91@mail.gmail.com> <7AD436E4270DD54A94238001769C2227010FC838B37F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <233dfa1d0801231228uf0c61a8h1b1491052b8744ec@mail.gmail.com> Thanks for the explanation. The docs could/should mention that... :) I guess we're not used, because it works in C#, so it should double-work in Ipy. You know, inferred types and all... :)) rgds, Miha. On Jan 23, 2008 9:21 PM, Dino Viehland wrote: > It's a feature, explicit interfaces require an explicit call J. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Wed Jan 23 21:35:41 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 23 Jan 2008 12:35:41 -0800 Subject: [IronPython] IronPython and polymorphism? Help with interfaces In-Reply-To: <233dfa1d0801231228uf0c61a8h1b1491052b8744ec@mail.gmail.com> References: <233dfa1d0801230311q78c6ec9cj631b38d0aa2b47fd@mail.gmail.com> <233dfa1d0801231218s4fe113dfx47d5c7c9d3e09b91@mail.gmail.com> <7AD436E4270DD54A94238001769C2227010FC838B37F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <233dfa1d0801231228uf0c61a8h1b1491052b8744ec@mail.gmail.com> Message-ID: <7AD436E4270DD54A94238001769C2227010FC838B387@DF-GRTDANE-MSG.exchange.corp.microsoft.com> I agree, we should document it, unfortunately our documentation is still woefully inadequate :(. Maybe someone could add it to the IronPython cookbook page in the mean time? (http://www.ironpython.info/index.php/Main_Page). But as for it "working in C#"... Consider the code: using System; public class Foo : ICloneable { public object Bar() { return Clone(); } object ICloneable.Clone() { return null; } } That code doesn't compile because you must be explicit to access the Icloneable method. This compiles: using System; public class Foo : ICloneable { public object Bar() { return ((ICloneable)this).Clone(); } object ICloneable.Clone() { return null; } } As does: using System; public class Foo : ICloneable { public object Bar() { ICloneable x = this; return x.Clone(); } object ICloneable.Clone() { return null; } } But you must explicitly refer to the type somewhere. Unfortunately we don't have type information at compile time so the only way to refer to the type is at runtime by getting the method from the interface. But in either case both languages are requiring you to be explicit about your choice of method. So conceptually I think we're fairly similar. From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Miha Valencic Sent: Wednesday, January 23, 2008 12:28 PM To: Discussion of IronPython Subject: Re: [IronPython] IronPython and polymorphism? Help with interfaces Thanks for the explanation. The docs could/should mention that... :) I guess we're not used, because it works in C#, so it should double-work in Ipy. You know, inferred types and all... :)) rgds, Miha. On Jan 23, 2008 9:21 PM, Dino Viehland > wrote: It's a feature, explicit interfaces require an explicit call :) . -------------- next part -------------- An HTML attachment was scrubbed... URL: From miha.valencic at gmail.com Wed Jan 23 22:06:45 2008 From: miha.valencic at gmail.com (Miha Valencic) Date: Wed, 23 Jan 2008 22:06:45 +0100 Subject: [IronPython] IronPython and polymorphism? Help with interfaces In-Reply-To: <7AD436E4270DD54A94238001769C2227010FC838B387@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <233dfa1d0801230311q78c6ec9cj631b38d0aa2b47fd@mail.gmail.com> <233dfa1d0801231218s4fe113dfx47d5c7c9d3e09b91@mail.gmail.com> <7AD436E4270DD54A94238001769C2227010FC838B37F@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <233dfa1d0801231228uf0c61a8h1b1491052b8744ec@mail.gmail.com> <7AD436E4270DD54A94238001769C2227010FC838B387@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <233dfa1d0801231306q9ea48a4j629f2f61c8954315@mail.gmail.com> Dino, thanks for the informative answer with samples. I agree with what you write, but that was not what I had in mind. Consider this c# code: IPerson foo = new Person(); foo.Name; // works in c#, because foo is of type IPerson. in ipy, I can not explicitly define an Interface type like foo = IPerson(Person()) And even if I pass the IPerson to ipy, ipy will "see" the first implementation, not the type I am passing. So, If I have something like this: locals["foo"] = foo;, where foo is defined as: IFoo1 foo = new Foo() as IFoo1; where Foo: BaseFoo, IFoo1, IFoo2 and BaseFoo is defined as BaseFoo : IFoo1, IFoo2 and IFoo1 { string Name {get;set;}} then Python will "see" the object passed in as BaseFoo, as this is the only implementation (although we want to pass in the "contract", interface IFoo1). I know it looks complicated... In short: If I pass ISomething to c#, I can call it. If I pass ISomething to ipy, it "knows better" and treats it as BaseSomething or whatever the first class is. ;) Maybe a strong-typed method of passing in the locals/globals would help. Something like anonymous types, perhaps? IMyInteface myInterface = .... engine.Execute("print foo.Name", eng.CreateModule(), new { foo = myInterface }); Miha On Jan 23, 2008 9:35 PM, Dino Viehland wrote: > I agree, we should document it, unfortunately our documentation is still > woefully inadequate L. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Thu Jan 24 05:47:06 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 24 Jan 2008 13:47:06 +0900 Subject: [IronPython] dictproxy.get Message-ID: <5b0248170801232047p5a51277dhfbd30a4d89d63d1e@mail.gmail.com> IronPython 2 reports: AttributeError: 'dictproxy' object has no attribute 'get' Note: works fine on IronPython 1. class Singleton(object): def __new__(cls): obj = Singleton.__dict__.get(cls.__name__) if obj is None: obj = object() setattr(Singleton, cls.__name__, obj) return obj class X(Singleton): pass a = X() b = X() c = Singleton.X assert a is b assert a is c -- Seo Sanghyeon From sanxiyn at gmail.com Thu Jan 24 05:51:27 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Thu, 24 Jan 2008 13:51:27 +0900 Subject: [IronPython] dictproxy.get In-Reply-To: <5b0248170801232047p5a51277dhfbd30a4d89d63d1e@mail.gmail.com> References: <5b0248170801232047p5a51277dhfbd30a4d89d63d1e@mail.gmail.com> Message-ID: <5b0248170801232051q2bec6898r4e124f4ab1c78042@mail.gmail.com> 2008/1/24, Sanghyeon Seo : > IronPython 2 reports: AttributeError: 'dictproxy' object has no attribute 'get' > Note: works fine on IronPython 1. Here is a simple and working fix. https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/patches/2.0a7/patch-dictproxy -- Seo Sanghyeon From rpigneri at LavaStorm.com Fri Jan 25 18:36:29 2008 From: rpigneri at LavaStorm.com (Pigneri, Rocco) Date: Fri, 25 Jan 2008 12:36:29 -0500 Subject: [IronPython] [IronPythonStudio] Namespace Classes and Assembly Files Message-ID: Dear all, I am new to Python, IronPython, and IronPythonStudio, but so far I am enjoying the functionality that IPS offers me. One thing that confuses me, however, is the namespace classes that IPS creates for me. Let's say I create a Windows Forms project called Forms with a default form called FormOne. FormOne is created in the Forms namespace while the Program.py file is placed in the Forms0 namespace. I next add a new Form to the project by right-clicking on the project name in the Solution Explorer, and go to Add->New Item->Windows Form. I call this class FormTwo. FormTwo is now placed in the Forms namespace as well. If I try to use the FormTwo class in the Program.py file (i.e. I would rather start up with FormTwo rather than FormOne), Forms.FormTwo() does not do the trick. The debugger keeps reporting that the class is not found. This also happens if I add "from FormTwo import *" to the top of the file. What am I doing wrong here? I feel like I should be able to reference any class in an assembly/project from any class in the same assembly/project. I have been able to get this to work by changing the namespace class in FormTwo.py, but I feel like that is the wrong approach. Thank you, Rocco -------------- next part -------------- An HTML attachment was scrubbed... URL: From sanxiyn at gmail.com Sat Jan 26 08:12:04 2008 From: sanxiyn at gmail.com (Sanghyeon Seo) Date: Sat, 26 Jan 2008 16:12:04 +0900 Subject: [IronPython] Tracing imports Message-ID: <5b0248170801252312h1c3cb1e1yf25bde9d48ff5349@mail.gmail.com> This patch implements import tracing enabled by -v option to Python. https://fepy.svn.sourceforge.net/svnroot/fepy/trunk/patches/2.0a7/patch-option-v Very simplistic but enough to be useful. -- Seo Sanghyeon From fuzzyman at voidspace.org.uk Sat Jan 26 18:20:08 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 26 Jan 2008 17:20:08 +0000 Subject: [IronPython] [python] [IronPythonStudio] Namespace Classes and Assembly Files In-Reply-To: References: Message-ID: <479B6BC8.3020106@voidspace.org.uk> Pigneri, Rocco wrote: > Dear all, > > I am new to Python, IronPython, and IronPythonStudio, but so far I am > enjoying the functionality that IPS offers me. > > One thing that confuses me, however, is the namespace classes that IPS > creates for me. Let's say I create a Windows Forms project called > Forms with a default form called FormOne. FormOne is created in the > Forms namespace while the Program.py file is placed in the Forms0 > namespace. This is annoying (unpythonic) but is probably due to the way the CodeDom works - it basically creates the equivalent IronPython to the C# it would generate. > > I next add a new Form to the project by right-clicking on the project > name in the Solution Explorer, and go to Add->New Item->Windows Form. > I call this class FormTwo. FormTwo is now placed in the Forms > namespace as well. > > If I try to use the FormTwo class in the Program.py file (i.e. I would > rather start up with FormTwo rather than FormOne), Forms.FormTwo() > does not do the trick. The debugger keeps reporting that the class is > not found. This also happens if I add "from FormTwo import *" to the > top of the file. > > What am I doing wrong here? I feel like I should be able to reference > any class in an assembly/project from any class in the same > assembly/project. I have been able to get this to work by changing > the namespace class in FormTwo.py, but I feel like that is the wrong > approach. Can you post the actual error you get? The import and reference you posted should work, so the exact error will tell us what is going wrong. Michael Foord http://www.manning.com/foord > > Thank you, > > Rocco > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > From fuzzyman at voidspace.org.uk Sat Jan 26 19:44:21 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 26 Jan 2008 18:44:21 +0000 Subject: [IronPython] [python] Re: IronPython & Silverlight In-Reply-To: <39659798@lorax.Dartmouth.ORG> References: <39659798@lorax.Dartmouth.ORG> Message-ID: <479B7F85.6070500@voidspace.org.uk> Craig S. Perler 04 wrote: > Hi Jimmy, > > You're correct, I'm trying to host IronPython in an > existing C# SL app and I would like to use the .NET > libraries from IronPython. I hadn't realized or noticed, > however, that the dlls shipped with SL are not the same as > those available for production use from IronPython > directly. My app references IronPython.dll version > 2.0.0.0, runtime version 2.0.50727, file version > 1.1.20625.0. Is there a more appropriate and still SL > compatible version to use? > > What is the reason not to use the version of IronPython that ships with Silverlight? To use any other you will have to compile from source, targeting Silverlight. This should work though - you shouldn't just drop in DLLs that weren't compiled for Silverlight. What you are aiming to do seems straightforward enough. Michael > That aside, the IronPython-relevant aspect of my app is > straightforward: grab a string from a textbox, pass it via > JavaScript to SL, and then attempt to execute it via > IronPython. > > The C# method that handles this process is below. It > takes the string from JavaScript, and then executes it as > Python code. For the sake of debugging at first at least, > it then assumes that a function "func" was defined, as > that's then evaluated. > > [Scriptable] > public void Execute(string script) > { > try > { > PythonEngine engine = > PythonEngine.CurrentEngine; > engine.Execute(script); > object result = engine.Evaluate("func()"); > > if (result != null) > { > Debug.WriteLine(result); > } > } > catch (Exception e) > { > Debug.WriteLine(e); > } > } > > Prior to any execution as per above, I initialize PAL > exactly as described here: > [http://www.voidspace.org.uk/ironpython/silverlight/embeddi > ng_ironpython.shtml]. > > Thoughts on what I'm doing wrong? > > Thanks again, > > -Craig > > ---Discussion of IronPython > wrote --- > >> Craig S. Perler wrote: >> >> I'm having problems accessing .NET libraries from >> IronPython hosted within a Silverlight application and >> have hit a wall. If you have any advice, I'd be most >> appreciative! >> > > The work around for hosting IronPython in Silverlight 1.1 > is a little messy, since the DLR should take care of this > and not require the user's app to override the PAL. We are > revisiting this for the next release of Silverlight to > make it work well. > > I assume you'd like to host IronPython in an existing C# > SL app? If you can do without C# code, and without the > bleeding edge IronPython version ... you could just use > the IronPython version shipped in Silverlight. There are > samples on silverlight.net if you'd like examples on how > to do it. > > >> To describe my setup... I'm first initializing the >> PlatformAdaptationLayer with the details described here >> >> > [http://www.voidspace.org.uk/ironpython/silverlight/embeddi > >> ng_ironpython.shtml]. I'm not certain what exactly that >> does, but it seems clear that no amount of fiddling >> > around > >> in IronPython works without detailing the >> ScriptEnvironmentSetup. With that in place, I see a bit >> > of > >> progress: I can execute the script "def func():\r\n >> return 'in Func()'" and then retrieve the result by >> evaluating the script "func()". >> >> I've tried a variety of combinations to gain access to >> System.DateTime from the Python script, but they all end >> up with an error like the one below. Additionally, this >> error is also similar to the one I receive when >> > attempting > >> to call PythonEngine.ExecuteFile(string path), which I >> have thus far been unable to get to work. >> > > Can you send me the source or a smaller repro of the > issue? Michael, did you run into any of these issues? > > ~Jimmy > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users- > ironpython.com > --- End of quote --- > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > > > From Craig.S.Perler.04 at Alum.Dartmouth.ORG Sat Jan 26 20:54:56 2008 From: Craig.S.Perler.04 at Alum.Dartmouth.ORG (Craig S. Perler 04) Date: 26 Jan 2008 14:54:56 -0500 Subject: [IronPython] [python] Re: IronPython & Silverlight Message-ID: <39795814@lorax.Dartmouth.ORG> The DLLs I'm currently referencing and experiencing problems with are the ones that downloaded with Silverlight 1.1... ---Discussion of IronPython wrote --- Craig S. Perler 04 wrote: > Hi Jimmy, > > You're correct, I'm trying to host IronPython in an > existing C# SL app and I would like to use the .NET > libraries from IronPython. I hadn't realized or noticed, > however, that the dlls shipped with SL are not the same as > those available for production use from IronPython > directly. My app references IronPython.dll version > 2.0.0.0, runtime version 2.0.50727, file version > 1.1.20625.0. Is there a more appropriate and still SL > compatible version to use? > > What is the reason not to use the version of IronPython that ships with Silverlight? To use any other you will have to compile from source, targeting Silverlight. This should work though - you shouldn't just drop in DLLs that weren't compiled for Silverlight. What you are aiming to do seems straightforward enough. Michael > That aside, the IronPython-relevant aspect of my app is > straightforward: grab a string from a textbox, pass it via > JavaScript to SL, and then attempt to execute it via > IronPython. > > The C# method that handles this process is below. It > takes the string from JavaScript, and then executes it as > Python code. For the sake of debugging at first at least, > it then assumes that a function "func" was defined, as > that's then evaluated. > > [Scriptable] > public void Execute(string script) > { > try > { > PythonEngine engine = > PythonEngine.CurrentEngine; > engine.Execute(script); > object result = engine.Evaluate("func()"); > > if (result != null) > { > Debug.WriteLine(result); > } > } > catch (Exception e) > { > Debug.WriteLine(e); > } > } > > Prior to any execution as per above, I initialize PAL > exactly as described here: > [http://www.voidspace.org.uk/ironpython/silverlight/embeddi > ng_ironpython.shtml]. > > Thoughts on what I'm doing wrong? > > Thanks again, > > -Craig > > ---Discussion of IronPython > wrote --- > >> Craig S. Perler wrote: >> >> I'm having problems accessing .NET libraries from >> IronPython hosted within a Silverlight application and >> have hit a wall. If you have any advice, I'd be most >> appreciative! >> > > The work around for hosting IronPython in Silverlight 1.1 > is a little messy, since the DLR should take care of this > and not require the user's app to override the PAL. We are > revisiting this for the next release of Silverlight to > make it work well. > > I assume you'd like to host IronPython in an existing C# > SL app? If you can do without C# code, and without the > bleeding edge IronPython version ... you could just use > the IronPython version shipped in Silverlight. There are > samples on silverlight.net if you'd like examples on how > to do it. > > >> To describe my setup... I'm first initializing the >> PlatformAdaptationLayer with the details described here >> >> > [http://www.voidspace.org.uk/ironpython/silverlight/embeddi > >> ng_ironpython.shtml]. I'm not certain what exactly that >> does, but it seems clear that no amount of fiddling >> > around > >> in IronPython works without detailing the >> ScriptEnvironmentSetup. With that in place, I see a bit >> > of > >> progress: I can execute the script "def func():\r\n >> return 'in Func()'" and then retrieve the result by >> evaluating the script "func()". >> >> I've tried a variety of combinations to gain access to >> System.DateTime from the Python script, but they all end >> up with an error like the one below. Additionally, this >> error is also similar to the one I receive when >> > attempting > >> to call PythonEngine.ExecuteFile(string path), which I >> have thus far been unable to get to work. >> > > Can you send me the source or a smaller repro of the > issue? Michael, did you run into any of these issues? > > ~Jimmy > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users- > ironpython.com > --- End of quote --- > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users- ironpython.com > > > _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users- ironpython.com --- End of quote --- From fuzzyman at voidspace.org.uk Sat Jan 26 21:00:57 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sat, 26 Jan 2008 20:00:57 +0000 Subject: [IronPython] [python] Re: IronPython & Silverlight In-Reply-To: <39795814@lorax.Dartmouth.ORG> References: <39795814@lorax.Dartmouth.ORG> Message-ID: <6f4025010801261200i3337ca26q1121040330df651e@mail.gmail.com> On 26 Jan 2008 14:54:56 -0500, Craig S. Perler 04 < Craig.S.Perler.04 at alum.dartmouth.org> wrote: > > The DLLs I'm currently referencing and experiencing > problems with are the ones that downloaded with > Silverlight 1.1... Ah - I misunderstood the discussion. I'll try compiling the code on my system and see what happens. Michael ---Discussion of IronPython > wrote --- > Craig S. Perler 04 wrote: > > Hi Jimmy, > > > > You're correct, I'm trying to host IronPython in an > > existing C# SL app and I would like to use the .NET > > libraries from IronPython. I hadn't realized or > noticed, > > however, that the dlls shipped with SL are not the same > as > > those available for production use from IronPython > > directly. My app references IronPython.dll version > > 2.0.0.0, runtime version 2.0.50727, file version > > 1.1.20625.0. Is there a more appropriate and still SL > > compatible version to use? > > > > > > What is the reason not to use the version of IronPython > that ships with > Silverlight? > > To use any other you will have to compile from source, > targeting > Silverlight. This should work though - you shouldn't just > drop in DLLs > that weren't compiled for Silverlight. > > What you are aiming to do seems straightforward enough. > > Michael > > > That aside, the IronPython-relevant aspect of my app is > > straightforward: grab a string from a textbox, pass it > via > > JavaScript to SL, and then attempt to execute it via > > IronPython. > > > > The C# method that handles this process is below. It > > takes the string from JavaScript, and then executes it > as > > Python code. For the sake of debugging at first at > least, > > it then assumes that a function "func" was defined, as > > that's then evaluated. > > > > [Scriptable] > > public void Execute(string script) > > { > > try > > { > > PythonEngine engine = > > PythonEngine.CurrentEngine; > > engine.Execute(script); > > object result = engine.Evaluate("func()"); > > > > if (result != null) > > { > > Debug.WriteLine(result); > > } > > } > > catch (Exception e) > > { > > Debug.WriteLine(e); > > } > > } > > > > Prior to any execution as per above, I initialize PAL > > exactly as described here: > > > [http://www.voidspace.org.uk/ironpython/silverlight/embeddi > > ng_ironpython.shtml]. > > > > Thoughts on what I'm doing wrong? > > > > Thanks again, > > > > -Craig > > > > ---Discussion of IronPython > > wrote --- > > > >> Craig S. Perler wrote: > >> > >> I'm having problems accessing .NET libraries from > >> IronPython hosted within a Silverlight application and > >> have hit a wall. If you have any advice, I'd be most > >> appreciative! > >> > > > > The work around for hosting IronPython in Silverlight > 1.1 > > is a little messy, since the DLR should take care of > this > > and not require the user's app to override the PAL. We > are > > revisiting this for the next release of Silverlight to > > make it work well. > > > > I assume you'd like to host IronPython in an existing C# > > SL app? If you can do without C# code, and without the > > bleeding edge IronPython version ... you could just use > > the IronPython version shipped in Silverlight. There are > > samples on silverlight.net if you'd like examples on how > > to do it. > > > > > >> To describe my setup... I'm first initializing the > >> PlatformAdaptationLayer with the details described here > >> > >> > > > [http://www.voidspace.org.uk/ironpython/silverlight/embeddi > > > >> ng_ironpython.shtml]. I'm not certain what exactly that > >> does, but it seems clear that no amount of fiddling > >> > > around > > > >> in IronPython works without detailing the > >> ScriptEnvironmentSetup. With that in place, I see a bit > >> > > of > > > >> progress: I can execute the script "def func():\r\n > >> return 'in Func()'" and then retrieve the result by > >> evaluating the script "func()". > >> > >> I've tried a variety of combinations to gain access to > >> System.DateTime from the Python script, but they all end > >> up with an error like the one below. Additionally, this > >> error is also similar to the one I receive when > >> > > attempting > > > >> to call PythonEngine.ExecuteFile(string path), which I > >> have thus far been unable to get to work. > >> > > > > Can you send me the source or a smaller repro of the > > issue? Michael, did you run into any of these issues? > > > > ~Jimmy > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users- > > ironpython.com > > --- End of quote --- > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users- > ironpython.com > > > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users- > ironpython.com > --- End of quote --- > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- http://www.manning.com/foord http://www.voidspace.org.uk http://www.ironpython.info -------------- next part -------------- An HTML attachment was scrubbed... URL: From Craig.S.Perler.04 at Alum.Dartmouth.ORG Sat Jan 26 22:02:39 2008 From: Craig.S.Perler.04 at Alum.Dartmouth.ORG (Craig S. Perler 04) Date: 26 Jan 2008 16:02:39 -0500 Subject: [IronPython] [python] Re: IronPython & Silverlight Message-ID: <39796744@lorax.Dartmouth.ORG> Ok. Thank you Michael. Please let me know if you need more information. ---Discussion of IronPython wrote --- On 26 Jan 2008 14:54:56 -0500, Craig S. Perler 04 < Craig.S.Perler.04 at alum.dartmouth.org> wrote: > > The DLLs I'm currently referencing and experiencing > problems with are the ones that downloaded with > Silverlight 1.1... Ah - I misunderstood the discussion. I'll try compiling the code on my system and see what happens. Michael ---Discussion of IronPython > wrote --- > Craig S. Perler 04 wrote: > > Hi Jimmy, > > > > You're correct, I'm trying to host IronPython in an > > existing C# SL app and I would like to use the .NET > > libraries from IronPython. I hadn't realized or > noticed, > > however, that the dlls shipped with SL are not the same > as > > those available for production use from IronPython > > directly. My app references IronPython.dll version > > 2.0.0.0, runtime version 2.0.50727, file version > > 1.1.20625.0. Is there a more appropriate and still SL > > compatible version to use? > > > > > > What is the reason not to use the version of IronPython > that ships with > Silverlight? > > To use any other you will have to compile from source, > targeting > Silverlight. This should work though - you shouldn't just > drop in DLLs > that weren't compiled for Silverlight. > > What you are aiming to do seems straightforward enough. > > Michael > > > That aside, the IronPython-relevant aspect of my app is > > straightforward: grab a string from a textbox, pass it > via > > JavaScript to SL, and then attempt to execute it via > > IronPython. > > > > The C# method that handles this process is below. It > > takes the string from JavaScript, and then executes it > as > > Python code. For the sake of debugging at first at > least, > > it then assumes that a function "func" was defined, as > > that's then evaluated. > > > > [Scriptable] > > public void Execute(string script) > > { > > try > > { > > PythonEngine engine = > > PythonEngine.CurrentEngine; > > engine.Execute(script); > > object result = engine.Evaluate("func()"); > > > > if (result != null) > > { > > Debug.WriteLine(result); > > } > > } > > catch (Exception e) > > { > > Debug.WriteLine(e); > > } > > } > > > > Prior to any execution as per above, I initialize PAL > > exactly as described here: > > > [http://www.voidspace.org.uk/ironpython/silverlight/embeddi > > ng_ironpython.shtml]. > > > > Thoughts on what I'm doing wrong? > > > > Thanks again, > > > > -Craig > > > > ---Discussion of IronPython > > wrote --- > > > >> Craig S. Perler wrote: > >> > >> I'm having problems accessing .NET libraries from > >> IronPython hosted within a Silverlight application and > >> have hit a wall. If you have any advice, I'd be most > >> appreciative! > >> > > > > The work around for hosting IronPython in Silverlight > 1.1 > > is a little messy, since the DLR should take care of > this > > and not require the user's app to override the PAL. We > are > > revisiting this for the next release of Silverlight to > > make it work well. > > > > I assume you'd like to host IronPython in an existing C# > > SL app? If you can do without C# code, and without the > > bleeding edge IronPython version ... you could just use > > the IronPython version shipped in Silverlight. There are > > samples on silverlight.net if you'd like examples on how > > to do it. > > > > > >> To describe my setup... I'm first initializing the > >> PlatformAdaptationLayer with the details described here > >> > >> > > > [http://www.voidspace.org.uk/ironpython/silverlight/embeddi > > > >> ng_ironpython.shtml]. I'm not certain what exactly that > >> does, but it seems clear that no amount of fiddling > >> > > around > > > >> in IronPython works without detailing the > >> ScriptEnvironmentSetup. With that in place, I see a bit > >> > > of > > > >> progress: I can execute the script "def func():\r\n > >> return 'in Func()'" and then retrieve the result by > >> evaluating the script "func()". > >> > >> I've tried a variety of combinations to gain access to > >> System.DateTime from the Python script, but they all end > >> up with an error like the one below. Additionally, this > >> error is also similar to the one I receive when > >> > > attempting > > > >> to call PythonEngine.ExecuteFile(string path), which I > >> have thus far been unable to get to work. > >> > > > > Can you send me the source or a smaller repro of the > > issue? Michael, did you run into any of these issues? > > > > ~Jimmy > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users- > > ironpython.com > > --- End of quote --- > > _______________________________________________ > > Users mailing list > > Users at lists.ironpython.com > > http://lists.ironpython.com/listinfo.cgi/users- > ironpython.com > > > > > > > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users- > ironpython.com > --- End of quote --- > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users- ironpython.com > -- http://www.manning.com/foord http://www.voidspace.org.uk http://www.ironpython.info _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users- ironpython.com --- End of quote --- From dfugate at microsoft.com Sun Jan 27 21:22:47 2008 From: dfugate at microsoft.com (Dave Fugate) Date: Sun, 27 Jan 2008 12:22:47 -0800 Subject: [IronPython] IronPython 1.1.1 In-Reply-To: <7AD436E4270DD54A94238001769C2227010FC838B92C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7346A825E148B049A9AD1D3ED46A2D911A48CA098F@NA-EXMSG-C106.redmond.corp.microsoft.com> <5F42453283142A448EB8AD5B34FCFC6D0115031BEBA1@DF-GRTDANE-MSG.exchange.corp.microsoft.com> <7346A825E148B049A9AD1D3ED46A2D911A48CA0A39@NA-EXMSG-C106.redmond.corp.microsoft.com> <7AD436E4270DD54A94238001769C2227010FC838B92C@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: <7346A825E148B049A9AD1D3ED46A2D911A48CA0B6A@NA-EXMSG-C106.redmond.corp.microsoft.com> Hello IronPython Community, It's been a couple of weeks since we released IronPython 1.1.1 RC1 and this build does not appear to have caused any new issues. As a result I'm pleased to announce the release of IronPython 1.1.1. IronPython v1.1.1 is a minor update in which we fixed the most requested CodePlex bugs and also a handful of trivial bugs. In total around twenty bugs have been resolved for 1.1.1. Additionally, an issue that was reported directly on the IronPython mailing list was fixed - testComparingClrObjects (see http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2008-January/006171.html for details). We'd like to thank everyone in the community for your bug reports and suggestions that helped make this a better release: Seo Sanghyeon. Pobrien, Giles Thomas, sdahlbac, grizlupo, Tony Djordjevski, ayarrow, Michael Foord, milind, Kristof Wagemans, and Jan Szumiec. You can download IronPython 1.1.1 from http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=IronPython&ReleaseId=5141. The IronPython Team Complete list of bug fixes: * 10825 Sockets and Standard Library Modules in IronPython * 5682 System.Single boolean ops w/ integer types broken * 7594 type._call_ always passes type(type) as 1st parameter * 6332 DataGridView doesn't support a list of Python class instances as its DataSource * 6489 Backslash on the interactive console causes syntax error * 8246 Bug in handling of keyword arguments for _call_ (resolver request) * 7987 Trivial: help(clr.AddReference) not helpful * 9262 not override _eq_ at derived float Title is required * 9807 When a .DLL exists we may improperly try to load it as a pre-compiled module when we should load it as a .NET DLL * 9453 += works differently on lists * 10474 Need to ignore null paths in sys.path * 11759 Zero-length regex split * 2206 with statement broken in commandline * 2248 Missing debug information for IL offset 0 of generated methods * 3529 Trivial: int._int_ does not exist * 6266 re.compile(...).match(...) does not permit certain integer pos/endpos keyword parameter values * 6271 re.compile(...).match(...).groupdict() broken WRT to unnamed groups * 6272 re.compile(...).match(...).endpos has an incorrect value * 6273 re.sub(..., "...\?...", ...) broken * 6275 re.match(..., ...).regs is nearly always incorrect -------------- next part -------------- An HTML attachment was scrubbed... URL: From vkhaskel at hotmail.com Sun Jan 27 21:30:15 2008 From: vkhaskel at hotmail.com (Vadim Khaskel) Date: Sun, 27 Jan 2008 20:30:15 +0000 Subject: [IronPython] comments in a code Message-ID: Hi All, I just wanted to share / ask how to fix with the following thing in IronPython Studio. It looks like comments - in a code have tendency to disappear after a next project building cycle. Please let me know if there is a fix for that. Thank you, Vadim _________________________________________________________________ Shed those extra pounds with MSN and The Biggest Loser! http://biggestloser.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at voidspace.org.uk Mon Jan 28 15:33:34 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 28 Jan 2008 14:33:34 +0000 Subject: [IronPython] New Project: Implementing .NET Libraries in Pure Python Message-ID: <479DE7BE.6050701@voidspace.org.uk> Hello all, I thought I would let you know about a new project I have started and will be hacking on as and when I have time: http://code.google.com/p/python-system/ python-system An implementation of the BCL and other .NET libraries in pure Python (for porting IronPython code to CPython). The main goal of this project is to allow Resolver One spreadsheets exported as code to run under CPython. I will implement the .NET classes needed for this, but this project should be helpful for anyone wanting to run IronPython code under CPython. Anyone who might find this useful is welcome to help of course. :-) Nothing there yet, but I hope to get a unit test framework checked in today so that I can start. I will be starting with partial implementations of Array, DateTime, Color, Point and friends (the 'low hanging fruit'). All the best, Michael Foord http://www.manning.com/foord From slide.o.mix at gmail.com Mon Jan 28 15:45:43 2008 From: slide.o.mix at gmail.com (Slide) Date: Mon, 28 Jan 2008 07:45:43 -0700 Subject: [IronPython] New Project: Implementing .NET Libraries in Pure Python In-Reply-To: <479DE7BE.6050701@voidspace.org.uk> References: <479DE7BE.6050701@voidspace.org.uk> Message-ID: I'm interested in helping. On Jan 28, 2008 7:33 AM, Michael Foord wrote: > Hello all, > > I thought I would let you know about a new project I have started and > will be hacking on as and when I have time: > > http://code.google.com/p/python-system/ > > python-system > > An implementation of the BCL and other .NET libraries in pure Python > (for porting IronPython code to CPython). > > The main goal of this project is to allow Resolver One spreadsheets > exported as code to run under CPython. I will implement the .NET classes > needed for this, but this project should be helpful for anyone wanting > to run IronPython code under CPython. > > Anyone who might find this useful is welcome to help of course. :-) > > Nothing there yet, but I hope to get a unit test framework checked in > today so that I can start. > > I will be starting with partial implementations of Array, DateTime, > Color, Point and friends (the 'low hanging fruit'). > > All the best, > > > Michael Foord > http://www.manning.com/foord > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > -- slide-o-blog http://slide-o-blog.blogspot.com/ From fuzzyman at voidspace.org.uk Mon Jan 28 15:49:33 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 28 Jan 2008 14:49:33 +0000 Subject: [IronPython] New Project: Implementing .NET Libraries in Pure Python In-Reply-To: References: <479DE7BE.6050701@voidspace.org.uk> Message-ID: <479DEB7D.2080102@voidspace.org.uk> Slide wrote: > I'm interested in helping. > Cool - I'm just working on getting the project layout and first tests done. From their adding new classes and tests should be very easy. I'll email you and we can discuss who will start on what. Michael http://www.manning.com/foord > On Jan 28, 2008 7:33 AM, Michael Foord wrote: > >> Hello all, >> >> I thought I would let you know about a new project I have started and >> will be hacking on as and when I have time: >> >> http://code.google.com/p/python-system/ >> >> python-system >> >> An implementation of the BCL and other .NET libraries in pure Python >> (for porting IronPython code to CPython). >> >> The main goal of this project is to allow Resolver One spreadsheets >> exported as code to run under CPython. I will implement the .NET classes >> needed for this, but this project should be helpful for anyone wanting >> to run IronPython code under CPython. >> >> Anyone who might find this useful is welcome to help of course. :-) >> >> Nothing there yet, but I hope to get a unit test framework checked in >> today so that I can start. >> >> I will be starting with partial implementations of Array, DateTime, >> Color, Point and friends (the 'low hanging fruit'). >> >> All the best, >> >> >> Michael Foord >> http://www.manning.com/foord >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > > From fuzzyman at voidspace.org.uk Mon Jan 28 16:00:42 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Mon, 28 Jan 2008 15:00:42 +0000 Subject: [IronPython] New Project: Implementing .NET Libraries in Pure Python In-Reply-To: <479DEB7D.2080102@voidspace.org.uk> References: <479DE7BE.6050701@voidspace.org.uk> <479DEB7D.2080102@voidspace.org.uk> Message-ID: <479DEE1A.4010603@voidspace.org.uk> Michael Foord wrote: > Slide wrote: > >> I'm interested in helping. >> >> > > Cool - I'm just working on getting the project layout and first tests > done. From their adding new classes and tests should be very easy. I'll > email you and we can discuss who will start on what. > Ok - Initial checkin of project layout and test framework done. I will probably start with 'Array' so that some 'real' work is done, and then email you to see what you are interested in Slide. Anyone else can now see the basic layout of the project and email me privately if they are interested. :-) Michael http://www.manning.com/foord > Michael > http://www.manning.com/foord > > >> On Jan 28, 2008 7:33 AM, Michael Foord wrote: >> >> >>> Hello all, >>> >>> I thought I would let you know about a new project I have started and >>> will be hacking on as and when I have time: >>> >>> http://code.google.com/p/python-system/ >>> >>> python-system >>> >>> An implementation of the BCL and other .NET libraries in pure Python >>> (for porting IronPython code to CPython). >>> >>> The main goal of this project is to allow Resolver One spreadsheets >>> exported as code to run under CPython. I will implement the .NET classes >>> needed for this, but this project should be helpful for anyone wanting >>> to run IronPython code under CPython. >>> >>> Anyone who might find this useful is welcome to help of course. :-) >>> >>> Nothing there yet, but I hope to get a unit test framework checked in >>> today so that I can start. >>> >>> I will be starting with partial implementations of Array, DateTime, >>> Color, Point and friends (the 'low hanging fruit'). >>> >>> All the best, >>> >>> >>> Michael Foord >>> http://www.manning.com/foord >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.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 rpigneri at LavaStorm.com Mon Jan 28 17:37:07 2008 From: rpigneri at LavaStorm.com (Pigneri, Rocco) Date: Mon, 28 Jan 2008 11:37:07 -0500 Subject: [IronPython] [python] [IronPythonStudio] Namespace Classes and Assembly Files In-Reply-To: <479B6BC8.3020106@voidspace.org.uk> References: <479B6BC8.3020106@voidspace.org.uk> Message-ID: Dear Michael, Well, I tried this out this morning, and I noticed that the plot has thickened. However, let me answer your question first: >> I next add a new Form to the project by right-clicking on the project >> name in the Solution Explorer, and go to Add->New Item->Windows Form. >> I call this class FormTwo. FormTwo is now placed in the Forms >> namespace as well. >> >> If I try to use the FormTwo class in the Program.py file (i.e. I would >> rather start up with FormTwo rather than FormOne), Forms.FormTwo() >> does not do the trick. The debugger keeps reporting that the class is >> not found. This also happens if I add "from FormTwo import *" to the >> top of the file. >> >> What am I doing wrong here? I feel like I should be able to reference >> any class in an assembly/project from any class in the same >> assembly/project. I have been able to get this to work by changing >> the namespace class in FormTwo.py, but I feel like that is the wrong >> approach. > >Can you post the actual error you get? The import and reference you posted should work, so the exact error will tell us what is going wrong. Here is the error message. This is an exception that is thrown at run-time. Title: MissingMemberException was unhandled by user code. Description: type object 'Forms' has no attribute 'FormTwo' Now, here's where the plot thickens: if I create the solution, change the Program.py file to use FormTwo and then run the project *for the first time*, it runs fine. However, when I change the project to FormOne and try to run it, it throws that exception. The same happens in the opposite direction: if I run the program first with FormOne, then it fails when I try it with FormTwo. In other words, whichever Form the Program.py file uses in its first run is the only one that it can use. After that, it cannot find any other Form class. Thank you, Rocco -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, January 26, 2008 12:20 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] [IronPythonStudio] Namespace Classes and Assembly Files Pigneri, Rocco wrote: > Dear all, > > I am new to Python, IronPython, and IronPythonStudio, but so far I am > enjoying the functionality that IPS offers me. > > One thing that confuses me, however, is the namespace classes that IPS > creates for me. Let's say I create a Windows Forms project called > Forms with a default form called FormOne. FormOne is created in the > Forms namespace while the Program.py file is placed in the Forms0 > namespace. This is annoying (unpythonic) but is probably due to the way the CodeDom works - it basically creates the equivalent IronPython to the C# it would generate. > > I next add a new Form to the project by right-clicking on the project > name in the Solution Explorer, and go to Add->New Item->Windows Form. > I call this class FormTwo. FormTwo is now placed in the Forms > namespace as well. > > If I try to use the FormTwo class in the Program.py file (i.e. I would > rather start up with FormTwo rather than FormOne), Forms.FormTwo() > does not do the trick. The debugger keeps reporting that the class is > not found. This also happens if I add "from FormTwo import *" to the > top of the file. > > What am I doing wrong here? I feel like I should be able to reference > any class in an assembly/project from any class in the same > assembly/project. I have been able to get this to work by changing > the namespace class in FormTwo.py, but I feel like that is the wrong > approach. Can you post the actual error you get? The import and reference you posted should work, so the exact error will tell us what is going wrong. Michael Foord http://www.manning.com/foord > > Thank you, > > Rocco > ---------------------------------------------------------------------- > -- > > _______________________________________________ > Users mailing list > Users at lists.ironpython.com > http://lists.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 Wed Jan 30 00:59:52 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Tue, 29 Jan 2008 23:59:52 +0000 Subject: [IronPython] New Project: Implementing .NET Libraries in Pure Python In-Reply-To: References: <479DE7BE.6050701@voidspace.org.uk> Message-ID: <479FBDF8.4090905@voidspace.org.uk> Slide wrote: > I'm interested in helping. > Hello Slide, Sorry for taking so long to get back to you. Are there any particular classes you have an interest in implementing? DateTime would be a good candidate. At the moment I don't have much to show you what I have in mind - so I will be in touch again when I have done some work (hopefully soon). I'm a bit of a code quality neurotic, and I like to be able to refactor with peace of mind - so I like full test coverage (TDD is the best way to achieve this of course). To start with I'd prefer contributions from patches. All the best, Michael > On Jan 28, 2008 7:33 AM, Michael Foord wrote: > >> Hello all, >> >> I thought I would let you know about a new project I have started and >> will be hacking on as and when I have time: >> >> http://code.google.com/p/python-system/ >> >> python-system >> >> An implementation of the BCL and other .NET libraries in pure Python >> (for porting IronPython code to CPython). >> >> The main goal of this project is to allow Resolver One spreadsheets >> exported as code to run under CPython. I will implement the .NET classes >> needed for this, but this project should be helpful for anyone wanting >> to run IronPython code under CPython. >> >> Anyone who might find this useful is welcome to help of course. :-) >> >> Nothing there yet, but I hope to get a unit test framework checked in >> today so that I can start. >> >> I will be starting with partial implementations of Array, DateTime, >> Color, Point and friends (the 'low hanging fruit'). >> >> All the best, >> >> >> Michael Foord >> http://www.manning.com/foord >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com >> >> > > > > From fuzzyman at voidspace.org.uk Wed Jan 30 01:03:09 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 30 Jan 2008 00:03:09 +0000 Subject: [IronPython] [python] [IronPythonStudio] Namespace Classes and Assembly Files In-Reply-To: References: <479B6BC8.3020106@voidspace.org.uk> Message-ID: <479FBEBD.7030001@voidspace.org.uk> Pigneri, Rocco wrote: > Dear Michael, > > Well, I tried this out this morning, and I noticed that the plot has > thickened. However, let me answer your question first: > > >>> I next add a new Form to the project by right-clicking on the project >>> > > >>> name in the Solution Explorer, and go to Add->New Item->Windows Form. >>> I call this class FormTwo. FormTwo is now placed in the Forms >>> namespace as well. >>> >>> If I try to use the FormTwo class in the Program.py file (i.e. I >>> > would > >>> rather start up with FormTwo rather than FormOne), Forms.FormTwo() >>> does not do the trick. The debugger keeps reporting that the class >>> > is > >>> not found. This also happens if I add "from FormTwo import *" to the >>> > > >>> top of the file. >>> >>> What am I doing wrong here? I feel like I should be able to >>> > reference > >>> any class in an assembly/project from any class in the same >>> assembly/project. I have been able to get this to work by changing >>> the namespace class in FormTwo.py, but I feel like that is the wrong >>> approach. >>> >> Can you post the actual error you get? The import and reference you >> > posted should work, so the exact error will tell us what is going wrong. > > Here is the error message. This is an exception that is thrown at > run-time. > > Title: MissingMemberException was unhandled by user code. > Description: type object 'Forms' has no attribute 'FormTwo' > > Now, here's where the plot thickens: if I create the solution, change > the Program.py file to use FormTwo and then run the project *for the > first time*, it runs fine. However, when I change the project to > FormOne and try to run it, it throws that exception. The same happens > in the opposite direction: if I run the program first with FormOne, then > it fails when I try it with FormTwo. In other words, whichever Form the > Program.py file uses in its first run is the only one that it can use. > After that, it cannot find any other Form class. > > Wow that sounds like a tangled mess - but this is only Python after all, so it should be following deterministic rules (I assume you are running source code or are you running a compiled executable?). How about throwing a 'print dir(Forms)' in their so you can see if your form classes really exist. Michael http://www.manning.com/foord > Thank you, > > Rocco > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, January 26, 2008 12:20 PM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] [IronPythonStudio] Namespace Classes > and Assembly Files > > Pigneri, Rocco wrote: > >> Dear all, >> >> I am new to Python, IronPython, and IronPythonStudio, but so far I am >> enjoying the functionality that IPS offers me. >> >> One thing that confuses me, however, is the namespace classes that IPS >> > > >> creates for me. Let's say I create a Windows Forms project called >> Forms with a default form called FormOne. FormOne is created in the >> Forms namespace while the Program.py file is placed in the Forms0 >> namespace. >> > > This is annoying (unpythonic) but is probably due to the way the CodeDom > works - it basically creates the equivalent IronPython to the C# it > would generate. > > >> >> I next add a new Form to the project by right-clicking on the project >> name in the Solution Explorer, and go to Add->New Item->Windows Form. >> I call this class FormTwo. FormTwo is now placed in the Forms >> namespace as well. >> >> If I try to use the FormTwo class in the Program.py file (i.e. I would >> > > >> rather start up with FormTwo rather than FormOne), Forms.FormTwo() >> does not do the trick. The debugger keeps reporting that the class is >> > > >> not found. This also happens if I add "from FormTwo import *" to the >> top of the file. >> >> What am I doing wrong here? I feel like I should be able to reference >> > > >> any class in an assembly/project from any class in the same >> assembly/project. I have been able to get this to work by changing >> the namespace class in FormTwo.py, but I feel like that is the wrong >> approach. >> > > Can you post the actual error you get? The import and reference you > posted should work, so the exact error will tell us what is going wrong. > > Michael Foord > http://www.manning.com/foord > > >> >> Thank you, >> >> Rocco >> ---------------------------------------------------------------------- >> -- >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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 dfugate at microsoft.com Wed Jan 30 01:36:34 2008 From: dfugate at microsoft.com (Dave Fugate) Date: Tue, 29 Jan 2008 16:36:34 -0800 Subject: [IronPython] IronPython 2.0 Alpha 8 In-Reply-To: <7346A825E148B049A9AD1D3ED46A2D911A48CA0F40@NA-EXMSG-C106.redmond.corp.microsoft.com> References: <7346A825E148B049A9AD1D3ED46A2D911A48CA0F40@NA-EXMSG-C106.redmond.corp.microsoft.com> Message-ID: <7346A825E148B049A9AD1D3ED46A2D91234D7627B0@NA-EXMSG-C106.redmond.corp.microsoft.com> Hello IronPython Community, We have just released IronPython 2.0 Alpha 8. Aside from the usual bugs fixes this release includes a fairly major change. This is the first release of IronPython where the Visual Studio solution file, IronPython.sln, is in Visual Studio 2008 (VS2008) format. This file is in fact incompatible with Visual Studio 2005 (VS2005) and the msbuild executable distributed with the .NET 2.0 SDK. If you currently build IronPython from VS2005 or the .NET 2.0 SDK this change will affect you and you have at least a couple of available options: 1. Upgrade to .NET 3.5 (http://www.microsoft.com/downloads/details.aspx?familyid=333325fd-ae52-4e35-b531-508d977d32a6&displaylang=en) or VS2008. It's important to point out that internally we pass the "/toolsversion:2.0" flag to msbuild when building from a command prompt. This isn't mandatory though and the reason we use it is to ensure IronPython continues to run under .NET 2.0. 2. Continue to build IronPython under VS2005 or the .NET 2.0 SDK using IronPython2005.sln. IronPython2005.sln is the VS2005 version of IronPython.sln and exists alongside IronPython.sln in the source distribution zip file. We do not recommend this however as IronPython2005.sln is deprecated and we don't plan on updating it Another notable change is that all built-in Exception classes are now new-style classes (see http://docs.python.org/whatsnew/pep-352.html). This improves our CPython 2.5 compatibility and we're now able to run quite a few more CPython 2.5 tests successfully. On that note, a lot of effort has gone into making IronPython pass more of CPython's 2.5 tests. The following CodePlex Work Items have been closed since the last Alpha Release: * 7594 type.__call__ always passes type(type) as 1st parameter * 2810 Trivial: An unexpected keyword argument exception raised when creating instance of class inherited from file * 11924 true division (from __future__ import division) doesn't work * 2729 Trivial: error message for expected type should display full array type info * 5755 Import in exec doesn't publish into provided dictionary * 5800 "exec in" is broken * 7531 re.sub at the start of the string * 8286 Deleting shadowing global then redefining builtin doesn't work * 7007 __import__ fails when filename contains '+' * 3758 super(sometype, inst).__eq__ on derived tuple while overriding tuple stack overflows * 2687 Setting read-only property raises NullReferenceException * 10903 [blocking Tutorial on 2.0] Exercise 3.1 in Tutorial 1 references missing file * 3529 Trivial: int.__int__ does not exist * 3530 Console doesn't allow new lines inside of dict nested in list * 3118 .func_code.co_flags is inconsistent * 6142 Setting func_name on function doesn't show up in __name__ * 778 'site' shows up in dir after it's loaded * 8246 Bug in handling of keyword arguments for __call__ * 3982 list equality fails for enums * 7268 Unicode encoder doesn't have backslashreplace method * 3194 from module import * is broken We'd like to thank everyone in the community who reported these to make a better release: Seo Sanghyeon, Shigeru HEMMI, tscottw, pobrien, nriley, jdhardy, hardcoded.software, Jan Szumiec, davidfraser, Simon Dahlbacka, Giles Thomas, Andrzej Krzywda, haypo, and Timothy Fitz. Additionally, we've closed the following bugs reported internally: * 131687 setdefaultencoding doesn't self-delete in CPython on call. * 148185 Implement -m command line parameter * 148435 Trivial: No builtin module xxsubtype * 148655 CPython doesn't delete setdefaultencoding on call, but in site.py * 216665 Puzzle IronPython 1.0.1 sample fails very severely at shutdown under IronPython 1.1RC1 * 303074 eval() can't map dictionary interface * 303085 Effect of del s[3:10] is different in python and ironpython in test_userstring.py * 312905 SNAP blocking: test_decimal and test_thread fail under -X:Interpret * 313703 when a weakref object dispose, Ironpython should not throw TypeError exception but ReferenceError exception * 314841 Ironpython throw "Exception: The method or operation is not implemented." but Cpython does not throw. * 315120 IronPython: from clr import * doesn't work * 316494 TypeError: Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'Microsoft.Scripting.Types.DynamicType'. * 316497 AttributeError: no attribute func_dict * 316507 __doc__ should be Another way of spelling func_doc * 317542 ___index__() and operator.index() aren't implemented * 317543 Ironpython file name is case-sensitive when it is called as module. but cpython is not. * 318143 ImportError: No module named _bsddb * 318187 ImportError: No module named parser * 318517 ImportError: No module named _lsprof * 318971 ImportError: No module named _ctypes * 318984 random.getrandbits() return different result from CPython 2.5's * 319880 SNAP blocking: test_funcattrs.py fails under -X:Interpret mode * 321793 Trivial: OSError occurs when open file then unlink file. * 322193 os.tempnam() throw a typeerror exception against Ironpython * 325811 (4+"") get different TypeError description between IronPython and Cpython * 325860 after gc.collect, maybe, weakref.proxy should refer to NoneType . * 326883 Wrong evaluation order for Augmented assignment * 359581 generator should gracefully throw if calling itself * 359750 Yield Statement codegen does properly restore exception stack * 360718 Previous exc_info() should be restored on function exit, not except-block exit. * 361127 sys.exc_clear() causes asserts * 361441 Update test_parrot for CPython 2.5 * 362939 troubling dynamic site code for converting to value type by Converter.Convert * 363412 calling method on value type object has no impact on the object itself (due to boxing/unboxing) * 363790 incorrect codegen for value type ctor with keyword argument You can download IronPython 2.0 Alpha 8 at: http://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=IronPython&ReleaseId=9219 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 rpigneri at LavaStorm.com Wed Jan 30 17:50:37 2008 From: rpigneri at LavaStorm.com (Pigneri, Rocco) Date: Wed, 30 Jan 2008 11:50:37 -0500 Subject: [IronPython] [python] [IronPythonStudio] Namespace Classes and Assembly Files In-Reply-To: <479FBEBD.7030001@voidspace.org.uk> References: <479B6BC8.3020106@voidspace.org.uk> <479FBEBD.7030001@voidspace.org.uk> Message-ID: Here's the output from the project where FormTwo works: ['FormTwo', '__doc__', '__module__'] Here's the output from the project where FormOne works: ['FormOne', '__doc__', '__module__'] Really, this is quite fascinating. There's no mention of the class that was not run on the first time. What's even more fascinating is that the code files are identical, including the namespace classes (excluding, of course, the class names and a few spaces after comments). Rocco -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Tuesday, January 29, 2008 7:03 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] [IronPythonStudio] Namespace Classes and Assembly Files Pigneri, Rocco wrote: > Dear Michael, > > Well, I tried this out this morning, and I noticed that the plot has > thickened. However, let me answer your question first: > > >>> I next add a new Form to the project by right-clicking on the >>> project >>> > > >>> name in the Solution Explorer, and go to Add->New Item->Windows Form. >>> I call this class FormTwo. FormTwo is now placed in the Forms >>> namespace as well. >>> >>> If I try to use the FormTwo class in the Program.py file (i.e. I >>> > would > >>> rather start up with FormTwo rather than FormOne), Forms.FormTwo() >>> does not do the trick. The debugger keeps reporting that the class >>> > is > >>> not found. This also happens if I add "from FormTwo import *" to >>> the >>> > > >>> top of the file. >>> >>> What am I doing wrong here? I feel like I should be able to >>> > reference > >>> any class in an assembly/project from any class in the same >>> assembly/project. I have been able to get this to work by changing >>> the namespace class in FormTwo.py, but I feel like that is the wrong >>> approach. >>> >> Can you post the actual error you get? The import and reference you >> > posted should work, so the exact error will tell us what is going wrong. > > Here is the error message. This is an exception that is thrown at > run-time. > > Title: MissingMemberException was unhandled by user code. > Description: type object 'Forms' has no attribute 'FormTwo' > > Now, here's where the plot thickens: if I create the solution, change > the Program.py file to use FormTwo and then run the project *for the > first time*, it runs fine. However, when I change the project to > FormOne and try to run it, it throws that exception. The same happens > in the opposite direction: if I run the program first with FormOne, > then it fails when I try it with FormTwo. In other words, whichever > Form the Program.py file uses in its first run is the only one that it can use. > After that, it cannot find any other Form class. > > Wow that sounds like a tangled mess - but this is only Python after all, so it should be following deterministic rules (I assume you are running source code or are you running a compiled executable?). How about throwing a 'print dir(Forms)' in their so you can see if your form classes really exist. Michael http://www.manning.com/foord > Thank you, > > Rocco > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, January 26, 2008 12:20 PM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] [IronPythonStudio] Namespace > Classes and Assembly Files > > Pigneri, Rocco wrote: > >> Dear all, >> >> I am new to Python, IronPython, and IronPythonStudio, but so far I am >> enjoying the functionality that IPS offers me. >> >> One thing that confuses me, however, is the namespace classes that >> IPS >> > > >> creates for me. Let's say I create a Windows Forms project called >> Forms with a default form called FormOne. FormOne is created in the >> Forms namespace while the Program.py file is placed in the Forms0 >> namespace. >> > > This is annoying (unpythonic) but is probably due to the way the > CodeDom works - it basically creates the equivalent IronPython to the > C# it would generate. > > >> >> I next add a new Form to the project by right-clicking on the project >> name in the Solution Explorer, and go to Add->New Item->Windows Form. >> I call this class FormTwo. FormTwo is now placed in the Forms >> namespace as well. >> >> If I try to use the FormTwo class in the Program.py file (i.e. I >> would >> > > >> rather start up with FormTwo rather than FormOne), Forms.FormTwo() >> does not do the trick. The debugger keeps reporting that the class >> is >> > > >> not found. This also happens if I add "from FormTwo import *" to the >> top of the file. >> >> What am I doing wrong here? I feel like I should be able to >> reference >> > > >> any class in an assembly/project from any class in the same >> assembly/project. I have been able to get this to work by changing >> the namespace class in FormTwo.py, but I feel like that is the wrong >> approach. >> > > Can you post the actual error you get? The import and reference you > posted should work, so the exact error will tell us what is going wrong. > > Michael Foord > http://www.manning.com/foord > > >> >> Thank you, >> >> Rocco >> --------------------------------------------------------------------- >> - >> -- >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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 rpigneri at LavaStorm.com Wed Jan 30 18:25:30 2008 From: rpigneri at LavaStorm.com (Pigneri, Rocco) Date: Wed, 30 Jan 2008 12:25:30 -0500 Subject: [IronPython] [python] [IronPythonStudio] Namespace Classes andAssembly Files In-Reply-To: References: <479B6BC8.3020106@voidspace.org.uk><479FBEBD.7030001@voidspace.org.uk> Message-ID: Ah, ha! I think I may have found the culprit! If I have the following import sequences in the follwing order, then only FormTwo is available: from FormOne import * from FormTwo import * However, if they are in this order, then only FormOne is available: from FormTwo import * from FormOne import * It seems that only the last class statement that is evaluated/imported is retained. Since I'm new to [Iron]+Python[Studio]+, I am unsure if this is correct behavior that I have to be aware of or not. Anyone else have any insight? Thank you, Rocco -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pigneri, Rocco Sent: Wednesday, January 30, 2008 11:51 AM To: Discussion of IronPython Subject: Re: [IronPython] [python] [IronPythonStudio] Namespace Classes andAssembly Files Here's the output from the project where FormTwo works: ['FormTwo', '__doc__', '__module__'] Here's the output from the project where FormOne works: ['FormOne', '__doc__', '__module__'] Really, this is quite fascinating. There's no mention of the class that was not run on the first time. What's even more fascinating is that the code files are identical, including the namespace classes (excluding, of course, the class names and a few spaces after comments). Rocco -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Tuesday, January 29, 2008 7:03 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] [IronPythonStudio] Namespace Classes and Assembly Files Pigneri, Rocco wrote: > Dear Michael, > > Well, I tried this out this morning, and I noticed that the plot has > thickened. However, let me answer your question first: > > >>> I next add a new Form to the project by right-clicking on the >>> project >>> > > >>> name in the Solution Explorer, and go to Add->New Item->Windows Form. >>> I call this class FormTwo. FormTwo is now placed in the Forms >>> namespace as well. >>> >>> If I try to use the FormTwo class in the Program.py file (i.e. I >>> > would > >>> rather start up with FormTwo rather than FormOne), Forms.FormTwo() >>> does not do the trick. The debugger keeps reporting that the class >>> > is > >>> not found. This also happens if I add "from FormTwo import *" to >>> the >>> > > >>> top of the file. >>> >>> What am I doing wrong here? I feel like I should be able to >>> > reference > >>> any class in an assembly/project from any class in the same >>> assembly/project. I have been able to get this to work by changing >>> the namespace class in FormTwo.py, but I feel like that is the wrong >>> approach. >>> >> Can you post the actual error you get? The import and reference you >> > posted should work, so the exact error will tell us what is going wrong. > > Here is the error message. This is an exception that is thrown at > run-time. > > Title: MissingMemberException was unhandled by user code. > Description: type object 'Forms' has no attribute 'FormTwo' > > Now, here's where the plot thickens: if I create the solution, change > the Program.py file to use FormTwo and then run the project *for the > first time*, it runs fine. However, when I change the project to > FormOne and try to run it, it throws that exception. The same happens > in the opposite direction: if I run the program first with FormOne, > then it fails when I try it with FormTwo. In other words, whichever > Form the Program.py file uses in its first run is the only one that it can use. > After that, it cannot find any other Form class. > > Wow that sounds like a tangled mess - but this is only Python after all, so it should be following deterministic rules (I assume you are running source code or are you running a compiled executable?). How about throwing a 'print dir(Forms)' in their so you can see if your form classes really exist. Michael http://www.manning.com/foord > Thank you, > > Rocco > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Saturday, January 26, 2008 12:20 PM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] [IronPythonStudio] Namespace > Classes and Assembly Files > > Pigneri, Rocco wrote: > >> Dear all, >> >> I am new to Python, IronPython, and IronPythonStudio, but so far I am >> enjoying the functionality that IPS offers me. >> >> One thing that confuses me, however, is the namespace classes that >> IPS >> > > >> creates for me. Let's say I create a Windows Forms project called >> Forms with a default form called FormOne. FormOne is created in the >> Forms namespace while the Program.py file is placed in the Forms0 >> namespace. >> > > This is annoying (unpythonic) but is probably due to the way the > CodeDom works - it basically creates the equivalent IronPython to the > C# it would generate. > > >> >> I next add a new Form to the project by right-clicking on the project >> name in the Solution Explorer, and go to Add->New Item->Windows Form. >> I call this class FormTwo. FormTwo is now placed in the Forms >> namespace as well. >> >> If I try to use the FormTwo class in the Program.py file (i.e. I >> would >> > > >> rather start up with FormTwo rather than FormOne), Forms.FormTwo() >> does not do the trick. The debugger keeps reporting that the class >> is >> > > >> not found. This also happens if I add "from FormTwo import *" to the >> top of the file. >> >> What am I doing wrong here? I feel like I should be able to >> reference >> > > >> any class in an assembly/project from any class in the same >> assembly/project. I have been able to get this to work by changing >> the namespace class in FormTwo.py, but I feel like that is the wrong >> approach. >> > > Can you post the actual error you get? The import and reference you > posted should work, so the exact error will tell us what is going wrong. > > Michael Foord > http://www.manning.com/foord > > >> >> Thank you, >> >> Rocco >> --------------------------------------------------------------------- >> - >> -- >> >> _______________________________________________ >> Users mailing list >> Users at lists.ironpython.com >> http://lists.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 curt at hagenlocher.org Wed Jan 30 18:44:42 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 30 Jan 2008 09:44:42 -0800 Subject: [IronPython] [python] [IronPythonStudio] Namespace Classes andAssembly Files In-Reply-To: References: <479B6BC8.3020106@voidspace.org.uk> <479FBEBD.7030001@voidspace.org.uk> Message-ID: On Jan 30, 2008 9:25 AM, Pigneri, Rocco wrote: > Ah, ha! I think I may have found the culprit! > > If I have the following import sequences in the follwing order, then > only FormTwo is available: > > from FormOne import * > from FormTwo import * > > However, if they are in this order, then only FormOne is available: > > from FormTwo import * > from FormOne import * > > It seems that only the last class statement that is evaluated/imported > is retained. Are you importing FormOne from FormTwo and/or vice versa? Pythonic namespace collisions are far less likely if you keep things in their namespaces. This is another way of saying that "from X import *" is potentially evil and should be used very carefully. Try saying "import FormOne" and then qualify the class as "FormOne.FormOne". -- Curt Hagenlocher curt at hagenlocher.org From steve at holdenweb.com Wed Jan 30 18:56:38 2008 From: steve at holdenweb.com (Steve Holden) Date: Wed, 30 Jan 2008 12:56:38 -0500 Subject: [IronPython] [python] [IronPythonStudio] Namespace Classes andAssembly Files In-Reply-To: References: <479B6BC8.3020106@voidspace.org.uk><479FBEBD.7030001@voidspace.org.uk> Message-ID: <47A0BA56.4010001@holdenweb.com> Is it by chance possible that both modules define the same names? If so, there's clearly no way to import * from both modules. In which case the solution is to write import FormOne import FormTwo and then use form-relative names like FormOne.this and FormTwo.that - that will avoid naming conflicts between the two modules. regards Steve Pigneri, Rocco wrote: > Ah, ha! I think I may have found the culprit! > > If I have the following import sequences in the follwing order, then > only FormTwo is available: > > from FormOne import * > from FormTwo import * > > However, if they are in this order, then only FormOne is available: > > from FormTwo import * > from FormOne import * > > It seems that only the last class statement that is evaluated/imported > is retained. > > Since I'm new to [Iron]+Python[Studio]+, I am unsure if this is correct > behavior that I have to be aware of or not. Anyone else have any > insight? > > Thank you, > > Rocco > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pigneri, Rocco > Sent: Wednesday, January 30, 2008 11:51 AM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] [IronPythonStudio] Namespace Classes > andAssembly Files > > Here's the output from the project where FormTwo works: > > ['FormTwo', '__doc__', '__module__'] > > Here's the output from the project where FormOne works: > > ['FormOne', '__doc__', '__module__'] > > Really, this is quite fascinating. There's no mention of the class that > was not run on the first time. What's even more fascinating is that the > code files are identical, including the namespace classes (excluding, of > course, the class names and a few spaces after comments). > > Rocco > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Tuesday, January 29, 2008 7:03 PM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] [IronPythonStudio] Namespace Classes > and Assembly Files > > Pigneri, Rocco wrote: >> Dear Michael, >> >> Well, I tried this out this morning, and I noticed that the plot has >> thickened. However, let me answer your question first: >> >> >>>> I next add a new Form to the project by right-clicking on the >>>> project >>>> >> >>>> name in the Solution Explorer, and go to Add->New Item->Windows > Form. >>>> I call this class FormTwo. FormTwo is now placed in the Forms >>>> namespace as well. >>>> >>>> If I try to use the FormTwo class in the Program.py file (i.e. I >>>> >> would >> >>>> rather start up with FormTwo rather than FormOne), Forms.FormTwo() >>>> does not do the trick. The debugger keeps reporting that the class >>>> >> is >> >>>> not found. This also happens if I add "from FormTwo import *" to >>>> the >>>> >> >>>> top of the file. >>>> >>>> What am I doing wrong here? I feel like I should be able to >>>> >> reference >> >>>> any class in an assembly/project from any class in the same >>>> assembly/project. I have been able to get this to work by changing >>>> the namespace class in FormTwo.py, but I feel like that is the wrong > >>>> approach. >>>> >>> Can you post the actual error you get? The import and reference you >>> >> posted should work, so the exact error will tell us what is going > wrong. >> Here is the error message. This is an exception that is thrown at >> run-time. >> >> Title: MissingMemberException was unhandled by user code. >> Description: type object 'Forms' has no attribute 'FormTwo' >> >> Now, here's where the plot thickens: if I create the solution, change >> the Program.py file to use FormTwo and then run the project *for the >> first time*, it runs fine. However, when I change the project to >> FormOne and try to run it, it throws that exception. The same happens > >> in the opposite direction: if I run the program first with FormOne, >> then it fails when I try it with FormTwo. In other words, whichever >> Form the Program.py file uses in its first run is the only one that it > can use. >> After that, it cannot find any other Form class. >> >> > > Wow that sounds like a tangled mess - but this is only Python after all, > so it should be following deterministic rules (I assume you are running > source code or are you running a compiled executable?). > > How about throwing a 'print dir(Forms)' in their so you can see if your > form classes really exist. > > Michael > http://www.manning.com/foord > >> Thank you, >> >> Rocco >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com >> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord >> Sent: Saturday, January 26, 2008 12:20 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] [python] [IronPythonStudio] Namespace >> Classes and Assembly Files >> >> Pigneri, Rocco wrote: >> >>> Dear all, >>> >>> I am new to Python, IronPython, and IronPythonStudio, but so far I am > >>> enjoying the functionality that IPS offers me. >>> >>> One thing that confuses me, however, is the namespace classes that >>> IPS >>> >> >>> creates for me. Let's say I create a Windows Forms project called >>> Forms with a default form called FormOne. FormOne is created in the >>> Forms namespace while the Program.py file is placed in the Forms0 >>> namespace. >>> >> This is annoying (unpythonic) but is probably due to the way the >> CodeDom works - it basically creates the equivalent IronPython to the >> C# it would generate. >> >> >>> >>> I next add a new Form to the project by right-clicking on the project > >>> name in the Solution Explorer, and go to Add->New Item->Windows Form. >>> I call this class FormTwo. FormTwo is now placed in the Forms >>> namespace as well. >>> >>> If I try to use the FormTwo class in the Program.py file (i.e. I >>> would >>> >> >>> rather start up with FormTwo rather than FormOne), Forms.FormTwo() >>> does not do the trick. The debugger keeps reporting that the class >>> is >>> >> >>> not found. This also happens if I add "from FormTwo import *" to the > >>> top of the file. >>> >>> What am I doing wrong here? I feel like I should be able to >>> reference >>> >> >>> any class in an assembly/project from any class in the same >>> assembly/project. I have been able to get this to work by changing >>> the namespace class in FormTwo.py, but I feel like that is the wrong >>> approach. >>> >> Can you post the actual error you get? The import and reference you >> posted should work, so the exact error will tell us what is going > wrong. >> Michael Foord >> http://www.manning.com/foord >> >> >>> >>> Thank you, >>> >>> Rocco >>> --------------------------------------------------------------------- >>> - >>> -- >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.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 > -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ From rpigneri at LavaStorm.com Wed Jan 30 19:29:12 2008 From: rpigneri at LavaStorm.com (Pigneri, Rocco) Date: Wed, 30 Jan 2008 13:29:12 -0500 Subject: [IronPython] [python] [IronPythonStudio] Namespace ClassesandAssembly Files In-Reply-To: References: <479B6BC8.3020106@voidspace.org.uk><479FBEBD.7030001@voidspace.org.uk> Message-ID: >Are you importing FormOne from FormTwo and/or vice versa? No. I have FormOne declared in one file and FormTwo declared in another. However, they are both in the same namespace (Forms). I then pull them into the Program.py form by using "from Form[One][Two] import *". >Pythonic namespace collisions are far less likely if you keep things in their namespaces. This is another way of saying that "from X import >*" is potentially evil and should be used very carefully. Try saying "import FormOne" and then qualify the class as "FormOne.FormOne". So, then, is it correct to say that the namespace classes are not namespaces at all (at least, not in the C# sense)? In C#, I can declare files in the same namespace in different files and then use them as a group via Company.Namespace.Class1 and Company.Namespace.Class2. It sounds like instead, I need to do this: import FormOne import FormTwo f = FormOne.Forms.FormOne() f2 = FormTWo.Forms.FormTwo() Is this correct? Rocco -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Wednesday, January 30, 2008 12:45 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] [IronPythonStudio] Namespace ClassesandAssembly Files On Jan 30, 2008 9:25 AM, Pigneri, Rocco wrote: > Ah, ha! I think I may have found the culprit! > > If I have the following import sequences in the follwing order, then > only FormTwo is available: > > from FormOne import * > from FormTwo import * > > However, if they are in this order, then only FormOne is available: > > from FormTwo import * > from FormOne import * > > It seems that only the last class statement that is evaluated/imported > is retained. Are you importing FormOne from FormTwo and/or vice versa? Pythonic namespace collisions are far less likely if you keep things in their namespaces. This is another way of saying that "from X import *" is potentially evil and should be used very carefully. Try saying "import FormOne" and then qualify the class as "FormOne.FormOne". -- Curt Hagenlocher curt at hagenlocher.org _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From rpigneri at LavaStorm.com Wed Jan 30 19:30:33 2008 From: rpigneri at LavaStorm.com (Pigneri, Rocco) Date: Wed, 30 Jan 2008 13:30:33 -0500 Subject: [IronPython] [python] [IronPythonStudio] Namespace Classes andAssembly Files In-Reply-To: <47A0BA56.4010001@holdenweb.com> References: <479B6BC8.3020106@voidspace.org.uk><479FBEBD.7030001@voidspace.org.uk> <47A0BA56.4010001@holdenweb.com> Message-ID: They both declare the same namespace class (this is setup via IPS itself) that then has FormOne and FormTwo inside of them. I was assuming that they behaved much like C# namespaces (as per my first e-mail). Thank you, Rocco -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Steve Holden Sent: Wednesday, January 30, 2008 12:57 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] [IronPythonStudio] Namespace Classes andAssembly Files Is it by chance possible that both modules define the same names? If so, there's clearly no way to import * from both modules. In which case the solution is to write import FormOne import FormTwo and then use form-relative names like FormOne.this and FormTwo.that - that will avoid naming conflicts between the two modules. regards Steve Pigneri, Rocco wrote: > Ah, ha! I think I may have found the culprit! > > If I have the following import sequences in the follwing order, then > only FormTwo is available: > > from FormOne import * > from FormTwo import * > > However, if they are in this order, then only FormOne is available: > > from FormTwo import * > from FormOne import * > > It seems that only the last class statement that is evaluated/imported > is retained. > > Since I'm new to [Iron]+Python[Studio]+, I am unsure if this is > correct behavior that I have to be aware of or not. Anyone else have > any insight? > > Thank you, > > Rocco > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Pigneri, > Rocco > Sent: Wednesday, January 30, 2008 11:51 AM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] [IronPythonStudio] Namespace > Classes andAssembly Files > > Here's the output from the project where FormTwo works: > > ['FormTwo', '__doc__', '__module__'] > > Here's the output from the project where FormOne works: > > ['FormOne', '__doc__', '__module__'] > > Really, this is quite fascinating. There's no mention of the class > that was not run on the first time. What's even more fascinating is > that the code files are identical, including the namespace classes > (excluding, of course, the class names and a few spaces after comments). > > Rocco > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord > Sent: Tuesday, January 29, 2008 7:03 PM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] [IronPythonStudio] Namespace > Classes and Assembly Files > > Pigneri, Rocco wrote: >> Dear Michael, >> >> Well, I tried this out this morning, and I noticed that the plot has >> thickened. However, let me answer your question first: >> >> >>>> I next add a new Form to the project by right-clicking on the >>>> project >>>> >> >>>> name in the Solution Explorer, and go to Add->New Item->Windows > Form. >>>> I call this class FormTwo. FormTwo is now placed in the Forms >>>> namespace as well. >>>> >>>> If I try to use the FormTwo class in the Program.py file (i.e. I >>>> >> would >> >>>> rather start up with FormTwo rather than FormOne), Forms.FormTwo() >>>> does not do the trick. The debugger keeps reporting that the class >>>> >> is >> >>>> not found. This also happens if I add "from FormTwo import *" to >>>> the >>>> >> >>>> top of the file. >>>> >>>> What am I doing wrong here? I feel like I should be able to >>>> >> reference >> >>>> any class in an assembly/project from any class in the same >>>> assembly/project. I have been able to get this to work by changing >>>> the namespace class in FormTwo.py, but I feel like that is the >>>> wrong > >>>> approach. >>>> >>> Can you post the actual error you get? The import and reference you >>> >> posted should work, so the exact error will tell us what is going > wrong. >> Here is the error message. This is an exception that is thrown at >> run-time. >> >> Title: MissingMemberException was unhandled by user code. >> Description: type object 'Forms' has no attribute 'FormTwo' >> >> Now, here's where the plot thickens: if I create the solution, change >> the Program.py file to use FormTwo and then run the project *for the >> first time*, it runs fine. However, when I change the project to >> FormOne and try to run it, it throws that exception. The same >> happens > >> in the opposite direction: if I run the program first with FormOne, >> then it fails when I try it with FormTwo. In other words, whichever >> Form the Program.py file uses in its first run is the only one that >> it > can use. >> After that, it cannot find any other Form class. >> >> > > Wow that sounds like a tangled mess - but this is only Python after > all, so it should be following deterministic rules (I assume you are > running source code or are you running a compiled executable?). > > How about throwing a 'print dir(Forms)' in their so you can see if > your form classes really exist. > > Michael > http://www.manning.com/foord > >> Thank you, >> >> Rocco >> >> -----Original Message----- >> From: users-bounces at lists.ironpython.com >> [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael >> Foord >> Sent: Saturday, January 26, 2008 12:20 PM >> To: Discussion of IronPython >> Subject: Re: [IronPython] [python] [IronPythonStudio] Namespace >> Classes and Assembly Files >> >> Pigneri, Rocco wrote: >> >>> Dear all, >>> >>> I am new to Python, IronPython, and IronPythonStudio, but so far I >>> am > >>> enjoying the functionality that IPS offers me. >>> >>> One thing that confuses me, however, is the namespace classes that >>> IPS >>> >> >>> creates for me. Let's say I create a Windows Forms project called >>> Forms with a default form called FormOne. FormOne is created in the >>> Forms namespace while the Program.py file is placed in the Forms0 >>> namespace. >>> >> This is annoying (unpythonic) but is probably due to the way the >> CodeDom works - it basically creates the equivalent IronPython to the >> C# it would generate. >> >> >>> >>> I next add a new Form to the project by right-clicking on the >>> project > >>> name in the Solution Explorer, and go to Add->New Item->Windows Form. >>> I call this class FormTwo. FormTwo is now placed in the Forms >>> namespace as well. >>> >>> If I try to use the FormTwo class in the Program.py file (i.e. I >>> would >>> >> >>> rather start up with FormTwo rather than FormOne), Forms.FormTwo() >>> does not do the trick. The debugger keeps reporting that the class >>> is >>> >> >>> not found. This also happens if I add "from FormTwo import *" to >>> the > >>> top of the file. >>> >>> What am I doing wrong here? I feel like I should be able to >>> reference >>> >> >>> any class in an assembly/project from any class in the same >>> assembly/project. I have been able to get this to work by changing >>> the namespace class in FormTwo.py, but I feel like that is the wrong >>> approach. >>> >> Can you post the actual error you get? The import and reference you >> posted should work, so the exact error will tell us what is going > wrong. >> Michael Foord >> http://www.manning.com/foord >> >> >>> >>> Thank you, >>> >>> Rocco >>> -------------------------------------------------------------------- >>> - >>> - >>> -- >>> >>> _______________________________________________ >>> Users mailing list >>> Users at lists.ironpython.com >>> http://lists.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 > -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From curt at hagenlocher.org Wed Jan 30 20:12:41 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 30 Jan 2008 11:12:41 -0800 Subject: [IronPython] [python] [IronPythonStudio] Namespace ClassesandAssembly Files In-Reply-To: References: <479B6BC8.3020106@voidspace.org.uk> <479FBEBD.7030001@voidspace.org.uk> Message-ID: On Jan 30, 2008 10:29 AM, Pigneri, Rocco wrote: > It sounds like instead, I need to do this: > > import FormOne > import FormTwo > > f = FormOne.Forms.FormOne() > f2 = FormTWo.Forms.FormTwo() > > Is this correct? Exactly. When you said "from FormOne import *", you introduced the symbol "Forms" into the current namespace with the value of "FormOne.Forms". When you then said "from FormTwo import *", you replaced the symbol "Forms" with the value of "FormTwo.Forms". As you suggest, Python's "import" statement is not like the C# "using" statement. A Pythonic import will introduce new symbols into the local namespace at run time. The C# using statement is simply a directive to the compiler to tell it which namespaces to search in for symbols that are otherwise undefined in the local scope. It literally does not emit any IL code that is executed at runtime. -- Curt Hagenlocher curt at hagenlocher.org From rpigneri at LavaStorm.com Wed Jan 30 22:40:58 2008 From: rpigneri at LavaStorm.com (Pigneri, Rocco) Date: Wed, 30 Jan 2008 16:40:58 -0500 Subject: [IronPython] [python] [IronPythonStudio] NamespaceClassesandAssembly Files In-Reply-To: References: <479B6BC8.3020106@voidspace.org.uk><479FBEBD.7030001@voidspace.org.uk> Message-ID: Ah. In that case, I would strongly urge that the namespace class functionality of IPS be removed so that developers don't have to keep tip-toeing around that issue. Unless there is another way of using classes in Python that I'm not aware of. Thank you, Rocco -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher Sent: Wednesday, January 30, 2008 2:13 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] [IronPythonStudio] NamespaceClassesandAssembly Files On Jan 30, 2008 10:29 AM, Pigneri, Rocco wrote: > It sounds like instead, I need to do this: > > import FormOne > import FormTwo > > f = FormOne.Forms.FormOne() > f2 = FormTWo.Forms.FormTwo() > > Is this correct? Exactly. When you said "from FormOne import *", you introduced the symbol "Forms" into the current namespace with the value of "FormOne.Forms". When you then said "from FormTwo import *", you replaced the symbol "Forms" with the value of "FormTwo.Forms". As you suggest, Python's "import" statement is not like the C# "using" statement. A Pythonic import will introduce new symbols into the local namespace at run time. The C# using statement is simply a directive to the compiler to tell it which namespaces to search in for symbols that are otherwise undefined in the local scope. It literally does not emit any IL code that is executed at runtime. -- Curt Hagenlocher curt at hagenlocher.org _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From fuzzyman at voidspace.org.uk Wed Jan 30 23:39:34 2008 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Wed, 30 Jan 2008 22:39:34 +0000 Subject: [IronPython] [python] [IronPythonStudio] NamespaceClassesandAssembly Files In-Reply-To: References: <479B6BC8.3020106@voidspace.org.uk><479FBEBD.7030001@voidspace.org.uk> Message-ID: <47A0FCA6.40108@voidspace.org.uk> Pigneri, Rocco wrote: > Ah. In that case, I would strongly urge that the namespace class > functionality of IPS be removed so that developers don't have to keep > tip-toeing around that issue. Unless there is another way of using > classes in Python that I'm not aware of. > I strongly suspect it is the consequence of the CodeDOM provider that produces similarly structured code whatever the target language. I'm sure there *must* be some way to rectify this for IronPython though as those namespace classes are worse than useless. Michael > Thank you, > > Rocco > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt > Hagenlocher > Sent: Wednesday, January 30, 2008 2:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] [IronPythonStudio] > NamespaceClassesandAssembly Files > > On Jan 30, 2008 10:29 AM, Pigneri, Rocco wrote: > >> It sounds like instead, I need to do this: >> >> import FormOne >> import FormTwo >> >> f = FormOne.Forms.FormOne() >> f2 = FormTWo.Forms.FormTwo() >> >> Is this correct? >> > > Exactly. > > When you said "from FormOne import *", you introduced the symbol "Forms" > into the current namespace with the value of "FormOne.Forms". > When you then said "from FormTwo import *", you replaced the symbol > "Forms" with the value of "FormTwo.Forms". > > As you suggest, Python's "import" statement is not like the C# "using" > statement. A Pythonic import will introduce new symbols into the local > namespace at run time. The C# using statement is simply a directive to > the compiler to tell it which namespaces to search in for symbols that > are otherwise undefined in the local scope. It literally does not emit > any IL code that is executed at runtime. > > -- > 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 curt at hagenlocher.org Thu Jan 31 00:15:11 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 30 Jan 2008 15:15:11 -0800 Subject: [IronPython] Distinguishing DLR object from CLR object Message-ID: Is there a straightforward and reliable way from within IronPython to tell if a particular object is a "CLR object' or a "DLR object"? I can make a guess for just IronPython by saying isPythonObject = clr.GetClrType(type(obj)).FullName.startswith('IronPython') but this is both ugly and unreliable. -- Curt Hagenlocher curt at hagenlocher.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Jan 31 00:31:19 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 30 Jan 2008 15:31:19 -0800 Subject: [IronPython] Distinguishing DLR object from CLR object In-Reply-To: References: Message-ID: <7AD436E4270DD54A94238001769C2227010FC86B5993@DF-GRTDANE-MSG.exchange.corp.microsoft.com> If by "DLR object" you mean an object which has dynamic behavior beyond just it's type you can check to see if it implements IDynamicObject. But there really isn't anything considered to be a "DLR object". They're all just CLR objects and some of them can have dynamic behavior. Even normal CLR objects could have behaviors beyond just their normal CLR type - for example the various methods we add onto .NET strings that match the Python built-in string members. But I think IDynamicObject will probably get you the answer you're looking for. ________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Curt Hagenlocher [curt at hagenlocher.org] Sent: Wednesday, January 30, 2008 3:15 PM To: Discussion of IronPython Subject: [IronPython] Distinguishing DLR object from CLR object Is there a straightforward and reliable way from within IronPython to tell if a particular object is a "CLR object' or a "DLR object"? I can make a guess for just IronPython by saying isPythonObject = clr.GetClrType(type(obj)).FullName.startswith('IronPython') but this is both ugly and unreliable. -- Curt Hagenlocher curt at hagenlocher.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From dinov at exchange.microsoft.com Thu Jan 31 00:34:48 2008 From: dinov at exchange.microsoft.com (Dino Viehland) Date: Wed, 30 Jan 2008 15:34:48 -0800 Subject: [IronPython] [python] [IronPythonStudio] NamespaceClassesandAssembly Files In-Reply-To: <47A0FCA6.40108@voidspace.org.uk> References: <479B6BC8.3020106@voidspace.org.uk><479FBEBD.7030001@voidspace.org.uk> , <47A0FCA6.40108@voidspace.org.uk> Message-ID: <7AD436E4270DD54A94238001769C2227010FC86B5994@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Michael's probably at least partially correct about this. The other, evil, side of using CodeDom is that we might be using the "static type compiler" which primarily exists for supporting ASP.NET. There we're not only using CodeDom but we're also required to generate a .NET type that ASP.NET can instantiate - and that creates something which isn't quite Python. One interesting thing to try here is running the code outside of VS - e.g. just ipy foo.py from the command line. That will ensure you don't get the static type compiler - unfortunately I'm not sure off the top of my head if it'll get used or not in the WinForms scenario. ________________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Michael Foord [fuzzyman at voidspace.org.uk] Sent: Wednesday, January 30, 2008 2:39 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] [IronPythonStudio] NamespaceClassesandAssembly Files Pigneri, Rocco wrote: > Ah. In that case, I would strongly urge that the namespace class > functionality of IPS be removed so that developers don't have to keep > tip-toeing around that issue. Unless there is another way of using > classes in Python that I'm not aware of. > I strongly suspect it is the consequence of the CodeDOM provider that produces similarly structured code whatever the target language. I'm sure there *must* be some way to rectify this for IronPython though as those namespace classes are worse than useless. Michael > Thank you, > > Rocco > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt > Hagenlocher > Sent: Wednesday, January 30, 2008 2:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] [IronPythonStudio] > NamespaceClassesandAssembly Files > > On Jan 30, 2008 10:29 AM, Pigneri, Rocco wrote: > >> It sounds like instead, I need to do this: >> >> import FormOne >> import FormTwo >> >> f = FormOne.Forms.FormOne() >> f2 = FormTWo.Forms.FormTwo() >> >> Is this correct? >> > > Exactly. > > When you said "from FormOne import *", you introduced the symbol "Forms" > into the current namespace with the value of "FormOne.Forms". > When you then said "from FormTwo import *", you replaced the symbol > "Forms" with the value of "FormTwo.Forms". > > As you suggest, Python's "import" statement is not like the C# "using" > statement. A Pythonic import will introduce new symbols into the local > namespace at run time. The C# using statement is simply a directive to > the compiler to tell it which namespaces to search in for symbols that > are otherwise undefined in the local scope. It literally does not emit > any IL code that is executed at runtime. > > -- > 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 curt at hagenlocher.org Thu Jan 31 00:51:08 2008 From: curt at hagenlocher.org (Curt Hagenlocher) Date: Wed, 30 Jan 2008 15:51:08 -0800 Subject: [IronPython] Distinguishing DLR object from CLR object In-Reply-To: <7AD436E4270DD54A94238001769C2227010FC86B5993@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <7AD436E4270DD54A94238001769C2227010FC86B5993@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: On Jan 30, 2008 3:31 PM, Dino Viehland wrote: > > If by "DLR object" you mean an object which has dynamic behavior beyond just > it's type you can check to see if it implements IDynamicObject. But there > really isn't anything considered to be a "DLR object". Yes. I wasn't very happy with the categorization, but couldn't think of a better way to express what I meant. Your answer was exactly what I wanted: clr.GetClrType(Microsoft.Scripting.IDynamicObject).IsAssignableFrom(type(obj)) -- Curt Hagenlocher curt at hagenlocher.org From rpigneri at LavaStorm.com Thu Jan 31 16:48:21 2008 From: rpigneri at LavaStorm.com (Pigneri, Rocco) Date: Thu, 31 Jan 2008 10:48:21 -0500 Subject: [IronPython] [python][IronPythonStudio] NamespaceClassesandAssembly Files In-Reply-To: <7AD436E4270DD54A94238001769C2227010FC86B5994@DF-GRTDANE-MSG.exchange.corp.microsoft.com> References: <479B6BC8.3020106@voidspace.org.uk><479FBEBD.7030001@voidspace.org.uk>, <47A0FCA6.40108@voidspace.org.uk> <7AD436E4270DD54A94238001769C2227010FC86B5994@DF-GRTDANE-MSG.exchange.corp.microsoft.com> Message-ID: So, I actually ran the code outside of VS in two different ways: 1. I left VS compile it and then ran it on the command line manually. This was the only way for me to get the "print" statements to work. 2. I ran the code from the IronPython console (using the winforms module that is distributed with IPY itself). In both cases, the results were the same. Thank you, Rocco -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dino Viehland Sent: Wednesday, January 30, 2008 6:35 PM To: Discussion of IronPython Subject: Re: [IronPython] [python][IronPythonStudio] NamespaceClassesandAssembly Files Michael's probably at least partially correct about this. The other, evil, side of using CodeDom is that we might be using the "static type compiler" which primarily exists for supporting ASP.NET. There we're not only using CodeDom but we're also required to generate a .NET type that ASP.NET can instantiate - and that creates something which isn't quite Python. One interesting thing to try here is running the code outside of VS - e.g. just ipy foo.py from the command line. That will ensure you don't get the static type compiler - unfortunately I'm not sure off the top of my head if it'll get used or not in the WinForms scenario. ________________________________________ From: users-bounces at lists.ironpython.com [users-bounces at lists.ironpython.com] On Behalf Of Michael Foord [fuzzyman at voidspace.org.uk] Sent: Wednesday, January 30, 2008 2:39 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] [IronPythonStudio] NamespaceClassesandAssembly Files Pigneri, Rocco wrote: > Ah. In that case, I would strongly urge that the namespace class > functionality of IPS be removed so that developers don't have to keep > tip-toeing around that issue. Unless there is another way of using > classes in Python that I'm not aware of. > I strongly suspect it is the consequence of the CodeDOM provider that produces similarly structured code whatever the target language. I'm sure there *must* be some way to rectify this for IronPython though as those namespace classes are worse than useless. Michael > Thank you, > > Rocco > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt > Hagenlocher > Sent: Wednesday, January 30, 2008 2:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] [IronPythonStudio] > NamespaceClassesandAssembly Files > > On Jan 30, 2008 10:29 AM, Pigneri, Rocco wrote: > >> It sounds like instead, I need to do this: >> >> import FormOne >> import FormTwo >> >> f = FormOne.Forms.FormOne() >> f2 = FormTWo.Forms.FormTwo() >> >> Is this correct? >> > > Exactly. > > When you said "from FormOne import *", you introduced the symbol "Forms" > into the current namespace with the value of "FormOne.Forms". > When you then said "from FormTwo import *", you replaced the symbol > "Forms" with the value of "FormTwo.Forms". > > As you suggest, Python's "import" statement is not like the C# "using" > statement. A Pythonic import will introduce new symbols into the > local namespace at run time. The C# using statement is simply a > directive to the compiler to tell it which namespaces to search in for > symbols that are otherwise undefined in the local scope. It literally > does not emit any IL code that is executed at runtime. > > -- > 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 _______________________________________________ Users mailing list Users at lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com From rpigneri at LavaStorm.com Thu Jan 31 16:50:40 2008 From: rpigneri at LavaStorm.com (Pigneri, Rocco) Date: Thu, 31 Jan 2008 10:50:40 -0500 Subject: [IronPython] [python] [IronPythonStudio] NamespaceClassesandAssembly Files In-Reply-To: <47A0FCA6.40108@voidspace.org.uk> References: <479B6BC8.3020106@voidspace.org.uk><479FBEBD.7030001@voidspace.org.uk> <47A0FCA6.40108@voidspace.org.uk> Message-ID: Well, it seems like you guys are giving it a token specifically for the "namespace" identifier. Could you maybe change this token to "#class" so that the class line is just commented out? Not sure if that helps at all, but it is a thought. Rocco -----Original Message----- From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Michael Foord Sent: Wednesday, January 30, 2008 5:40 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] [IronPythonStudio] NamespaceClassesandAssembly Files Pigneri, Rocco wrote: > Ah. In that case, I would strongly urge that the namespace class > functionality of IPS be removed so that developers don't have to keep > tip-toeing around that issue. Unless there is another way of using > classes in Python that I'm not aware of. > I strongly suspect it is the consequence of the CodeDOM provider that produces similarly structured code whatever the target language. I'm sure there *must* be some way to rectify this for IronPython though as those namespace classes are worse than useless. Michael > Thank you, > > Rocco > > -----Original Message----- > From: users-bounces at lists.ironpython.com > [mailto:users-bounces at lists.ironpython.com] On Behalf Of Curt > Hagenlocher > Sent: Wednesday, January 30, 2008 2:13 PM > To: Discussion of IronPython > Subject: Re: [IronPython] [python] [IronPythonStudio] > NamespaceClassesandAssembly Files > > On Jan 30, 2008 10:29 AM, Pigneri, Rocco wrote: > >> It sounds like instead, I need to do this: >> >> import FormOne >> import FormTwo >> >> f = FormOne.Forms.FormOne() >> f2 = FormTWo.Forms.FormTwo() >> >> Is this correct? >> > > Exactly. > > When you said "from FormOne import *", you introduced the symbol "Forms" > into the current namespace with the value of "FormOne.Forms". > When you then said "from FormTwo import *", you replaced the symbol > "Forms" with the value of "FormTwo.Forms". > > As you suggest, Python's "import" statement is not like the C# "using" > statement. A Pythonic import will introduce new symbols into the > local namespace at run time. The C# using statement is simply a > directive to the compiler to tell it which namespaces to search in for > symbols that are otherwise undefined in the local scope. It literally > does not emit any IL code that is executed at runtime. > > -- > 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