简体   繁体   English

在Python中处理Boost INFO文件的最佳方法是什么

[英]What's the best way to manipulate Boost INFO file in Python

I have a C++ program which read a Boost INFO file as a configuration file, and now I'm planning to dev a python script to manipulate those conf files. 我有一个C ++程序,该程序读取Boost INFO文件作为配置文件,现在我打算开发一个Python脚本来操纵这些conf文件。 What's the best way to do it? 最好的方法是什么?

I can't find any existing module in python doing that, actually when I type Boost INFO and Python in Google, most of the results are not so relevant. 我找不到在python中执行此操作的任何现有模块,实际上,当我在Google中键入Boost INFO和Python时,大多数结果都不那么相关。 I haven't even found a full syntax description of INFO. 我什至没有找到INFO的完整语法描述。

And it's seems too much work to dev a parser in python or C++ extension for python to achieve this as I'm new to python. 在python或C ++扩展中为python开发解析器以实现此功能似乎工作太多,因为我是python的新手。

Thanks in advance, guys. 预先谢谢大家。

This question is very old, but I needed this as well, so I wrote a parser class. 这个问题很老了,但我需要这个一样,所以我写了一个解析器类。 It is available here . 在这里可用。 There is no error handling, but as long as your config file has correct syntax, it should be a good starting point. 没有错误处理,但只要你的配置文件具有正确的语法,它应该是一个很好的起点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM