Skip to content
Open
Changes from 1 commit
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
29 changes: 29 additions & 0 deletions PythonWallpaperChanger/program.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'''This program extracts some pictures from the NatGeo gallery and store it as local file,
then change it as the desktop wallpaper'''

import os
import ctypes
import urllib.request as u
import requests, random
from datetime import datetime as dt

i='1'

try:
day = dt.now().date()
day = str(day)
temp1 = int(day[-1])
tnum = [9000,8900,8930,9010,8920,8970,8950]
temp = 2*temp1 - 1
t1 = random.choice(tnum)+temp
i = str(t1)
try:
url = 'https://assets-natgeotv.fnghub.com/POD/'+i+'.jpg'

except:
print('Server Error !')
path = 'C:\\Users\\Sabi\\Downloads\\m\\pic_dtop\\'+day+'.jpg'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amrs-tech How can someone else access your files? Add them in the repo and update the links. Thanks.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DipanshKhandelwal Sorry for the mistakes. Thanks, I'll correct it.

file = u.urlretrieve(url,path)
ctypes.windll.user32.SystemParametersInfoW(20, 0, path , 0)
except Exception as e:
print('Some Technical issues !')