johnny wrote:

> Can someone tell me what is the reason "[0]" appears after
> ".communicate()"
> 
> For example:
> last_line=subprocess.Popen([r"tail","-n 1", "x.txt"],
> stdout=subprocess.PIPE).communicate()[0]

as explained in the documentation, communication() returns two values, 
as a tuple.  [0] is used to pick only the first one.

see the Python tutorial for more on indexing and slicing.

</F>

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to