0

I have a task to make an administrator desktop program which will interact with Firebase. I decided to make it in C++ with help of QT to make GUI. The administrator program should use Firebase Realtime Database to make some changes and listen to them in the table. As I understood there is no Admin SDK for C++, so I decided to use Python Admin SDK. I have already tried to write some Python code to use Realtime Databse and it worked perfectly. I could read and write data and I managed to make event listener to update data in real time. But now I should run this code in C++ program(the biggest problem is to make listener and update data in C++ program from Python script).

So, my question: How can I make Python script to run with my C++ program. The script should also update data in C++ program when it is needed. I am not asking how to embed Python to C++, I ask for explaining the process of creating event listener in Python that should pass data to C++/QT. Should I start script in a loop and define some callbacks or should I share data between two processes?

P.S Buttons in GUI will also trigger some Python code but better explain me how to implement event listener, please

Artenni
  • 49
  • 6
  • 1
    Why not write everything in python? There are python bindings for qt: https://wiki.python.org/moin/PyQt/ – Sebastian Hoffmann Oct 12 '20 at 19:52
  • Treat your Python code as a service API; you invoke a Python command, and it creates a response that is printed to STDOUT or to a file. https://stackoverflow.com/q/372198/716443 ...keep the components decoupled; it's just easier that way than trying to embed Python in the C++ code, or expect Python to modify values within the C++ code. – DavidO Oct 12 '20 at 19:59

0 Answers0