<div>Hi Gurus,</div>
<div> </div>
<div>I'm new to Python programming and in the process of learning the sub process module.</div>
<div> </div>
<div>I went through the python documentation <a href="http://docs.python.org/library/subprocess.html">http://docs.python.org/library/subprocess.html</a> and I have the following queries</div>
<div> </div>
<div>1. The class definition as per the documentation is: </div>
<div><em>class </em><tt class="descclassname">subprocess.</tt><tt class="descname">Popen</tt><big><font size="4">(</font></big><em>args</em>, <em>bufsize=0</em>, <em>executable=None</em>, <em>stdin=None</em>, <em>stdout=None</em>, <em>stderr=None</em>, <em>preexec_fn=None</em>, <em>close_fds=False</em>, <em>shell=False</em>, <em>cwd=None</em>, <em>env=None</em>, <em>universal_newlines=False</em>, <em>startupinfo=None</em>, <em>creationflags=0</em><big><font size="4">)</font></big></div>

<div><big><em>args</em> should be a string, or a sequence of program arguments. </big></div>
<div><big></big> </div>
<div><big>so I assume that args can be a string or a list with first item of the list being the program to execute.</big></div>
<div><big></big> </div>
<div><big>so on the python IDLE, I executed this command, </big></div>
<div><big></big> </div>
<div><big>>>> subprocess.Popen('cmd.exe')<br><subprocess.Popen object at 0x00F5AA50> which opened up a command prompt. </big></div>
<div><big></big> </div>
<div><big>when I give this as a list, as below it throwed this error.</big></div>
<div><big></big> </div>
<div><big>>>> subprocess.Popen(['cmd.exe', 'dir'])</big></div>
<div><big>Traceback (most recent call last):<br>  File "<pyshell#29>", line 1, in <module><br>    subprocess.Popen(['cmd.exe' 'dir'])<br>  File "C:\Python26\lib\subprocess.py", line 623, in __init__<br>
    errread, errwrite)<br>  File "C:\Python26\lib\subprocess.py", line 833, in _execute_child<br>    startupinfo)<br>WindowsError: [Error 2] The system cannot find the file specified<br>>>>      </big></div>

<div><big></big> </div>
<div><big></big><font size="3">I would assume that a list is accepted as part of the args and first being the program (cmd.exe) and the rest being the arguments... please correct me If i misunderstood.</font></div>
<p>Thanks,</p>
<div><br clear="all"><br>-- <br>Vijay Swaminathan<br></div>