Python split and merge the line
<pre><code>df = subprocess.Popen(["df", options.partname], stdout=subprocess.PIPE)
output = df.communicate()[0]
print output
</code></pre>

<p>gives the following:</p>

<pre><code>Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/sys-scratch
                     1446412616 847216452 524555652  62% /scratch
</code></pre>

<p>In some cases (machines), </p>

<pre><code>output.split("\n")[1] 
</code></pre>

<p>gives me </p>

<pre><code>/dev/mapper/sys-scratch
</code></pre>

<p>where as I want</p>

<pre><code>/dev/mapper/sys-scratch 1446412616 847216452 524555652  62% /scratch  # in one line
</code></pre>

<p>I am using the values in the output like this :</p>

<pre><code>device, size, used, available, percent, mountpoint = output.split("\n")[1].split()
</code></pre>

<p>For some machines, this fails because <code>output.split("\n")[1]</code> only has a single value. How can I fix this ?</p>
