A while ago I asked how VBScript can be called from Python. The two answers
I received suggested using win32com.client and
MSScriptControl.ScriptControl. This solution required embedding the VBScript
code inside the Python script.
Here's a shell approach that runs an existing VBScript file:
Thanks to Michel Claveau and Paul Paterson for providing examples on how to
use ScriptControl to embed VBScript in Python script. I've only tried this
once before on another occasion and it was fascinating to see how a function
generates another function!
Valentina
--
Cool. :-)
And it's OK, also, for JScript (MS-Javascript) :
import win32com.client
vbs = win32com.client.Dispatch(ScriptControl)
vbs.language = vbscript
scode=Function mul2(x)
mul2=x*2
End Function
vbs.addcode(scode)
print vbs.eval(mul2(123))
js = win32com.client.Dispatch(ScriptControl)
Subject: Re: executing VBScript from Python and vice versa
Go to the bookstore and get a copy of Python Programming on Win32
by Mark Hammond, Andy Robinson today.
http://www.oreilly.com/catalog/pythonwin32/
It has everything you need.
Is there a way to make programs written in these two languages
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
Go to the bookstore and get a copy of Python Programming on Win32
by Mark Hammond, Andy Robinson today.
http://www.oreilly.com/catalog/pythonwin32/
It has everything you need.
Is there a way to make programs written in these two languages
communicate
with each other? I am pretty sure that
...
-Original Message-
From: aurora [mailto:[EMAIL PROTECTED]
Sent: Friday, February 04, 2005 3:28 PM
To: python-list@python.org
Subject: Re: executing VBScript from Python and vice versa
Go to the bookstore and get a copy of Python Programming on Win32
by Mark Hammond, Andy Robinson today
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