~ Mayank Johri’s Tips ~

November 26, 2007

Read Registry Files in Python

Filed under: Python — mayankjohri @ 9:55 am

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 Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.