0

I'm going to code in C++ and Python. I want Python to do a web crawling task and return the results to a C++ listbox. How can I grab the results from Python and pass them to the C++ part of my application? Only thing i see differences from how to pass a value to c++ from python and back? then my question is that I'm asking how to grab results from python and add them in C++ listbox; for example,

p = subprocess.Popen(["/your/app"], //Yes app goes there //how about the results not the app itself? stdin=subprocess.PIPE, stdout=subprocess.PIPE) output = p.communicate(input)[0]

listBox1.Items.Add(p); // p should add results from python. I didn't see this in the other site so I post this.

Community
  • 1
  • 1
Scotty Stultz
  • 51
  • 1
  • 8

1 Answers1

0

As said Pavel Pája Halbich and msw in the other post, the proper solution is using PyObject. If you want to have a two-way communication between C++ & Python, Boost Python would be interesting for you. Take a look at website Boost Python,

This post would also be interesting: How to expose a C++ class to Python without building a module

Community
  • 1
  • 1
Sacha
  • 134
  • 2
  • 12