Call a C++ project main() in Python in Visual Studio? -
i have a c++ project , python project under 1 solution in visual studio. reluctant modify c++ project, because complicated , complete. don't want touch on more. integrate them, choose call c++ project in python, instead of other way round.
i wish pass parameters python to
int main(int argc, char** argv)
of the c++ project.
how may it?
the arguments of main()
command-line arguments of program. if example in python:
subprocess.popen(['mycppprogram.exe', 'foo', 'bar'], ...)
then following hold in main()
:
int main(int argc, char** argv) { assert(argc == 3); assert(argv[1] == std::string("foo"); assert(argv[2] == std::string("bar"); }
Comments
Post a Comment