Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

empty directory if not empty python

'''
    Check if a Directory is empty : Method 1
'''    
if len(os.listdir('/home/varun/temp') ) == 0:
    print("Directory is empty")
else:    
    print("Directory is not empty")
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #empty #directory #empty #python
ADD COMMENT
Topic
Name
1+5 =