473,473 Members | 2,032 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1924
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Piet | last post by:
Hi all, I started programming (or hacking) python some time ago. Since python offers a lot of Win32 specific extensions and since my OS will probably stay Win2k for the next time, I would like to...
3
by: gerald.maher | last post by:
Hi, I am trying to excuate the follwong code: I get the following error: Here is my Lib path:
5
by: Bryan Parkoff | last post by:
Please provide me the information when it is not in the correct newsgroups. I have been using C and C++ language for a long time when it is time for me to learn Win32 API functions that they can...
6
by: Pawel | last post by:
Ary you know tools to convert MSIL code (Assembly) to Win32 (not Just In Time)?
16
by: Phill | last post by:
I'm still new to .NET and come from a win32 background. I'm happy w/ what I see in .NET although it is a little slower than I'd like. It also has a nice oo design and C# is a wonderful language...
6
by: Can Balioglu | last post by:
Hi everyone, My question is not a technical one. I'm just curious about the future of Win32 (and Win64) programming. Most of the books about Win32 from MS Press (like Programming Windows,...
1
by: new to VC++ | last post by:
i've been developing code in turbo C++ in a DOS based environment . Now that i've finally shifted to Visual C++ , i really can't get my old programs to work . I realised everything has changed ....
6
by: Rajesh | last post by:
I am a System Administrator and do some programming (Admin Utlities) in VB6 & C#.net. I am interested in Win32 and thought of learning C++ (as it is a pre-requsite) and read 13 chapters from C++.Net...
3
by: Gil | last post by:
I need to create a web page in which its content should be controlled by some win32 application. this application may add or remove some gif images from the page and it should be smooth as possible...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.