mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 13:24:05 -06:00
20 lines
392 B
Markdown
20 lines
392 B
Markdown
#code
|
|
|
|
- ` import multiprocessing, tqdm # for loading bar`
|
|
- ```python
|
|
collect_results = []
|
|
|
|
def replicate(input):
|
|
# do the thing
|
|
return thing
|
|
|
|
for x in tqdm(pool.imap(replicate, enumerate(vector)), total=len(vector)):
|
|
collect_results.append(x)
|
|
|
|
pool.close()
|
|
pool.join()
|
|
|
|
```
|
|
-
|
|
- this also shows a nice loading bar showing your progress, and maintains the order of the original input.
|