Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to communicate between two app: one is Qt app; the other is a Python console app.
Qt 6.11 is out! See what's new in the release blog

how to communicate between two app: one is Qt app; the other is a Python console app.

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 6 Posters 2.8k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    opengpu
    wrote on last edited by aha_1980
    #1

    how to communicate between two app: one is Qt app; the other is a Python console app.
    eg. the Qt app can tell the Python app to do something.
    of course, the Python app can send back msg is better...but not necessary

    raven-worxR 1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by
      #2

      It's called IPC or interprocess communication, and it is a field of study unto itself. Several mechanisms exist: pipes/fifos, message queues, shared memory, simple semaphores or signals.

      The dystopian literature that served as a warning in my youth has become an instruction manual in my elder years.

      1 Reply Last reply
      4
      • O opengpu

        how to communicate between two app: one is Qt app; the other is a Python console app.
        eg. the Qt app can tell the Python app to do something.
        of course, the Python app can send back msg is better...but not necessary

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #3

        @opengpu
        https://doc.qt.io/qt-5/ipc.html

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        4
        • M Offline
          M Offline
          MrShawn
          wrote on last edited by
          #4

          I recently made a Qt App that could be called by LabVIEW to do certain operations. To do the IPC I decided to use TCP/IP and in my Qt app made a QTcpServer and used sockets.

          Basically my Qt app listens on a TCP/IP port and when anything capable of TCP/IP connects a new socket is created and the communication is bidirectional. To go a step farther I also wanted to play with Qt's JSON classes so I have the messages sent formatted with JSON so that it is easy to break apart the data and get to what is needed to make stuff happen.

          To get started check out voidrealms on YouTube he has some good videos where he sets up a solid QTcpServer application. It may be overkill for your app but will certainly help get you out of the dark.

          1 Reply Last reply
          4
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            Depending on the type of messaging you want to do, ZeroMQ might also be of interest.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1
            • O Offline
              O Offline
              opengpu
              wrote on last edited by
              #6

              any one familiar with Python CGI?

              1 Reply Last reply
              0
              • O Offline
                O Offline
                opengpu
                wrote on last edited by
                #7

                someone told me by using CGI, i can start the C++ app & Python app, and at runtime, the C++ app can send Message to Python app...

                jsulmJ 1 Reply Last reply
                0
                • O opengpu

                  someone told me by using CGI, i can start the C++ app & Python app, and at runtime, the C++ app can send Message to Python app...

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @opengpu CGI is an antique technique to write web server scripts. It is not meant to be used as IPC...

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  3
                  • O Offline
                    O Offline
                    opengpu
                    wrote on last edited by
                    #9

                    thank you. so that guy is wrong....

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved