winreg

Marking Your Python Program as High DPI Aware Seamlessly Windows

梦想的初衷 提交于 2019-12-11 03:21:24
问题 I just wanted to share the best way I found to do this in case other people were having issues as I was. If your Python/Kivy program has graphic issues with Virtual DPI scaling try this code out. It'll mark the program as High DPI Aware for you or the end user without having to do anything. This works for Windows 10, not sure about 8 or 7. Was wondering if anyone else knows if this will work for 8 and 7. To test this out, add the code in, set DPI up, log out and back in of user so the

Finding perfmon counter id via winreg

只谈情不闲聊 提交于 2019-12-11 02:23:27
问题 I have an app that collects Perfmon counter values through the API exposed in winreg.h - in order to collect Perfmon counter values I must make a call to RegQueryValueExW passing in the id of the Perfmon counter I'm interested in, and in order to obtain that ID I need to query the registry for the list of Perfmon counter names and go through looking for the one I'm interested in C++ isn't my language of choice, so the following is a shaky example, probably with lots of syntax errors but you

use boto3 on GAE for Python

匆匆过客 提交于 2019-12-08 13:39:13
问题 I'm trying to use boto3 for Polly API in Google App Engine for Python. So far, I've installed boto3 in my lib subdirectory pip install -t lib boto3 When I run a standalone script it runs well But when I execute boto3.client(...) in my app on my DEV server, I get an error coming from the botocore/session.py: from _winreg import OpenKeyEx, QueryValueEx, CloseKey, HKEY_LOCAL_MACHINE ImportError: No module named _winreg I have seen that as GAE is sandboxed so it is normal that _winreg module is

Python COM server with VBA late biding + skip win register (no admin rights)

余生长醉 提交于 2019-12-07 00:35:32
I'm trying to import Python code into in VBA. The code below works but requires admin rights . Is there a way to go around the win register need (assume I just don't have admin rights) but keep the 'late biding' behavior (dont want to Tools>>Reference every time I compile something new) class ProofOfConcept(object): def __init__(self): self.output = [] def GetData(self): with open('C:\Users\MyPath\Documents\COMs\SourceData.txt') as FileObj: for line in FileObj: self.output.append(line) return self.output class COMProofOfConcept(object): _reg_clsid_ = "{D25A5B2A-9544-4C07-8077-DB3611BE63E7}"

Python _winreg woes

旧巷老猫 提交于 2019-12-04 18:42:32
问题 I'm trying to access the windows registry (in Python) to query a key value using _winreg and I can't get it to work. The following line returns a WindowsError saying that the "system cannot find the specified file": key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Autodesk\Maya\2012\Setup\InstallPath', 0, _winreg.KEY_ALL_ACCESS) After hours of trying, it looks like Python cannot see beyond the "Maya" part of the path (it looks like the "2012\...etc..." sub-path is "invisible" or

python: _winreg problem

无人久伴 提交于 2019-12-03 22:42:12
问题 the windows registry may contain keys whose names with embedded nulls when i call _winreg.OpenKey(key, subkey_string_with_embbeded_null) i get the following error: TypeError: OpenKey() argument 2 must be string without null bytes or None, not str Q1: is the meaning of the error that python _winreg module has a limitation that it cannot open keys whose names have embbeded nulls? Q2: how do i get around this limitation? 回答1: Q1: right. Q2: download and install win32all. 来源: https:/

How do I add a python script to the startup registry?

泪湿孤枕 提交于 2019-12-03 14:28:51
I'm trying to make my python script run upon startup but I get the error message windowserror access denied, but I should be able to make programs start upon boot because teamviewer ( a third-party program I downloaded ) runs every time I restart my computer so I know that I should be able to make my program run at startup (I might be doing something different though, so if you could shed some light on what teamviewer is doing differently to get its script to run at startup that would be helpful). Here is my script import _winreg, webbrowser key = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER,

python script to read and write a path to registry

让人想犯罪 __ 提交于 2019-12-03 11:52:42
问题 I have developed a python script where i have a setting window which has the options to select the paths for the installation of software.When clicked on OK button of the setting window, i want to write all the selected paths to the registry and read the same when setting window is opened again. My code looks as below. def OnOk(self, event): data1=self.field1.GetValue() #path selected in setting window aReg = ConnectRegistry(None,HKEY_LOCAL_MACHINE) keyVal=OpenKey(aReg,r"SOFTWARE\my path to

winreg.OpenKey throws filenotfound error for existing registry keys

╄→尐↘猪︶ㄣ 提交于 2019-12-03 03:00:35
I am facing difficulties in reading a registry key created by my software. However with the same code, I am able to read other keys. installdir = winreg.OpenKey( winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\Types" ) #this works perfect #installdir1 = winreg.OpenKey( winreg.HKEY_LOCAL_MACHINE, "SOFTWARE\\MySoftware\\MyEvent\\IS" ) #this gives Filenotfound error # list values owned by this registry key try: i = 0 while 1: name, value, type = winreg.EnumValue(installdir, i) print (repr(name)) i += 1 except WindowsError: print ("Bot donf") value, type = winreg

ImportError while importing winreg module of python

狂风中的少年 提交于 2019-12-01 01:53:17
I wanted to use winreg module of python for working with windows registry. But when I try to import winreg module, it gives ImportError. Python 2.4.3 (#1, Dec 11 2006, 11:39:03) [GCC 4.1.1 20061130 (Red Hat 4.1.1-43)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import __winreg Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named __winreg >>> import _winreg Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named _winreg Do I need to install this module separately ? Any