list - Switching BG using Python -


i'm writing simple program changes background when run it. i'm trying make when run it, changes background when run again goes next image in list , on.

but can't figure out how make each time run it, picks next image in list , assigns image variable.

here code:

img_list = ['c:\bg\mod_bg.bmp','c:\bg\bgmatrix.jpg'] #image list  pathtoimg = #image name here spi_setdeskwallpaper = 20   ctypes.windll.user32.systemparametersinfoa(spi_setdeskwallpaper, 0, pathtoimg,                                        0) 

so first time run want use c:\bg\mod_bg.bmpthen close next time open want use c:\bg\bgmatrix.jpg , close

please help.

to have save index in img_list of current picture somewhere. when program starts reads index value, changes , writes back.

places store e.g.

  • a (hidden) file
  • the windows registry

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -