AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
The second option would allow you to perform all the necessary checks and error handling, but is more complex and requires more refactoring: # dictionary of hashes to all files Shutil.move(filepath, destination, copy_function=pytree) It does however require the user to input a target directory weather or not there are any duplicate files or an error occurs when searching so might be worse from a user's perspective: # prompt for directory beforehandĭestination = askdirectory(title="Select the target folder")įilehash = hashlib.md5(open(filepath, "rb").read()).hexdigest() The first option is probably the simplest, most efficient, and requires the smallest amount of refactoring. Prompt for the target directory afterward.
0 Comments
Read More
Leave a Reply. |