I'm stuck on pp. 68-71 of "Python Programming on Win32". I tried to follow the
"Implementing COM Objects with Python" but the SimpleCOMServer.py program
doesn't seem to be working as I attempt to run it on PythonWin (PythonWin 2.0
(#8, Mar 7 2001, 16:04:37) [MSC 32 bit (Intel)] on win32). There is no response
to the PythonWin interactive. I try the same program in Komodo 1.0 and get this:
File "e:\program files\komodo\mozilla\chrome\komodo\content\python\kdb.py",
line 277, in _do_start
code_ob = compile(code, debug_args[0], "exec")
File "<string>", line 3
import win32com.server.register
win32com.server.register.UseCommandLine(PythonUtilities)
^
SyntaxError: invalid syntax
========== Python debug run finished. ==========
Can somebody get me on the right trail!?
LB
PS: Here's my code:
# SimpleCOMServer.py - A sample COM server almost as small as they come!
#
# We expose a single method in a Python COM object.
class PythonUtilities:
_public_methods_ = [ 'SplitString' ]
_reg_progid_ = "PythonDemos.Utilities"
# NEVER copy the following ID
# Use "print pythoncom.CreateGuid()" to make a new one.
_reg_clsid_ = '{CFFCC2C2-3826-11D5-9EF2-00105A5E9EA0}'
def SplitString(self, val, item=None):
import string
if item != None: item = str(item)
return string.split(str(val), item)
#return string.split(val, item)
# Add code so that when this script is run by
# Python.exe, it self-registers.
if __name__=='__main__':
print "Registering COM server. . ."
import win32com.server.register
win32com.server.register.UseCommandLine(PythonUtilities)
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython