Re: Issue with subprocess Module

2009-04-07 Thread Tim Golden
Tim Golden wrote: So it looks as though the MS docs are simply wrong? I haven't tried it with ctypes or a native C program, but I can't see that they should be any different. If I get a chance later I'll knock something up in C. OK, copying the standard MS example for creating a process: http

Re: Issue with subprocess Module

2009-04-07 Thread Tim Golden
Tim Golden wrote: Sounds reasonable, but isn't actually true. This works fine: import subprocess open ("t.bat", "w").write ("echo hello") subprocess.Popen ("t.bat") TJG Dave Angel wrote: The docs of Popen() state that it uses CreateProcess() on Windows, so I didn't even try it. I o

Re: Issue with subprocess Module

2009-04-07 Thread R. David Murray
Tim Golden wrote: > tarun wrote: > > Hello All, > > > > I've a batch file to be invoke using a python script. The batch file has > > pause, and the time, I need to send some command to the batch file from my > > scripts. I placed both, the batch file (test.bat) and the python script > > (test.py

Re: Issue with subprocess Module

2009-04-07 Thread Dave Angel
Tim Golden wrote: Dave Angel wrote: tarun wrote: Hello All, I've a batch file to be invoke using a python script. The batch file has pause, and the time, I need to send some command to the batch file from my scripts. I placed both, the batch file (test.bat) and the python script (test.py)

Re: Issue with subprocess Module

2009-04-07 Thread MRAB
Tim Golden wrote: tarun wrote: Hello All, I've a batch file to be invoke using a python script. The batch file has pause, and the time, I need to send some command to the batch file from my scripts. I placed both, the batch file (test.bat) and the python script (test.py) in the same folder.

Re: Issue with subprocess Module

2009-04-07 Thread Tim Golden
tarun wrote: Hello All, I've a batch file to be invoke using a python script. The batch file has pause, and the time, I need to send some command to the batch file from my scripts. I placed both, the batch file (test.bat) and the python script (test.py) in the same folder. And executed 'test.py

Re: Issue with subprocess Module

2009-04-07 Thread Tim Golden
Dave Angel wrote: tarun wrote: Hello All, I've a batch file to be invoke using a python script. The batch file has pause, and the time, I need to send some command to the batch file from my scripts. I placed both, the batch file (test.bat) and the python script (test.py) in the same folder.

Re: Issue with subprocess Module

2009-04-07 Thread Albert Hopkins
On Tue, 2009-04-07 at 07:53 -0400, Dave Angel wrote: > > > subprocess.Popen() is expecting the name of a program, which should > normally have an extension of .exe You're handing it a .bat file, > which is not executable. It only executes in the context of a command > interpreter (shell),

Re: Issue with subprocess Module

2009-04-07 Thread Dave Angel
tarun wrote: Hello All, I've a batch file to be invoke using a python script. The batch file has pause, and the time, I need to send some command to the batch file from my scripts. I placed both, the batch file (test.bat) and the python script (test.py) in the same folder. And executed 'test.py

Issue with subprocess Module

2009-04-07 Thread tarun
Hello All, I've a batch file to be invoke using a python script. The batch file has pause, and the time, I need to send some command to the batch file from my scripts. I placed both, the batch file (test.bat) and the python script (test.py) in the same folder. And executed 'test.py' (Please find