/delete-files

Python script for deleting all .txt files in a directory. The script is simple and straightforward, using the os module to iterate through the files in the specified directory and delete any .txt file it encounters. This can be useful for cleaning up a directory filled with mixed files and ensuring only relevant files remain.

Primary LanguagePython

Delete Files

Delete training data labels for AI projects

This script can be used to delete a set of files in a directory, given a specific file extension, it's main use case to delete the lebels of the training data in AI projects.

Prerequisites

  • Python 3.x

Usage

  1. Replace the directory variable in the script with the path to the directory that contains the files to be deleted.

  2. Replace the '.txt' string in the if statement with the file extension of the files to be deleted.

  3. Run the script.

Disclaimer

  • Be careful when using this script as it permanently deletes files from the specified directory. Make sure you have a backup of the files before running the script.