Skip to content

Instantly share code, notes, and snippets.

@djds23
Created April 20, 2015 13:40
Show Gist options
  • Select an option

  • Save djds23/89985abf532fc9e6b4bc to your computer and use it in GitHub Desktop.

Select an option

Save djds23/89985abf532fc9e6b4bc to your computer and use it in GitHub Desktop.
I take way too many screenshots every day. I like that they goto my desktop, but I want to archive old ones after my screen gets cluttered. This cleans my screen for me when things start going a bit over the top!
#! /usr/bin/env python
import os
import shutil
HOME = os.path.expanduser('~')
DESKTOP = os.path.join(HOME, 'Desktop')
DESKTOP_FILES = os.listdir(DESKTOP)
SCREEN_SHOT_DIR = os.path.join(HOME, 'Pictures', 'Screenshots')
SCREEN_SHOTS = filter(lambda f: f.startswith('Screen Shot'), DESKTOP_FILES)
def move_files():
for shot in SCREEN_SHOTS:
shot_file_path = os.path.join(DESKTOP, shot)
shutil.move(shot_file_path, SCREEN_SHOT_DIR)
if __name__=='__main__':
move_files()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment