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
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s