[Tutor] adding a windows registry value

Albert-Jan Roskam fomcl at yahoo.com
Sat Aug 4 12:55:51 CEST 2012


Hi,

Thanks to all who replied, also those who replied off-list. Somebody else confirmed that the code was working as expected on another machine, so it's probably a rights issue. Still nice to have a look at _winreg though.

 
Regards,
Albert-Jan


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a 
fresh water system, and public health, what have the Romans ever done for us?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 


>________________________________
> From: eryksun <eryksun at gmail.com>
>To: Albert-Jan Roskam <fomcl at yahoo.com> 
>Cc: Python Mailing List <tutor at python.org> 
>Sent: Friday, August 3, 2012 10:58 PM
>Subject: Re: [Tutor] adding a windows registry value
> 
>On Fri, Aug 3, 2012 at 10:39 AM, Albert-Jan Roskam <fomcl at yahoo.com> wrote:
>> Hi,
>>
>> I am trying to change a registry value (Windows 7, Python 2.7) but it won't
>> work when I try to do this using Python:
>>
>> import os
>> # 1 using this from Python won't work, but double-clicking the file works.
>> os.system(r"regedit /s C:\Users\Desktop\set_temp.reg")
>> # 2: using this from Python won't work, but from the commandline or with a
>> batch file works
>> os.system("reg add HKEY_CURRENT_USER\Software .....(etc)")
>>
>> Why is this not working using Python? Is there a built-in way to do this (I
>> don't have win32api)?
>
>Wouldn't it be simpler to use the  _winreg module?
>
>http://docs.python.org/library/_winreg.html
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20120804/44369c90/attachment.html>


More information about the Tutor mailing list