I am trying to run the following code. It works if executed in a shell but crashes if executed as macro (py macro.py). Please could you tell me what's wrong. Thank you
import os
import sys
import dask
from dask.distributed import Client
def inc(x):
return x + 1
def add(x, y):
return x + y
client = Client(n_workers=2, threads_per_worker=2, memory_limit='1GB')
a = client.submit(inc, 10)
b = client.submit(inc, 20)
print(a.result())
print(b.result())