https://docs.python.org/3/library/logging.handlers.html#logg...
Neat Parallel Output in Python
41–47 of 47 posts
Re: Neat Parallel Output in Python
#42Re: Neat Parallel Output in Python
#43I believe that you can use QueueListener and QueueHandler to serialize the calls: https://docs.python.org/3/library/logging.handlers.html#logg...
Re: Neat Parallel Output in Python
#44Nice idea. However, please note: `map(func, repos)` does not do anything. Your code does not do any processing. Try it. You need to consume the iterator that map returns. Please use Python as it is supposed to be used, not as Fortran.
Re: Neat Parallel Output in Python
#45You probably don't want to run this gist directly. Looks like a risk of a runaway process creation, depending on the platform. The process creation code should be guarded by `if __name__ == "__main__"`.
Re: Neat Parallel Output in Python
#46Nice idea. However, please note: `map(func, repos)` does not do anything. Your code does not do any processing. Try it. You need to consume the iterator that map returns. Please use Python as it is supposed to be used, not as Fortran.
Re: Neat Parallel Output in Python
#47I prefer using a purpose-built tool like GNU parallel. Parallel's only purpose is to run things in parallel and collect the results together. The advantage is you only have to learn to use it once, rather than learn to do this again and again in all the different languages/tools you might use.
parallel --latestline seq ::: {1..10}0000000
(Requires version 20220522)