I can not overcome the problem with copying files in several streams. Task: there are directories dir1 = /home/my_dir1 and dir2 = /home/my_dir2 . How, using a multithreading module, simultaneously copy several files from dir1 to dir2 .
In this case there is a list co with all directories inside dir1 .
remote_dir1 = '/home/my_dir1/' def listdir_fullpath(d): return [os.path.join(d, f) for f in os.listdir(d)] listdirs = sorted(listdir_fullpath(remote_dir1))