I have a working C program and now I'm embedding a python script implementing a specific function.
The question is, the arguments passed into Python is a complicated(I mean nested) C structure defined in C. And I hope the solution would be able to do the two ways communication easily:
1.Create structure in C, and pass it into Python. Let the Python do some modification.
2.Create the structure in Python. And pass it back to C.
I was trying "SWIG" to generate some wrappers for the structure, as well as some helper functions using SWIG for Python so that it could return me some nested part of the structure so that I could visit the structure through Python easily.
Will this be a good solution or I may miss some very simple way of solving it?
In my experience, SWIG should be able to handle arbitrarily nested structs the way you'd "expect". –  brunobeltran0
How do I pass C structure into Python when embedding a Python module in a C program