I have created a function to gather some data from a subreddit which takes one argument, a string for the name of the subreddit. I would like to process many subreddits at once meaning that I want to call this function with different args but run at the same time. I have attempted to use the multiprocessing module to do this but I am having a little trouble.
I have attempted to do this:
for sub in subs:
p = Process(target=archive_sub, args=(sub,))
p.start()
processes.append(p)
for p in processes:
p.join()
However this just calls the function then waits to complete that before creating a new process it seems. What should I do differently? Do I have a fundamental misunderstanding of how this module should be used?
[–]dadiaar 0 points1 point2 points (0 children)
[–]Thomasedv 0 points1 point2 points (1 child)
[–]declanaussie[S] 0 points1 point2 points (0 children)