470,811 Members | 1,129 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,811 developers. It's quick & easy.

Problem - Win32 Programming

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(PythonUtil ities)
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

Feb 9 '07 #1
2 1805
What shoud I do to fix it?

Feb 9 '07 #2

<Fi************@gmail.comwrote in message news:11*********************@p10g2000cwp.googlegro ups.com...
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(PythonUtil ities)
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


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Feb 9 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Piet | last post: by
5 posts views Thread by Bryan Parkoff | last post: by
6 posts views Thread by Pawel | last post: by
16 posts views Thread by Phill | last post: by
6 posts views Thread by Can Balioglu | last post: by
1 post views Thread by new to VC++ | last post: by
6 posts views Thread by Rajesh | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.