multiThreadDownload.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:ThesaurusSpider 作者: WuLC 项目源码 文件源码
def downloadSingleType(bigCate,smallCate,baseDir):
    """
    ??????????????????????????????????????????
    :param bigCate:   ????
    :param smallCate: ????
    :param baseDir:   ????
    :return: None
    """
    global smallCateURL, downloadDir, queue, logFile
    smallCateURL = 'http://dict.qq.pinyin.cn/dict_list?sort1=%s&sort2=%s' %(urllib2.quote(bigCate), urllib2.quote(smallCate))  # url??
    if baseDir[-1] == '/':
        print '?? '+baseDir+' ?????/'
        return
    downloadDir = baseDir+'/'+bigCate+'/'+smallCate
    logFile = baseDir+'/download.log'
    if not os.path.exists(downloadDir.decode('utf8')):  # ????????????
        os.makedirs(downloadDir.decode('utf8'))
    queue.put(smallCateURL)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号