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 can I integrate python in my C++ application
Forum Update on Tuesday, May 27th 2025

How can I integrate python in my C++ application

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 4 Posters 433 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.
  • Thank YouT Offline
    Thank YouT Offline
    Thank You
    wrote on last edited by
    #1

    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
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

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

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

        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
        2
        • gde23G Offline
          gde23G Offline
          gde23
          wrote on last edited by
          #4

          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
          2

          • Login

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