python/A-Z_Archives_OrderScriptPyt.../RemoveEmptyFolders.py

18 lines
411 B
Python
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import os
print("!Warning this script delete all empty folders in the directory it was executed in [v0.9")
print("1 Start")
print("0 Close")
x = input("")
if x == "1":
while True:
for item in os.listdir(os.getcwd()):
if os.path.isdir(item):
if not os.listdir(item):
os.removedirs(os.path.join(os.getcwd(), item))
break
else:
pass