How do I edit the windows registry with Python?
Thnx, A[r]TA
--
We shall not cease from exploration, and the end of all our exploring will
be to arrive where we started and know the place for the first time.
- T. S. Eliot
"A[r]TA" <ar...@x-stream.nl> wrote in message news:era0iGYp$GA.273@net003s...
win32/scripts/regsetup.py
which uses (I think) win32/lib/regutil.py (the main module for handling
the registry). With a little effort one can figure out how things work.
Additionally there is some documentation included in the
win32/Help/Python Win32 Extensions.hlp-File, but looking at the sources
should show how all is put together. I used regutil.py for checking
whether there is python installed on a win32 system and if not, setting
the appropriate registry keys.
Hope it helps,
Janos.
> How do I edit the windows registry with Python?
Sent via Deja.com http://www.deja.com/
Before you buy.
This is taken from the win32api sources. The relevant differences are:
* The module name has obviously changed! The winreg module will raise
winreg.error (which happens to be thenew standard WindowsError exception
object, derived from OSError, derived from EnvironmentError, derived from
StandardError - so any of these error objects will catch the exceptions!)
* The function names have changed (eg, win32api.RegCreateKey ->
winreg.CreateKey)
* Security information is not supported - none must be passed to all
winreg functions that accept security information.
* winreg has docstrings, win32api has help files :-)
Apart from that, all args and usage are identical to the win32api
functions. Thus, in the general case, code can be changed to use winreg
from win32api with a couple of search-and-replaces!
Mark.