How to avoid the Python component to be suspended animation

when I use the iron python component to download map from OSM,the python component used to be suspended and I cannot operate my scripts window. It usually takes about 1-2 minutes to recover till the download finishing. I wonder if there is any way to deal with the download progress.

python code:

try:
re = urllib.request.urlopen(url).read()
urllib.request.urlretrieve(url,filename,Schedule)
except Exception as e:
print(e)

Hi,

you can put the code inside a separate thread, but then you need to trigger a recomputation of the component, once its ready. The question is, if it makes sense to do so?! If the data is required for computation, then it doesn’t make sense to unblock the UI. Maybe the only thing I would do, is to inform the user that its loading something from a server. Maybe a little form with a progressbar, turning the mouse into a loading wheel… Also I would check if the data can be cached and locally copied to only download it once. Making it a unique step.