13 lines
400 B
Python
13 lines
400 B
Python
import os
|
|
|
|
def delete_folder(path):
|
|
for file in os.listdir(path):
|
|
full_path = path + "/" + file
|
|
try:
|
|
os.remove(full_path) # Datei löschen
|
|
except OSError:
|
|
delete_folder(full_path) # Falls es ein Ordner ist, rekursiv löschen
|
|
os.rmdir(path) # Ordner selbst löschen
|
|
|
|
delete_folder("/mfrc522") # Beispiel: Löscht den gesamten MFRC522-Ordner
|