Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. how to display script output in text browser
Forum Updated to NodeBB v4.3 + New Features

how to display script output in text browser

Scheduled Pinned Locked Moved Unsolved Qt for Python
10 Posts 3 Posters 2.5k Views 1 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.
  • Y Offline
    Y Offline
    yugapatil
    wrote on last edited by
    #1

    I want to create an ui with a button when clicked will launch a python script and I want to display its output in text browser below it.The output in text window should look as if it runs in terminal. I'm new in Qt I tried to do the same with QProcess but failed.

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

      Hi and welcome to devnet,

      Are you writing your code in Python ?

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

      Y 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Are you writing your code in Python ?

        Y Offline
        Y Offline
        yugapatil
        wrote on last edited by
        #3

        @SGaist Yes in Python PyQt5

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

          Then why run the other script using QProcess ? Since everything is Python you can import the methods you want / need and execute them directly.

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

          Y 1 Reply Last reply
          2
          • ndiasN Offline
            ndiasN Offline
            ndias
            wrote on last edited by
            #5

            Hi @yugapatil

            Maybe you can follow this tutorial using QProcess:
            https://www.mfitzp.com/tutorials/qprocess-external-programs/

            Regards

            1 Reply Last reply
            1
            • SGaistS SGaist

              Then why run the other script using QProcess ? Since everything is Python you can import the methods you want / need and execute them directly.

              Y Offline
              Y Offline
              yugapatil
              wrote on last edited by
              #6

              @SGaist the other python script that I'm trying to call is so large that integrating it into the same file does not seem to be practical to me. Plus that other python script uses libraries that cannot be compiled with pyinstaller to create an executable.

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

                I did not say that you should integrate it, just use it.

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

                Y 1 Reply Last reply
                1
                • SGaistS SGaist

                  I did not say that you should integrate it, just use it.

                  Y Offline
                  Y Offline
                  yugapatil
                  wrote on last edited by
                  #8

                  @SGaist I'm lazy so I was trying to use shortcut here. Actually I coded the other script without using classes.
                  That's why trying to grab and display the required part in ui.

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

                    There's no need for classes, you can import methods, variables etc from other Python modules.

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

                    Y 1 Reply Last reply
                    2
                    • SGaistS SGaist

                      There's no need for classes, you can import methods, variables etc from other Python modules.

                      Y Offline
                      Y Offline
                      yugapatil
                      wrote on last edited by
                      #10

                      @SGaist Okay , thank you I will try it.

                      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