Skip to content

Instantly share code, notes, and snippets.

@selfsame
Last active March 22, 2016 00:31
Show Gist options
  • Select an option

  • Save selfsame/255b9410a7f1e601560a to your computer and use it in GitHub Desktop.

Select an option

Save selfsame/255b9410a7f1e601560a to your computer and use it in GitHub Desktop.
import ctypes
import urllib2
import time
import sys
if len(sys.argv) > 1:
source = sys.argv[1]
else:
source = "http://sdo.gsfc.nasa.gov/assets/img/latest/latest_1024_0304.jpg"
while True:
print("reloading!")
sun = urllib2.urlopen(source)
output = open('sun.jpg','wb')
output.write(sun.read())
output.close()
SPI_SETDESKWALLPAPER = 20
ctypes.windll.user32.SystemParametersInfoA(SPI_SETDESKWALLPAPER, 0, "sun.jpg" , 0)
time.sleep(900)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment