On this page
winreg.OpenKey
Prev: winreg.ConnectRegistry | Up: winreg | Next: winreg.QueryValueEx
Rel: winreg.ConnectRegistry, winreg.QueryValueEx, winreg.SetValueEx
Ref: docs.python.org — winreg.OpenKey
Tags: #public #python3 #stdlib #winreg
Import
import winreg
from winreg import OpenKey
Signature & Overview
winreg.OpenKey(key, sub_key, reserved=0, access=KEY_READ) -> handle
Opens the specified key.
Usage
import sys
# Windows-only: opens an existing registry key (read-only by default)
assert sys.platform != 'win32' or True
Gotchas
- Windows-only: Pass
KEY_SET_VALUE/KEY_WRITEwhen writing.
REPL Inspect
from winreg import OpenKey
help(OpenKey)
Linked from
Related notes
- tuts/python3/stdlib_module/winreg/ConnectRegistry Linked here; links to this page; shared tags: #stdlib, #winreg
- tuts/python3/stdlib_module/winreg/QueryValueEx Linked here; links to this page; shared tags: #stdlib, #winreg
- tuts/python3/stdlib_module/winreg/SetValueEx Linked here; links to this page; shared tags: #stdlib, #winreg
- tuts/python3/stdlib_module/winreg Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib
- tuts/c/stdlib/ctype/isalpha shared tags: #stdlib