def convert_to_demo_ids(match_ids, threads):
# Tell the user what is happening
print "Converting Match IDs to Demo IDs"
# Define the number of threads
pool = ThreadPool(threads)
# Calls get_demo_ids() and adds the value returned each call to an array called demo_ids
demo_ids = pool.map(get_demo_ids, match_ids)
pool.close()
pool.join()
# Create an array to add any captured errors to
errors = []
# Find any errors, add them to the errors array, and remove them from demo_ids
for text in demo_ids:
if " " in text:
errors.append(text[1:])
demo_ids.remove(text)
# Print the errors (if there are any)
print_errors(errors)
return demo_ids
评论列表
文章目录