[Tutor] df type function in python

Kent Johnson kent37 at tds.net
Wed Jan 7 19:33:40 CET 2009


On Wed, Jan 7, 2009 at 1:08 PM, Spencer Parker <inthefridge at gmail.com> wrote:
> Is there anyway to get rid of the header information?  I just want the
> output that it gives me for the device.

If you know how to get the output of df into Python (e.g. with the
subprocess module or a pipe) then you can use the str.splitlines()
method to divide it into lines and pick out the line you want.

Kent


More information about the Tutor mailing list