很简单,做下记录

import urllib
import os

url = "图片路径"

dir = "d:\\pyimgtest\\G0000001\\"

if not os.path.exists(dir):
    os.makedirs(dir)
    print 'not exist and create'


res2 = urllib.urlretrieve(url,dir + os.path.basename(url));

 

py3:

import urllib.request

urllib.request.urlretrieve(..

 

 转载请注明博客出处:http://www.cnblogs.com/cjh-notes/

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2022-02-26
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
猜你喜欢
  • 2021-12-05
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-11-13
  • 2021-07-23
相关资源
相似解决方案