Skip to content

When I try to add the PyObject_CallMethod in c++ code, necessary to add the Py_Initialize #2

@nooperpudd

Description

@nooperpudd

for example in the

https://github.com/quantvc/ltspython/blob/master/ltsapi/trader_struct.cpp#L18

PyObject *new_CSecurityFtdcRspInfoField(CSecurityFtdcRspInfoField * p) {
    if (p == NULL) {
        Py_INCREF(Py_None);
        return Py_None;

    }
    return PyObject_CallMethod(mod, (char *)"CSecurityFtdcRspInfoField", (char *)"is",
                               p->ErrorID, p->ErrorMsg);
}

need to add the Py_Initialize and the Py_finalize

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions