在C ++中从python调用函数

问题描述

我目前正在使用一个单独的cli和gui进行项目。 gui部分是用C ++编写的,以使可执行的内容保持较小。我使用pyinstaller编译了python程序,需要从C ++程序中调用某些函数。

Python部分:

NULL

通过pyinstaller --onefile --clean myprogram.py

进行编译

我想在C ++中做的是:

import configparser
def getconfig() -> list:
    config = configparser.ConfigParser()
    config.read("config.ini")
    section1 = config["general"]
    section2 = section["section2"]
    return [section1,section2] #should be a list of dict?

我只是不想再次在C ++中进行配置解析,或者您会建议这样做,因为调用已编译的python二进制文件可能更容易?

该程序只需要在linux上运行,不需要Windows。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)