14 lines
437 B
Python
14 lines
437 B
Python
#save this file to disk as PythonCOMLib.py
|
|
|
|
class PythonClass1(object):
|
|
_reg_clsid_ = "{82CF48D3-6826-4FE0-94A6-8EFF656998FB}"
|
|
_reg_progid_= 'PythonLib1.PythonClass1'
|
|
_public_methods_ = ['Greeting']
|
|
|
|
def Greeting(self):
|
|
return "Hello world"
|
|
|
|
if __name__=='__main__':
|
|
print ("Registering COM server...")
|
|
import win32com.server.register
|
|
win32com.server.register.UseCommandLine(PythonClass1) |