Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Solved How can I integrate python in my C++ application

    General and Desktop
    4
    4
    118
    Loading More Posts
    • 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.
    • Thank You
      Thank You last edited by

      Lets take example of software that uses python as one of library which is built in C++

      The software needs to hear what user is saying
      So I can use any library of python to do that
      CMU Sphinx
      Snowboy Hotword Detection
      Google Speech Recognition.

      How can I use these both things together (PYTHON AND C++)

      https://docs.python.org/2/extending/embedding.html#embedding-python-in-c
      Here is link from python but I want to solve my problem

      If Possible Provide same thing with javascript tooooooo

      Thank You

      Let's make QT free or It will go forever

      TRUE AND FALSE <3

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        Hi
        Maybe this can help ?
        https://www.codeproject.com/Articles/820116/Embedding-Python-program-in-a-C-Cplusplus-code

        1 Reply Last reply Reply Quote 2
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          Hi,

          From the looks of it, they can be all used through C++. Why do you need Python ?

          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 Reply Quote 2
          • gde23
            gde23 last edited by

            The link that you posted basically already describes how to embed python (however it is for python 2 which is no longer supported, but the same thing can be done with python3 see here.

            However the reason why someone would embed python in c++ typically is, that you have a compiled application and want the user to be able to make some scripting in python to extend the functionality, write own plugins and stuff like that.

            If you just want to use some libs then I'm almost sure that it does not make a lot of sense to use the python libs while programming in c++. Either write everything in python or search for c++-libs that provide the functions you need.
            Or what exactly is the reason that you want to go with this mixed approach?

            1 Reply Last reply Reply Quote 2
            • First post
              Last post