[Tutor] df type function in python

Spencer Parker inthefridge at gmail.com
Wed Jan 7 19:36:53 CET 2009


What I did was just grep for anything starting with "/"

It then just outputs it to a single line now...and I can split it as
needed.  Thanks again!!1

On Wed, Jan 7, 2009 at 11:33 AM, Kent Johnson <kent37 at tds.net> wrote:

> 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
>



-- 
Spencer Parker
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090107/1b96d120/attachment.htm>


More information about the Tutor mailing list