Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions week-3/Chirag_Aparadh/wallpaperChanger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env python

# this scritp automatically changes wallpaper every 10 seconds
# the scritp is bad but it works!
#also for some reason it works only with bmp images

import ctypes
import random
import os
import schedule
import time
import sys


def get_path():
path = os.path.abspath('wallpapers')
for root, root1, files in os.walk('wallpapers'):
no_of_wallpapers = len(files)
random_no = random.randint(0, no_of_wallpapers-1)
path = os.path.join(path, files[random_no])


return path

def main():
path = get_path()
ctypes.windll.user32.SystemParametersInfoW(20, 0, path, 0)


schedule.every(10).seconds.do(main)

while 1:
schedule.run_pending()
time.sleep(1)




Binary file added week-3/Chirag_Aparadh/wallpapers/1.bmp
Binary file not shown.
Binary file added week-3/Chirag_Aparadh/wallpapers/2.bmp
Binary file not shown.
Binary file added week-3/Chirag_Aparadh/wallpapers/3.bmp
Binary file not shown.
Binary file added week-3/Chirag_Aparadh/wallpapers/4.BMP
Binary file not shown.
Binary file added week-3/Chirag_Aparadh/wallpapers/5.bmp
Binary file not shown.
Binary file added week-3/Chirag_Aparadh/wallpapers/6.bmp
Binary file not shown.