From wjk at wjk.mv.com Sat Jan 8 16:13:57 2000 From: wjk at wjk.mv.com (Wm. King) Date: Sat, 08 Jan 2000 16:13:57 -0500 Subject: does a variable exist References: <38767A50.CFDEC3C2@wjk.mv.com> Message-ID: <3877A894.4019F528@wjk.mv.com> Thanks -- was just wondering if there was more overhead in catching/throwing exceptions... (still learning) (c;{ Darrell wrote: > "Wm. King" wrote in message > news:38767A50.CFDEC3C2 at wjk.mv.com... > > Could you do something like: > > > > try: > > print x > > except NameError: > > print "No global or local x" > > > > Just wondering? > > > > Yulp. > You see that a lot for imports also. > try: > from _socket import * > except ImportError: > from socket import * > > Throwing exceptions takes time. Not a problem for imports but might be a > problem when accessing variables. > > Here's another way to say the same thing. > >>> myVar=1 > >>> import sys > >>> globals().get('myVar',None) > 1 > >>> globals().get('xxxx',None) > >>> > >>> class VarError: > ... def __init__(self, msg): > ... self._msg=msg > ... def __str__(self): > ... return self._msg > ... > >>> > >>> print globals().get('xxxx',VarError("No global or local xxxx")) > No global or local xxxx > >>> > > -- > --Darrell From mchung at mindspring.com Tue Jan 11 00:17:20 2000 From: mchung at mindspring.com (Mitchell Chung) Date: Tue, 11 Jan 2000 00:17:20 -0500 Subject: AXScript problem... Message-ID: <85ehtk$g2b$1@nntp1.atl.mindspring.net> I'm using Windows NT and IE 5.0 with Python and the AXScript implementation in win32com. The demos in win32comext\axscript\demos\client\ie, like calc.htm, seem to work. But when I try my own code I'm getting errors with stuff like "import copy" and "import httplib". I haven't been able to find a solution in the docs and the Python web site yet. Can anyone help? For example in calc.htm if I have

Output from the VBScript Code (OK) : Balthasar-Neumann-Quelle33 Output from Python : Python ActiveX Scripting Engine error '80020009' Traceback (innermost last): File "