Hi,
What you are looking for is probably
urllib2,
as it supports authentification and http over TLS.
A few other tips... This code:
used = float(outtext.split()[0])
total = float(outtext.split()[1])
could be expressed as:
used, total = [float(num) for num in outtext.split()]
And in fact, since you did let Python garbage collect the
pipe anyway, you coud just have done:
used, total = [float(num) for num in os.popen('{%s;} 2>&1 ' % cmd, 'r').read() ]
You should also use some exception handling to avoid crahes
when the information cannot be retrieved, just displaying
some "Data not available" message then...