0

I'm trying to access, from Python, some functions of a subprocess-spawned external C++ program. The program is a Qt application, whose main header is shown below:

#include <QMainWindow>

class MainWindow : public QMainWindow {

public slots:
    void saveSnapshot();
    void updateImage();

}

Allowing minimal modifications to the application's source code, is it possible to call slots saveSnapshot() and updateImage() (which are otherwise triggered by buttons on the GUI) from my Python program?

FartVader
  • 143
  • 1
  • 3
  • 13
  • 1
    after running `Popen` Python can communicate with external program only using `stdin` and `stdout`. It has no access to function `saveSnapshot()` and `updateImage()`. It can't run them and get their results. – furas Jan 14 '17 at 17:34
  • 1
    maybe you could use modules like `PyAutoGui` to click buttons in external program. – furas Jan 14 '17 at 17:35
  • Possible duplicate of [Retrieving the output of subprocess.call()](http://stackoverflow.com/questions/1996518/retrieving-the-output-of-subprocess-call) – rbaleksandar Jan 14 '17 at 18:34
  • Furas, without using PyAutoGui, is there any workaround to this, so that the functions can be accessed by `stdin` and `stdout`? – FartVader Jan 15 '17 at 01:34

0 Answers0