I have the following code:
def upload_to_s3(filepath, unique_id):
# do something
print s3_url # <-- Confirming that this `s3_url` variable is not None
return s3_url
threads = []
for num, list_of_paths in enumerate(chunked_paths_as_list):
for filepath in list_of_paths:
t = threading.Thread(target=upload_to_s3, args=(filepath, self.unique_id))
t.start()
threads.append(t)
results = map(lambda t: t.join(), threads)
print results
Unfortunately, this is returning None
for every item:
[None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None]
>>>>> TIME: 13.9884989262
What do I need to do to get the return
statement in the above map
?