Como ya he dicho, se puede instalar desde pypi.
Y no. no viene por defecto en python. Con las bibliotecas estandar tambien
hay maneras de hacerlo pero son  mucho mas laboriosas.

Andrei.

El 7 de febrero de 2012 16:07, Julian A. Charon Macias <
[email protected]> escribió:

> ---------- Mensaje Original ----------
> A: Julian A. Charon Macias ([email protected])
> De: Andrey Antoukh ([email protected])
> Asunto: [***SPAM*** Score/Req: 05.70/5.0] Re: [Python-es] obtener tamaño
> fichero en URL
> Fecha: 7/2/2012 9:47:26p
>
> [[email protected]][~]% python2
> Python 2.7.2 (default, Nov 21 2011, 17:25:27)
> [GCC 4.6.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import requests
> >>> requests.head
> <function head at 0x15ea1b8>
> >>> response = requests.head("
> http://mirror.aarnet.edu.au/pub/archlinux/iso/2011..08.19/archlinux-2011.08.19-core-dual.iso
> ")
>  >>> response.headers
> {'last-modified': 'Fri, 19 Aug 2011 10:24:52 GMT', 'content-length': '
> 705691648', 'etag': '"501df5-2a100000-4aad923cb6500"', 'date': 'Tue, 07
> Feb 2012 20:45:27 GMT', 'accept-ranges': 'bytes', 'content-type':
> 'application/octet-stream', 'server': 'Apache/2.2.3 (Red Hat)'}
>  >>> int(response.headers['content-length'])/1024.0/1024.0
> 673.0
>
> Creo que con esto podria bastarte.La biblioteca que uso es requests.
> Puedes instalarla desde pypi.
>
> El día 7 de febrero de 2012 15:34, Julian A. Charon Macias <
> [email protected]> escribió:
>  > Un saludo, como puedo obtener el tamaño(ej. 40 Mb)  de un fichero que
> este publicado en una direccion URL, mediante Python.
> > creo que utilizando el modulo URLLIB, pero no veo como.
> >
> >
> >
>  >
>  >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> > Lic. Julián A. Charón Macias
> > Tel.  : 0294436
> > A legendary Informatic
> >
> >
> >
>  >
> >
> > UNIVERSIDAD DE GUANTÁNAMO
> >
> >
> > _______________________________________________
> > Python-es mailing list
> > [email protected]
>  > http://mail.python.org/mailman/listinfo/python-es
> > FAQ: http://python-es-faq.wikidot.com/
>
>
>
> --
> Andrei Antoukh - <[email protected]>
> http://www.niwi..be/page/about/
> http://www.kaleidos.net/A5694F/
>
> "Linux is for people who hate Windows, BSD is for people who love UNIX"
> "Social Engineer -> Because there is no patch for human stupidity"
>
>
>
> Pero... esta biblioteca no viene de facto con Python?
> Probe pero no vi resultados, me arroja mensaje que el modulo no existe,
> estoy usando Python 2.7.2 sobre win2.
>
> alguna idea?
>
>
>
>
>
>
>
>
>
>
>
>
> --
> Lic. Julián A. Charón Macias
> Tel.  : 0294436
> A legendary Informatic
>
>
>
>
>
> UNIVERSIDAD DE GUANTÁNAMO
>
>
> _______________________________________________
> Python-es mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/python-es
> FAQ: http://python-es-faq.wikidot.com/
>



-- 
Andrei Antoukh - <[email protected]>
http://www.niwi.be/page/about/
http://www.kaleidos.net/A5694F/

"Linux is for people who hate Windows, BSD is for people who love UNIX"
"Social Engineer -> Because there is no patch for human stupidity"
_______________________________________________
Python-es mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-es
FAQ: http://python-es-faq.wikidot.com/

Responder a