Last active
March 22, 2016 00:31
-
-
Save selfsame/255b9410a7f1e601560a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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