added delete confirmation
This commit is contained in:
parent
13bd3e4703
commit
94e42cfe65
1 changed files with 8 additions and 5 deletions
|
|
@ -14,6 +14,9 @@ def delete_all(d):
|
||||||
if not os.path.exists(d):
|
if not os.path.exists(d):
|
||||||
print("Nothing to delete")
|
print("Nothing to delete")
|
||||||
else:
|
else:
|
||||||
|
list_all(d)
|
||||||
|
x = input("Delete the above files? y/N ")
|
||||||
|
if x.lower() == 'y':
|
||||||
for file in os.listdir(d):
|
for file in os.listdir(d):
|
||||||
f = os.path.join(d,file)
|
f = os.path.join(d,file)
|
||||||
os.remove(f)
|
os.remove(f)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue