Advertisement
Guest User

Untitled

a guest
Apr 5th, 2020
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. import fire
  2. import concurrent.futures
  3. import time
  4.  
  5. class MeThread():
  6.     def fake(self, i):
  7.         print("start", i)
  8.         time.sleep(5)
  9.         print("end", i)
  10.        
  11.     def download(self, directory, count=1, max_workers=10, bucket='biophy-tuh'):
  12.         with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor:
  13.             for i in range(0, count):
  14.                 executor.submit(self.fake(i))
  15.  
  16.  
  17. if __name__ == '__main__':
  18.     fire.Fire(MeThread)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement