[python-win32] export registry keys

Tim Roberts timr at probo.com
Tue Mar 14 18:55:17 CET 2006


On Tue, 14 Mar 2006 10:58:39 +0100, le dahut <le.dahut at laposte.net> wrote:

> Tim Roberts a ?crit :
>
>>> 
>>> If you're going to do it from Python, then you don't have to worry about
>>> using the standard regedit format.  There are a couple of registry class
>>> wrappers for Python that turn a registry key into a Python object tree. 
>>    
>>
>
>mmhmm very interesting, could you tell me more about those classes ?
>  
>

One good example is in the ActiveState Python cookbook:
    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/174627

>>>>> Someone has an idea ? (otherwise I'll use "reg export" under XP and 
>>>>> regedit /E with 98 but it seems very barbarian isn't it   ;-)   )
>>>      
>>>
>>> 
>>> Why is it barbarian?  It's called "using the tools at your disposal".
>>    
>>
>
>It opens a DOS prompt when the 'regedit' command is launched ... for a 
>wx app it looks not clean... maybe you know a way to hide this behavior ?
>  
>

Are you using os.system to launch regedit?  os.system always creates a
DOS shell to execute the command.  But regedit is a Windows application;
it doesn't need the shell.

You should be able to use any of the dozens of other process-launch
choices.  os.execl would work, but the subprocess module is probably a
better choice.  Just this should work:
    subprocess.Popen('regedit /E xxxx')

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-win32 mailing list