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. Feasibility of Embedding Jupyter-like Python Console in Qt using C++

Feasibility of Embedding Jupyter-like Python Console in Qt using C++

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 4 Posters 541 Views
  • 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.
  • F Offline
    F Offline
    farley
    wrote on 17 Jul 2024, 15:43 last edited by
    #1

    Hello Qt Community,

    I've searched on GitHub and found QtConsole, which is a Python implementation using PyQt but does not support C++. I'm exploring the feasibility of embedding a Jupyter-like Python console in my Qt application using C++. Is this idea feasible given this context, and if so, are there any resources or advice you can provide?

    Thank you!
    farley

    P 1 Reply Last reply 17 Jul 2024, 15:58
    0
    • F farley
      17 Jul 2024, 15:43

      Hello Qt Community,

      I've searched on GitHub and found QtConsole, which is a Python implementation using PyQt but does not support C++. I'm exploring the feasibility of embedding a Jupyter-like Python console in my Qt application using C++. Is this idea feasible given this context, and if so, are there any resources or advice you can provide?

      Thank you!
      farley

      P Offline
      P Offline
      Pl45m4
      wrote on 17 Jul 2024, 15:58 last edited by Pl45m4
      #2

      @farley

      Any I/O-TextWidget in Qt can be a Python console, if you pass the input to some underlaying QProcess and call the python interpreter in the background.
      (Hard to show graphics in there, I guess)

      But why?


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      F 1 Reply Last reply 18 Jul 2024, 00:37
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 17 Jul 2024, 17:30 last edited by
        #3

        Hi,

        Something is not clear for me in your question. Do you want to have a terminal in your application or do you want to be able to run Jupyter as done with QtConsole ?

        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
        0
        • P Pl45m4
          17 Jul 2024, 15:58

          @farley

          Any I/O-TextWidget in Qt can be a Python console, if you pass the input to some underlaying QProcess and call the python interpreter in the background.
          (Hard to show graphics in there, I guess)

          But why?

          F Offline
          F Offline
          farley
          wrote on 18 Jul 2024, 00:37 last edited by
          #4

          @Pl45m4 @SGaist thanks for your reply. i am not very clear on this idea. i just want to embed a python console in my application. terminal is too simple than jupyter. on the other hand, there is not a jupyter like console in github using qwidget, i don’t know if it’s a good idea to implement it such as named QJupyterWidget to replace the standard terminal for better appearance and better outputs when embedded into a application?

          A 1 Reply Last reply 18 Jul 2024, 10:26
          0
          • F farley
            18 Jul 2024, 00:37

            @Pl45m4 @SGaist thanks for your reply. i am not very clear on this idea. i just want to embed a python console in my application. terminal is too simple than jupyter. on the other hand, there is not a jupyter like console in github using qwidget, i don’t know if it’s a good idea to implement it such as named QJupyterWidget to replace the standard terminal for better appearance and better outputs when embedded into a application?

            A Offline
            A Offline
            artwaw
            wrote on 18 Jul 2024, 10:26 last edited by
            #5

            @farley Then as @Pl45m4 said - any text widget will do. You run input though the QProcess, pass the stdout (and possible stderr, depending on your use case) to the widget and done.

            For more information please re-read.

            Kind Regards,
            Artur

            F 1 Reply Last reply 18 Jul 2024, 10:33
            0
            • A artwaw
              18 Jul 2024, 10:26

              @farley Then as @Pl45m4 said - any text widget will do. You run input though the QProcess, pass the stdout (and possible stderr, depending on your use case) to the widget and done.

              F Offline
              F Offline
              farley
              wrote on 18 Jul 2024, 10:33 last edited by
              #6

              @artwaw how about supporting image and video which is supported in jupyter

              A 1 Reply Last reply 18 Jul 2024, 10:37
              0
              • F farley
                18 Jul 2024, 10:33

                @artwaw how about supporting image and video which is supported in jupyter

                A Offline
                A Offline
                artwaw
                wrote on 18 Jul 2024, 10:37 last edited by
                #7

                @farley From the top of my head I'd say you can arrange such output by usign QGraphicsView with a mixture of elements in it? Text, Pixmap, Video.

                For more information please re-read.

                Kind Regards,
                Artur

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 19 Jul 2024, 07:45 last edited by
                  #8

                  You might want to check the Serial port terminal example.

                  Depending on what you want to achieve Kate's terminal(article discussing having it on Windows as well) using Konsole might be another possibility. But all in all, you really need to define what you want to do as depending on that you will either ensure your user has python installed or you'll have python built into your application.

                  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
                  0

                  1/8

                  17 Jul 2024, 15:43

                  • Login

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