Created
May 20, 2020 11:01
-
-
Save Abdelkrim/df8212a08cbe5ebb317893f12c9667bd to your computer and use it in GitHub Desktop.
remove files from kaggle directory : '/kaggle/working/'
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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