-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
program to delete duplicate files from destination folder
- Loading branch information
1 parent
449fb02
commit ff8d718
Showing
4 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.vscode | ||
/build | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#------------------------------------------------------------------------------- | ||
# Name: delete_duplicate.py | ||
# Purpose: Delete duplicate files in destination folder | ||
## Author: rakesh kumar | ||
## Created: 05-05-2017 | ||
# Copyright: binarynote.com | ||
# Licence: MIT | ||
#------------------------------------------------------------------------------- | ||
import glob | ||
import os | ||
def main(): | ||
source = r'C:\Users\acer\Desktop\python_pdf' | ||
target = r'C:\Users\acer\Desktop\python_pdf1' | ||
os.chdir(source) | ||
file_source = glob.glob('*.*') | ||
os.chdir(target) | ||
files_target=glob.glob('*.*') | ||
count=0 | ||
for filename in files_target: | ||
if filename in file_source : | ||
os.unlink(filename) | ||
count+=1 | ||
|
||
print('Total {} files deteled'.format(count)) | ||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
i=5 | ||
print(i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,6 @@ | |
elif n==3: | ||
print("multiply two numbers") | ||
elif n==4: | ||
print("Exit") | ||
valid= | ||
i=i+1 | ||
print(i) |