Unable to start a process with subprocess Popen()

dudeja.rajat at gmail.com dudeja.rajat at gmail.com
Mon Sep 8 13:23:05 CEST 2008

On Mon, Sep 8, 2008 at 11:50 AM,  <dudeja.rajat at gmail.com> wrote:
> Hi,
> I'm using the subprocess module's Popen() to start a batch file. This
> batch file basically calls an exe which also gets started.
> Unfortunately, this does not produce any results. I looked into the
> Task bar that this exe has started but it does not consume and cpu so
> I believet that this exe is not working.
> I used the following command to start the batch fiile:
> testing = subprocess.Popen([batchFilePath], \
>                                   shell = True, \
>                                   stdout = subprocess.PIPE, \
>                                   stderr = subprocess.PIPE).communicate()[0]
> batchFilePath is the path of the batch file.
> --
> Regrads,
> Rajat

Ok, I re-phrase my question:

there is a batch file that executes a exe file. The batch just works
if run from command prompt and produces output to standard output and
the file.

Now, I try to call the same batch file from subprocess.Pope() call.
The batch file gets called and that internally also calls the exe

But, the exe just runs forever i.e. hangs and does not produces output
, atleast not to the file.

Please suggest is there is something wrong with the above code.


More information about the Python-list mailing list