Skip to content

Instantly share code, notes, and snippets.

@Crispy13
Created April 21, 2024 09:00
Show Gist options
  • Save Crispy13/c3acaef979ed93567f5e14e1b34add47 to your computer and use it in GitHub Desktop.
Save Crispy13/c3acaef979ed93567f5e14e1b34add47 to your computer and use it in GitHub Desktop.
import multiprocessing
import foo
def py_func(chr_pos:list, rbt:tuple):
return (rbt[0], rbt[1] * 2)
def main():
chr_pos_vec = list(map(lambda x:[x[0].__str__(), x[1].__str__()], zip(["foo","bar", "RDJ","PointBreak"], [121593746, 43114490, 43112962, 8058443])))
rbt = [("Doodle", 2), ("Noodle", 3)]
rr = foo.test(chr_pos_vec, rbt)
print("rr done.")
pr = []
for r in rbt:
py_func.__defaults__ = (r,)
with multiprocessing.Pool(4) as pool:
pr.extend(pool.map(
py_func,
chr_pos_vec,
))
import gc
gc.collect()
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment