What is a good configuration file library for c thats not xml (preferably has python bindings)? [closed]

StackOverflow https://stackoverflow.com/questions/1227031

Question

I am looking for a good config file library for c that is not xml. Optimally I would really like one that also has python bindings. The best option I have come up with is to use a JSON library in both c and python. What would you recommend, or what method of reading/writing configuration settings do you prefer?

Was it helpful?

Solution

YaML :)

OTHER TIPS

If you're not married to Python, try Lua. It was originally designed for configuration.

You could use a pure python solution like ConfigObj and then simply use the CPython API to query for settings. This assumes that your application embeds Python. If it doesn't, and if you are shipping Python anyway, it might make sense to just embed it. Your C .exe won't get that much bigger if it's a dynamic link, and you will have all the flexibility of Python at your disposal.

Despite being hated by techies and disowned by Microsoft, INI files are actually quite popular with users, as they are easy to understand and edit. They are also very simple to write parsers for, should your libraries not already support them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top