Problem - Win32 Programming

F

Finger.Octopus

Hi ..

I'm a newbie to python win32 programming. I was just reading Python
Programming on Win32 and I was trying to run this program:

# 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_ = "{41E24E95-D45A-11D2-852C-204C4F4F5020}"

def SplitString(self, val, item=None):
import string
if item != None: item = str(item)
return string.split(str(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)


I am using Python 2.5 and it says:

Traceback (most recent call last):
File "E:/PyEN/PythonUtilities.py", line 20, in <module>
import win32com.server.register
ImportError: No module named win32com.server.register
 
R

Roger Upole

Hi ..

I'm a newbie to python win32 programming. I was just reading Python
Programming on Win32 and I was trying to run this program:

# 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_ = "{41E24E95-D45A-11D2-852C-204C4F4F5020}"

def SplitString(self, val, item=None):
import string
if item != None: item = str(item)
return string.split(str(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)


I am using Python 2.5 and it says:

Traceback (most recent call last):
File "E:/PyEN/PythonUtilities.py", line 20, in <module>
import win32com.server.register
ImportError: No module named win32com.server.register

Have you installed the Pywin32 extensions from here:
http://sourceforge.net/projects/pywin32/ ?

Roger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top