Python code to read registry