timing issue: shutil.rmtree and os.makedirs

Steven D'Aprano steve+comp.lang.python at pearwood.info
Tue Jul 30 10:07:22 EDT 2013


On Tue, 30 Jul 2013 14:27:10 +0100, Chris Angelico wrote:

> for delay in 100,300,600,1000,3000,5000,10000:
>   if not os.path.exists(directory): break
>   sleep(delay)
> 
> That'll sleep a maximum of 20 seconds, tune as required.

Actually, that will sleep a maximum of 5.55 hours, and a minimum of 1.7 
minutes (assuming the directory doesn't get deleted instantaneously).

time.sleep() takes an argument in seconds.



-- 
Steven



More information about the Python-list mailing list