Skip to content

Instantly share code, notes, and snippets.

@mathiasose
Created March 30, 2015 12:50
Show Gist options
  • Select an option

  • Save mathiasose/6a92bff0c9c19c12bd34 to your computer and use it in GitHub Desktop.

Select an option

Save mathiasose/6a92bff0c9c19c12bd34 to your computer and use it in GitHub Desktop.
import os
dir = '~/'
files = list(os.walk(dir))[0][2]
cr2s = sorted(list(filter(lambda x: 'CR2' in x, files)))
for f in cr2s:
cr2 = os.path.join(dir, f)
jpg = cr2.replace('CR2', 'JPG')
if not os.path.exists(jpg):
os.remove(cr2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment