Hola, Si el ambiente en el cual se va a ejecutar la herramienta utiliza un servidor proxy para el acceso a Internet, es necesario configurar los parámetros del servidor proxy, para los protocolos http y https, mediante la creación de las siguientes variables de entorno:
http_proxy: su valor es la dirección y puerto del servidor proxy. Por ejemplo, http://proxy.domain.co:8080 https_proxy: su valor es la dirección y puerto del servidor proxy. Por ejemplo, https://proxy.domain.co:8080 2012/2/24 Julian A. Charon Macias <julia...@fam.cug.co.cu>: > Sldos, he podido obtener el tamaño de un fichero ubicado en una direccion URL > utilizando el modulo URLLIB como me dijo d...@danigm.net: > > ahora quiero obtener desde otra URL, pero para llegar es a traves de un > PROXY, como especifico un proxy? > > > > > > > ---------- Mensaje Original ---------- > A: La lista de python en castellano (python-es@python.org) > De: Alvaro Manrique (sanreikaj.fo...@gmail.com) > Asunto: Re: [Python-es] obtener tamaño fichero en URL > Fecha: 8/2/2012 3:34:48p > > > > Buenos días, > > Usando estas librerías hay manera de obtener un listado se archivos, es > decir, si no se el nombre exacto pero si su extencion?? > > Muchas gracias por el aporte. El 07/02/2012 17:31, "Daniel Garcia" > <d...@danigm.net> escribió: > Lo mismo con las librerías estandar: > > import sys > if sys.version_info.major == 3: > import http.client as httplib > else: > import httplib > > c = httplib.HTTPConnection("mirror.aarnet.edu.au") > c.request("GET", > "/pub/archlinux/iso/2011.08.19/archlinux-2011.08.19-core-dual.iso") > response = c.getresponse() > size = response.getheader('Content-Length') > > On Tue, Feb 07, 2012 at 10:12:13PM +0100, Andrey Antoukh wrote: > > 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 < > > julia...@fam.cug.co.cu> escribió: > > > > > ---------- Mensaje Original ---------- > > > A: Julian A. Charon Macias (julia...@mail.python.org) > > > De: Andrey Antoukh (and...@gmail.com) > > > Asunto: [***SPAM*** Score/Req: 05.70/5.0] Re: [Python-es] obtener tamaño > > > fichero en URL > > > Fecha: 7/2/2012 9:47:26p > > > > > > [n...@vaio.niwi.be][~]% 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 < > > > julia...@fam.cug.co.cu> 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 > > > > Python-es@python.org > > > > http://mail.python.org/mailman/listinfo/python-es > > > > FAQ: http://python-es-faq.wikidot.com/ > > > > > > > > > > > > -- > > > Andrei Antoukh - <n...@niwi.be> > > > 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 > > > Python-es@python.org > > > http://mail.python.org/mailman/listinfo/python-es > > > FAQ: http://python-es-faq.wikidot.com/ > > > > > > > > > > > -- > > Andrei Antoukh - <n...@niwi.be> > > 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 > > Python-es@python.org > > http://mail.python.org/mailman/listinfo/python-es > > FAQ: http://python-es-faq.wikidot.com/ > > > -- > Daniel Garcia 0034 668 810 742 > It's not magic, it's wadobo! > http://wadobo.com > > _______________________________________________ > Python-es mailing list > Python-es@python.org > http://mail.python.org/mailman/listinfo/python-es > FAQ: http://python-es-faq.wikidot.com/ > > > > > > > > > > > > > > > > > > > -- > Lic. Julián A. Charón Macias > Tel. : 0294436 > A legendary Informatic > > > > > > UNIVERSIDAD DE GUANTÁNAMO > > > _______________________________________________ > Python-es mailing list > Python-es@python.org > http://mail.python.org/mailman/listinfo/python-es > FAQ: http://python-es-faq.wikidot.com/ _______________________________________________ Python-es mailing list Python-es@python.org http://mail.python.org/mailman/listinfo/python-es FAQ: http://python-es-faq.wikidot.com/