Re: Looking for Pythonic Examples
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: Looking for Pythonic Examples

From: Ido Yehieli <Ido.Yehieli@gmail.com>
Date: Tue Feb 28 2006 - 20:55:07 CET

This one is from our very own BDFL, behold- wget implemented in 7 lines
of python code:

import sys, urllib
def reporthook(*a): print a
for url in sys.argv[1:]:
     i = url.rfind('/')
     file = url[i+1:]
     print url, "->", file
     urllib.urlretrieve(url, file, reporthook)
Received on Sun Apr 30 10:30:16 2006