im trying to edit my Revit.ini File with python however I continue getting the error below. I've been banging my head against the wall for the better portion of the day. Any help is appreciated in this.
I've been working with ConfigParser on python 2.7 and going through their docs here since they seem to be the way to go when trying to work with *.ini files. When i create my own *.ini file to test stuff on, everything works however when i try to run my test on this other *.ini, i get an error.
my code so far
import ConfigParser
config = ConfigParser.RawConfigParser()
config.read('Revit.ini')
my error
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Python27\lib\ConfigParser.py", line 305, in read
self._read(fp, filename)
File "C:\Python27\lib\ConfigParser.py", line 512, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
MissingSectionHeaderError: File contains no section headers.
file: Revit.ini, line: 1
'\xff\xfe\r\x00\n'
Any and all help is appreciated. I think it has something to do with the UTF encoding(which im not at all familiar with yet. i intend to do some reading on it) which then means i probably have to decode it and then re-encode it which i also need to read up on what to do.