Skip to content

Commit

Permalink
program to delete duplicate files from destination folder
Browse files Browse the repository at this point in the history
  • Loading branch information
rakeshlinux committed Apr 15, 2018
1 parent 449fb02 commit ff8d718
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.vscode
/build
/dist
26 changes: 26 additions & 0 deletions delete_duplicate.py
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()
2 changes: 2 additions & 0 deletions multilineUse.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
i=5
print(i)
2 changes: 1 addition & 1 deletion while_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
elif n==3:
print("multiply two numbers")
elif n==4:
print("Exit")
valid=
i=i+1
print(i)

0 comments on commit ff8d718

Please sign in to comment.