Comment faire pour capturer la sortie de Curl à partir du script Python

Je veux trouver l'info sur une page web à l'aide de curl, mais en Python, pour l'instant j'ai ceci:

os.system("curl --head www.google.com")

Si je lance ce, il imprime:

HTTP/1.1 200 OK
Date: Sun, 15 Apr 2012 00:50:13 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: PREF=ID=3e39ad65c9fa03f3:FF=0:TM=1334451013:LM=1334451013:S=IyFnmKZh0Ck4xfJ4; expires=Tue, 15-Apr-2014 00:50:13 GMT; path=/; domain=.google.com
Set-Cookie: NID=58=Giz8e5-6p4cDNmx9j9QLwCbqhRksc907LDDO6WYeeV-hRbugTLTLvyjswf6Vk1xd6FPAGi8VOPaJVXm14TBm-0Seu1_331zS6gPHfFp4u4rRkXtSR9Un0hg-smEqByZO; expires=Mon, 15-Oct-2012 00:50:13 GMT; path=/; domain=.google.com; HttpOnly
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked

Ce que je veux faire, c'est d'être en mesure de correspondre à du 200 à l'aide d'une regex (je n'ai pas besoin d'aide avec ça), mais je ne peux pas trouver un moyen de convertir tout le texte ci-dessus dans une chaîne de caractères. Comment dois-je faire?
J'ai essayé: info = os.system("curl --head www.google.com") mais info était juste 0.

source d'informationauteur Billjk