Answers for "remove duplicate in zip file python"

1

python delete duplicate lines in file

with open("file.txt", "r") as txt_file:
  new_data = list(set(txt_file))
  return new_data
Posted by: Guest on November-30-2020
0

how to remove duplicate files from folder with python

def remove_duplicates(dir):
    unique = []
    for filename in os.listdir(dir):
        if os.path.isfile(filename):
            filehash = md5.md5(file(filename).read()).hexdigest()
            if filehash not in unique: 
                unique.append(filehash)
            else: 
                os.remove(filename)
Posted by: Guest on September-05-2021

Python Answers by Framework

Browse Popular Code Answers by Language