To view the full archive of past projects, visit the Daily Python Projects homepage.
Subscribe to receive a new Python project every day by email:
1. Project Brief
Your task for this project is to write a Python script that looks in a folder and removes duplicate files.
2. Project Instructions
Download these files and place them in an empty directory. Some of those files are duplicates.
Write a Python script that removes the duplicate files located in that directory.
Note that the script should work with both binary (i.e., text files) and non-binary files as well.
3. Environment Setup Instructions
To run the code, go to the terminal and run
python main.py
4. Resources
You can remove duplicate files using the hashlib library. Here is a get-started guide on hashlib:
https://pythonhow.com/python-tutorial/miscellaneous/using-hashlib-library-in-python/
Hi Ardit
Here is my solution. Not as complex as yours. But does the same:
https://pastebin.com/GPmRAVgJ