SHARE
TWEET

wait for end of download

furas Jul 29th, 2018 17 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. while True:
  2.     wait = False
  3.    
  4.     for i in os.listdir("D:/Downloads"):
  5.         if ".crdownload" in i:
  6.             wait = True
  7.             break # no need to check other files
  8.        
  9.     if not wait:
  10.         break # exit `while True`
  11.    
  12.     time.sleep(0.5)
  13.  
  14. print("download complete")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top