473,473 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

FW: executing VBScript from Python and vice versa

Thanks for the reply. I already have "Learning Python" from Mark Lutz and
David Ascher, which covers 2.3 (I am in 2.4). However, it seems like heavy
artillery to me. What I want is, for instance, run a VBScript to get a
function output and feed it to the Python script that called it. The reason
is that because I feel more comfortable with VBScript and have written a
small library of useful utilities, I don't want it to become obsolete. In
the mean time I did more reading and found a couple of prospective
alternatives - popen and os.system(command). Still need to work out how to
use them...

-----Original Message-----
From: aurora [mailto:au******@gmail.com]
Sent: Friday, February 04, 2005 3:28 PM
To: py*********@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.

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 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.

Jul 18 '05 #1
1 4983
PythonWin 2.3.4 (#53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)]
on win32.
Portions Copyright 1994-2004 Mark Hammond (mh******@skippinet.com.au) -
see 'Help/About PythonWin' for further copyright information.
from win32com.client import Dispatch
x = Dispatch("MSScriptControl.ScriptControl")
x.Language='VBScript'
x.AddCode("""Function HelloWorld .... HelloWorld = "hello world"
.... End Function
.... """)
x.Eval("HelloWorld") u'hello world'

Valentina Boycheva wrote: Thanks for the reply. I already have "Learning Python" from Mark Lutz and
David Ascher, which covers 2.3 (I am in 2.4). However, it seems like heavy
artillery to me. What I want is, for instance, run a VBScript to get a
function output and feed it to the Python script that called it. The reason
is that because I feel more comfortable with VBScript and have written a
small library of useful utilities, I don't want it to become obsolete. In
the mean time I did more reading and found a couple of prospective
alternatives - popen and os.system(command). Still need to work out how to
use them...

-----Original Message-----
From: aurora [mailto:au******@gmail.com]
Sent: Friday, February 04, 2005 3:28 PM
To: py*********@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.

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 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.


Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Valentina Boycheva | last post by:
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...
1
by: Dharmendra Singh | last post by:
Hi I'm using .Net(C#) and working on the form(Screen) which have text boxes for both arabic and english data to store. So i want to change the language at run time from arabic to english and...
4
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck...
6
by: David | last post by:
Hi, I have a script in one of my .asp pages which I think is written in VBScript (I did not write it). I would like to know how to do the following in Javascript. Have a combo on my page...
2
by: Steve - DND | last post by:
Just wondering if anyone out there has any code to convert a plural word to it's singular form and vice versa. Most of our database tables are named in a plural fashion. When we go to create...
112
by: mystilleef | last post by:
Hello, What is the Pythonic way of implementing getters and setters. I've heard people say the use of accessors is not Pythonic. But why? And what is the alternative? I refrain from using them...
1
by: r_o | last post by:
hi, im using FileSystemObject's File object to create an html file and write it to the webserver's disk and then send it as a mail attachment. final_draft="<!DOCTYPE html PUBLIC ""-//W3C//DTD...
1
by: Cameron Laird | last post by:
QOTW: "... ow that I've made the switch to python, I'm several orders of magnitude more productive ..." - Rob Knapp http://groups.google.com/group/comp.lang.python/msg/8a4efd549bfb451a "Hanging...
20
by: Mr.SpOOn | last post by:
Hi, I need a structure to represent a set of integers. I also need to perform on this set some basic set operations, such as adding or removing elements, joining with other sets and checking for...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.