Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #COM_HelloWorld.py
- class HelloWorld:
- _reg_clsid_ = "{BC0212DE-F1AF-4626-9E35-424CC4723C02}"
- _reg_desc_ = "Python Test COM Server - Hello World"
- _reg_progid_ = "zzPython.HelloWorldServer"
- _public_methods_ = ['Hello']
- _public_attrs_ = ['softspace', 'noCalls']
- _readonly_attrs_ = ['noCalls']
- def __init__(self):
- self.softspace = 1
- self.noCalls = 0
- def Hello(self, who):
- self.noCalls = self.noCalls + 1
- # insert "softspace" number of spaces
- return "Hello" + " " * self.softspace + who
- if __name__=='__main__':
- import win32com.server.register
- win32com.server.register.UseCommandLine(HelloWorld, debug=1)
Advertisement
Add Comment
Please, Sign In to add comment