Did I find the right examples for you? yes no

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)

src/d/i/digsby-HEAD/installer/py2exe/py2exe/samples/singlefile/comserver/test.py   digsby(Download)
import sys
from win32com.client import Dispatch
 
d = Dispatch("Python.Interpreter")
print "2 + 5 =", d.Eval("2 + 5")
d.Exec("print 'hi via COM'")
 
d.Exec("import sys")
 
print "COM server sys.version", d.Eval("sys.version")
print "Client sys.version", sys.version
 
print "COM server sys.path", d.Eval("sys.path")
print "Client sys.path", sys.path
 

src/d/i/digsby-HEAD/installer/py2exe/py2exe/samples/pywin32/com_server/test_interp.py   digsby(Download)
interp.Exec("import sys")
 
print "The COM object is being hosted in ", interp.Eval("sys.executable")
print "Path is:", interp.Eval("sys.path")