Created
April 20, 2015 13:40
-
-
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!
This file contains hidden or 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
| #! /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