[Jacob S.] > Hi, > A little while ago, someone posted a message about an error and > something about modifying the windows registry key HKEY_CURRENT_USER\Control > Panel\Desktop so that the value Wallpaper was changed periodically. I wonder > if anyone could tell me how to do that? I tried something, and it didn't > work, and the documentation on _winreg is not very helpful to me. Any help > is appreciated. : )
> Jacob Schmidt > _______________________________________________ > Tutor maillist - [EMAIL PROTECTED] > http://mail.python.org/mailman/listinfo/tutor Here's the code: import sys import os import _winreg key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, \ r"Control Panel\Desktop", 0, _winreg.KEY_ALL_ACCESS) _winreg.SetValueEx(key, "Wallpaper", 0,_winreg.REG_SZ, \ os.path.abspath(sys.argv[1])) It has one defect though. You'll need to logout/login or restart Windows to apply the changes. I don't know how to apply them immediately. -- Andrey _______________________________________________ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor