Skip to content

Instantly share code, notes, and snippets.

@glad1couldkek
Created October 10, 2016 11:05
Show Gist options
  • Select an option

  • Save glad1couldkek/582a75d0b35d0772a39ddfd73fd1f229 to your computer and use it in GitHub Desktop.

Select an option

Save glad1couldkek/582a75d0b35d0772a39ddfd73fd1f229 to your computer and use it in GitHub Desktop.
#! /usr/bin/python3
import time
import os
dir= '/home/Anon/Pictures/'
dir_pictures = '/home/Anon/Pictures/dir_pictures/'
dir_webm = '/home/Anon/Videos/'
dir_pepe = '/home/Anon/Pictures/dir_pepe/'
dir_pepe_gif = '/home/Anon/Pictures/dir_pepe_gif/'
dir_gif = '/home/Anon/Pictures/dir_pepe_gif/'
#items = os.listdir(dirp)
while True:
time.sleep(10)
os.chdir(dir)
items = os.listdir(dir)
for i in items:
print(i)
if i.startswith('pepe') and i.endswith('.jpg') or i.startswith('pepe') and i.endswith('.png'):
os.rename(dir + i, dir_pepe + i)
elif i.startswith('pepe') and i.endswith('.gif'):
os.rename(dir + i, dir_pepe_gif + i)
elif i.endswith('.webm') or i.endswith('.mp4'):
os.rename(dir + i, dir_webm + i)
elif i.endswith('.png') or i.endswith('.PNG') or i.endswith('.jpg'):
os.rename(dir + i, dir_pictures + i)
elif i.endswith('.gif'):
os.rename(dir + i, dir_gif + i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment