Jump to content
YOUR-AD-HERE
HOSTING
TOOLS
992Proxy

Locked [Python] Descargando Archivos


Expermicid

Recommended Posts

Hola a todos.

 

Aca vengo a dejar un pequeño codigo en donde con pequeñas lineas pordemos descargar un archivo usando la libreria URLLIB.

 

Veamos el codigo:

 

[lenguaje=python]#!/usr/bin/env python

 

##################################################

## ##

## Descargando archivo usando Urllib ##

## Fecha: 15/10/12 ##

## By Expermicid ##

## ##

##################################################

 

# importamos libreria 'urllib'

import urllib

 

# pedimos por consola la url del archivo a descargar

url = raw_input("Introduzca la URL para descargar > ")

# pedimos por consola el nombre del archivo para guardar

nombre = raw_input("Introduzca el nombre con el cual se guardara el archivo > ")

 

# realizamos la descarga

archivo = urllib.urlretrieve(url,nombre)[/lenguaje]

 

This is the hidden content, please

 

Saludos

Edited by Expermicid
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.