Add Raspberry Pi Pico project
This commit is contained in:
12
pico/delete_folder.py
Normal file
12
pico/delete_folder.py
Normal file
@@ -0,0 +1,12 @@
|
||||
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
|
Reference in New Issue
Block a user