batch_get_real_image_urls.py 博源
if os.path.exists(g_xmls_folder):
total=len(set(glob.glob(g_filter)))
print "total lines:%s"%total
if os.path.exists(g_success_file):
successed=len(set(open(g_success_file,"r").read().strip().split('\n')))
print "successed lines:%s"%successed
print "left lines:%s"%(total-successed)
return total,successed
def process_forever():
"循环处理,直到全部完成"
total,successed=count()
while (total-successed)>0:
process_continue()
total,successed=count()
if __name__=="__main__":
init()
l=len(sys.argv)
dict = {
"batch" :batch_get_real_image_urls,
"continue" :process_continue,
"clear" :clear,
"loop" :process_forever,
}
if l==2:
argv=sys.argv[1].strip()
if argv in dict:
dict[argv]()
else:
for k,v in dict.iteritems():
print k,v.__doc__
print "done!"
查看更多关于batch_get_real_image_urls.py 博源的详细内容...