Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for root, _, files in os.walk('/tmp/datasets/training/negative'):
- for f in files:
- fullpath = os.path.join(root, f)
- try:
- if os.path.getsize(fullpath) == 4 * 1024: #set file size in kb
- print (fullpath)
- os.remove(fullpath)
- except WindowsError:
- print ("Error")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement