Skip to content

Commit

Permalink
Update print flush method
Browse files Browse the repository at this point in the history
  • Loading branch information
sgibson91 committed Mar 6, 2022
1 parent 80ced2a commit 210fcd9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions deduplify/hash_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
Author: Sarah Gibson
Python version: >=3.7 (developed with 3.8)
"""
import sys
import hashlib
import logging
import os
Expand Down Expand Up @@ -115,8 +114,7 @@ def run_hash(
hashes_db.insert({"hash": hash, "filepath": filepath, "duplicate": False})

count_files_hashed += 1
print(f"Total files hashed: {count_files_hashed}", end="\r")
sys.stdout.flush()
print(f"Total files hashed: {count_files_hashed}", end="\r", flush=True)

# Calculate number of unique and duplicated files
logger.info("Number of files hashed: %s" % len(hashes_db))
Expand Down

0 comments on commit 210fcd9

Please sign in to comment.