Monday, November 26, 2007

Read Registry Files in Python

Reading Python files using open function will not work as Reg files are encoded using UTF-16, thus use the following code to read it

import codecs regFile = codecs.open ("c:/temp/Deve.reg", encoding="utf_16")
reg = regFile.read ()
regFile.close ()
print reg

No comments: