google_image_crawler.py 文件源码

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

项目:HandDetection 作者: YunqiuXu 项目源码 文件源码
def load_all_url_files(_dir, file_name_prefix):
    url_list = []

    for file_name in os.listdir(_dir):
        if fnmatch.fnmatch(file_name, file_name_prefix +'*.txt'):
            file_name = osp.join(_dir, file_name)
            fp_urls = open(file_name, 'r')        #Open the text file called database.txt
            print 'load URLs from file: ' + file_name

            i = 0
            for line in fp_urls:
                line = line.strip()
                if len(line)>0:
                    splits = line.split('\t')
                    url_list.append(splits[0].strip())
                    i=i+1
            print str(i) + ' URLs loaded'
            fp_urls.close()

    return url_list         
########### End of Functions to Load downloaded urls ###########

############## Functions to get date/time strings ############
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号