非线程安全
线程安全
python中还有更简洁的方法:
import urllib
url = “http://www.udooo.com/cooperate/qq/images/081128/left.swf”
path = “c:/spider/left.swf”
data = urllib.urlopen(url).read()
f = file(path,”wb”)
f.write(data)
f.close()
线程安全
python中还有更简洁的方法:
import urllib
url = r”http://www.udooo.com/cooperate/qq/images/081128/left.swf”
path = r”c:/spider/left2.swf”
data = urllib.urlretrieve(url,path)