[Tutor] Running an exe from Python
Nagendra Singh
singh01 at gmail.com
Thu Feb 22 20:14:14 CET 2007
Hi,
I am trying to learn Python and have no prior programming experience. My
problem is that I am trying to call an .exe through Python, the exe gives
certain information about a file when I simply type it at the command
prompt, something like C:> getinfo C:\Singh\abc.bcd and it displays the
information about abc.bcd in the command window. I am trying to do the same
thing through Python ( i downloaded it from activestate)
Here is what I tried :
import os
file1 = r 'C:\Program Files\Tools1\bin\getinfo.exe' 'C:\Singh\abc.bcd'
os.system(file1)
What it does is that opens and closes the command window really fast and
displays a value of 1 in the interpreter. How can I get python to display
the results in the interactive window or what is the right way to do this.
thanks in advance,
Singh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070222/511e5d46/attachment.htm
More information about the Tutor
mailing list