Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Abdelkrim/df8212a08cbe5ebb317893f12c9667bd to your computer and use it in GitHub Desktop.
Save Abdelkrim/df8212a08cbe5ebb317893f12c9667bd to your computer and use it in GitHub Desktop.
remove files from kaggle directory : '/kaggle/working/'
# Author Abdelkrim Boujraf, ALT-F1 SPRL
import os
dir_to_delete = '/kaggle/working/'
with os.scandir(dir_to_delete) as entries:
for entry in entries:
file_to_delete = f"{dir_to_delete}{entry.name}"
if os.path.isfile(file_to_delete):
print(file_to_delete)
os.remove(file_to_delete)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment