Re: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible'
Hi, I use Windows XP Pro SP2 ja Office 2007 Pro ja. IronPython-2.0A6ipy.exe -X:PreferComDispatch -X:TabCompletion -X:ExceptionDetail IronPython console: IronPython 2.0A6 (2.0.11102.00) on .NET 2.0.50727.832 Copyright (c) Microsoft Corporation. All rights reserved. import clr from System import Type, Activator t = Type.GetTypeFromProgID('Excel.Application') e = Activator.CreateInstance(t) e.Visible = True '__ComObject' object has no attribute 'Visible' 場所 Microsoft.Scripting.Ast.ThrowStatement.DoExecute(CodeContext context) 場所 Microsoft.Scripting.Ast.Statement.Execute(CodeContext context) 場所 Microsoft.Scripting.Actions.ActionBinder.UpdateSiteAndExecute[T](CodeContext callerContext, DynamicAction action, Object[] args, Object site, T target, RuleSet`1 rules) 場所 Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) 場所 Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) 場所 Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) 場所 ##29(Object[] , CodeContext ) 場所 Microsoft.Scripting.ScriptCode.Run(CodeContext codeContext, Boolean tryEvaluate) 場所 Microsoft.Scripting.ScriptCode.Run(ScriptModule module) 場所 Microsoft.Scripting.Hosting.CompiledCode.Evaluate(IScriptModule module) 場所 Microsoft.Scripting.Hosting.ScriptEngine.ExecuteCommand(String code, IScriptModule module) 場所 Microsoft.Scripting.Shell.CommandLine.RunOneInteraction() 場所 Microsoft.Scripting.Shell.CommandLine.TryInteractiveAction() 場所 IronPython.Hosting.PythonCommandLine.TryInteractiveAction() 場所 Microsoft.Scripting.Shell.CommandLine.RunInteractiveLoop() AttributeError: '__ComObject' object has no attribute 'Visible' Thanks This works for me as well. Could you please re-run your code snippet under the -X:ExceptionDetail mode and send us the output? Also, what versions of Windows and Office are being used? Thanks From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mohammad Tayseer Sent: Wednesday, November 14, 2007 8:02 AM To: Discussion of IronPython Subject: Re: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' It works for me. What version of Excel do you use?? Mohammad Tayseer http://spellcoder.com/blogs/tayseer - Original Message From: nekomaho [EMAIL PROTECTED] Hi, I get AttributeError in IronPython 2.0A6 A5, but 2.0A4 is ok. why? Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.http://us.rd.yahoo.com/evt=51732/*http:/overview.mail.yahoo.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Announcing NWSGI
Hi Seo, On Nov 13, 2007 8:29 PM, Sanghyeon Seo [EMAIL PROTECTED] wrote: I don't understand why written in pure C# is an advantage (given that you need Python engine to implement WSGI anyway), or why using Python is an disadvantage (after all Python is a better language than C#, isn't it? If it isn't why are you using WSGI?), but I guess it's a matter of opinion. Also note that writing most codes in Python neatly avoids any hosting API issues. I hope you best luck, but I strongly believe writing most codes in Python is the right implementation choice. I'm not 100% convinced pure C# is a huge advantage either :). It does have a few advantages, such as simplyfying deployment (slightly) - and if all of the necessary assemblies are in the GAC, then deployment is as simple as creating a web.config (on IIS 7, all of the editing could be done with the GUI - you wouldn't even need to see the web.config). Also, I believe that if the hosting API can't handle this easily, then there are problems with the hosting API. That said, I'm not religious about it, which is why I've avoided making any judgement as to which is approch is better. It's a lot of work to get a small advantage when deploying, and if it proves to be too much effort I'll just give up and port yours to IP 2. I don't think that will have to be case, based on what I've done so far. - Jeff ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' with -X:PreferComDispatch
The behavior currently depends on whether or not the RCW gets strongly-typed when it enters the managed world. As a workaround, the following registry script Misha provided could fix your machine by registering the PIA: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\CLSID\{00024500---C000-0046}\InprocServer32] Assembly=Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C Class=Microsoft.Office.Interop.Excel.ApplicationClass RuntimeVersion=v1.1.4322 [HKEY_CLASSES_ROOT\CLSID\{00024500---C000-0046}\InprocServer32\12.0.0.0] Assembly=Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C Class=Microsoft.Office.Interop.Excel.ApplicationClass RuntimeVersion=v1.1.4322 Your script should work independent of whether the PIA is registered or not. We will look into it and see what is going. The implementation of -X:PreferComDispatch is still not complete. We are working on improving it and will enable it by default once all issues are flushed out. You are on the cutting edge and providing us with advance feedback :) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of nekomaho Sent: Thursday, November 15, 2007 4:45 AM To: Discussion of IronPython Subject: Re: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' Hi, I use Windows XP Pro SP2 ja Office 2007 Pro ja. IronPython-2.0A6ipy.exe -X:PreferComDispatch -X:TabCompletion -X:ExceptionDetail IronPython console: IronPython 2.0A6 (2.0.11102.00) on .NET 2.0.50727.832 Copyright (c) Microsoft Corporation. All rights reserved. import clr from System import Type, Activator t = Type.GetTypeFromProgID('Excel.Application') e = Activator.CreateInstance(t) e.Visible = True '__ComObject' object has no attribute 'Visible' 場所 Microsoft.Scripting.Ast.ThrowStatement.DoExecute(CodeContext context) 場所 Microsoft.Scripting.Ast.Statement.Execute(CodeContext context) 場所 Microsoft.Scripting.Actions.ActionBinder.UpdateSiteAndExecute[T](CodeContext callerContext, DynamicAction action, Object[] args, Object site, T target, RuleSet`1 rules) 場所 Microsoft.Scripting.Actions.DynamicSite`3.UpdateBindingAndInvoke(CodeContext context, T0 arg0, T1 arg1) 場所 Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7.Invoke2(DynamicSite`3 site, CodeContext context, T0 arg0, T1 arg1) 場所 Microsoft.Scripting.Actions.DynamicSite`3.Invoke(CodeContext context, T0 arg0, T1 arg1) 場所 ##29(Object[] , CodeContext ) 場所 Microsoft.Scripting.ScriptCode.Run(CodeContext codeContext, Boolean tryEvaluate) 場所 Microsoft.Scripting.ScriptCode.Run(ScriptModule module) 場所 Microsoft.Scripting.Hosting.CompiledCode.Evaluate(IScriptModule module) 場所 Microsoft.Scripting.Hosting.ScriptEngine.ExecuteCommand(String code, IScriptModule module) 場所 Microsoft.Scripting.Shell.CommandLine.RunOneInteraction() 場所 Microsoft.Scripting.Shell.CommandLine.TryInteractiveAction() 場所 IronPython.Hosting.PythonCommandLine.TryInteractiveAction() 場所 Microsoft.Scripting.Shell.CommandLine.RunInteractiveLoop() AttributeError: '__ComObject' object has no attribute 'Visible' Thanks This works for me as well. Could you please re-run your code snippet under the -X:ExceptionDetail mode and send us the output? Also, what versions of Windows and Office are being used? Thanks From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mohammad Tayseer Sent: Wednesday, November 14, 2007 8:02 AM To: Discussion of IronPython Subject: Re: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' It works for me. What version of Excel do you use?? Mohammad Tayseer http://spellcoder.com/blogs/tayseer - Original Message From: nekomaho [EMAIL PROTECTED] Hi, I get AttributeError in IronPython 2.0A6 A5, but 2.0A4 is ok. why? Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.http://us.rd.yahoo.com/evt=51732/*http:/overview.mail.yahoo.com/ ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com