Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Problem with subprocess.Popen()

Reply
Thread Tools

Problem with subprocess.Popen()

 
 
The Cruisemaniac
Guest
Posts: n/a
 
      08-01-2007
Hi all,

I'm trying to run a windows batch file from a python script using
subprocess.popen().

The issue that I'm facing is that, if i give the batch file as
parameter to the popen function, the script runs, but if i provide a
parameter, it is not working.

Can someone help me with the command.

The actual windows command to be executed is:

test.bat -t ABC_DE_FG_HI_001 "C:\ABCDEFGHIJKLMNOP.TXT"

What is the actual parameter required for subprocess.Popen(parameter
chain) in this case??

Kindly help me out...

Regards and Thanks in advance...
Ashwin Murali.

 
Reply With Quote
 
 
 
 
O.R.Senthil Kumaran
Guest
Posts: n/a
 
      08-01-2007
> I'm trying to run a windows batch file from a python script using
> subprocess.popen().
>
> The issue that I'm facing is that, if i give the batch file as
> parameter to the popen function, the script runs, but if i provide a
> parameter, it is not working.
>
> The actual windows command to be executed is:
>
> test.bat -t ABC_DE_FG_HI_001 "C:\ABCDEFGHIJKLMNOP.TXT"


do something like:
subprocess.Popen(r'test.bat -t ABC_DE_FG_HI_001
"C:\ABCDEFGHIJKLMNOP.TXT",shell=True)

This is same as doing os.system()

If even this results in any error (post back the error message) and try
setting the executable argument explicit.

subprocess.Popen(r'test.bat -t ABC_DE_001
"C:\ABCD.TXT",executable="test.bat",shell=True )


--
O.R.Senthil Kumaran
http://uthcode.sarovar.org
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem problem problem :( Need Help Mike ASP General 2 05-11-2004 08:36 AM



Advertisments