Valentina Boycheva wrote:
Is there a way to make programs written in these two languages communicate
with each other? I am pretty sure that VBScript can access a Python script
because Python is COM compliant. On the other hand, Python might be able to
call a VBScript through WSH. Can somebody provide a simple example? I have
exactly 4 days of experience in Python (and fortunately, much more in VB6)

Thanks.


This should help for Python accessing VBScript,

>>> import win32com.client
>>> vbhost = win32com.client.Dispatch("ScriptControl")
>>> vbhost.language = "vbscript"
>>> vbhost.addcode("Function two(x)\ntwo=2*x\nEnd Function\n")
>>> vbhost.eval("two(2)")
4
>>>

Alternatively you could try to convert your VBScript to Python.

http://vb2py.sourceforge.net/demo.htm

Regards,

Paul
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to