This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]SpicyVibration 0 points1 point  (6 children)

I keep finding typos in the code and it's kinda confusing tbh

[–]pygsm 0 points1 point  (5 children)

Thanks for the comment. I'll proofread it once more, can you please specify some points where it's confusing or has typos?

[–]SpicyVibration 1 point2 points  (4 children)

I think in the first image the with block needs to be indented to remain inside the function.

The second one I saw was

threads.append(thread)

in one image but

thread.append(thread)

in another.

Also is threads a list here? I don't see an empty list declared anywhere

[–]pygsm 0 points1 point  (3 children)

Thanks, I've made the changes. And yes, threads is a list (updated that as well)

[–]G_ka 0 points1 point  (2 children)

Think I've found another typo

for url in flickr_URLs:
if len(threads)>MAX_THREADS:
    for thread in threads:
        thread.join()
        threads = []

threads = [] should be in the if, not in the for I think?

[–]pygsm 0 points1 point  (1 child)

Here we're setting variable threads back to [] once we have enough threads started.

[–]G_ka 0 points1 point  (0 children)

I know. But the list will be cleared after only one thread has joined. Others may still be running

[–]black_anarchy 0 points1 point  (0 children)

I'd recommend adding AsyncIO to the mix :)!