Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Python in QT

Python in QT

Scheduled Pinned Locked Moved Solved Language Bindings
8 Posts 4 Posters 1.3k 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.
  • G Offline
    G Offline
    GSuarez
    wrote on last edited by
    #1

    Hi,

    I have a python script:

    #!/usr/bin/python
    print('hello world')

    I want to use QT for debugging and running this script. Something like I would do for example with PyCharm. Is it possible? If so, how?
    I have configured the "Run configuration" under Projects tab, but without success. I am completely new so I do not know exactly how to configure the debugger neither how to run the script.

    Any assistance is appreciated.

    Thanks

    jsulmJ 1 Reply Last reply
    0
    • G GSuarez

      Hi,

      I have a python script:

      #!/usr/bin/python
      print('hello world')

      I want to use QT for debugging and running this script. Something like I would do for example with PyCharm. Is it possible? If so, how?
      I have configured the "Run configuration" under Projects tab, but without success. I am completely new so I do not know exactly how to configure the debugger neither how to run the script.

      Any assistance is appreciated.

      Thanks

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

      @GSuarez said in Python in QT:

      I want to use QT for debugging and running this script

      Qt is a C++ framework.
      Do you maybe mean QtCreator which is a C++ IDE?
      If so, then I don't think you can use QtCreator to debug Python scripts as it is a C++ IDE, not Python.

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

      JonBJ 1 Reply Last reply
      1
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by mrjj
        #3

        Hi
        If you use pyside2 bindings then i think you can now debug also in Creator.
        https://doc.qt.io/qtforpython/gettingstarted.html
        https://wiki.qt.io/Qt_for_Python/GettingStarted

        1 Reply Last reply
        2
        • jsulmJ jsulm

          @GSuarez said in Python in QT:

          I want to use QT for debugging and running this script

          Qt is a C++ framework.
          Do you maybe mean QtCreator which is a C++ IDE?
          If so, then I don't think you can use QtCreator to debug Python scripts as it is a C++ IDE, not Python.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @jsulm said in Python in QT:

          If so, then I don't think you can use QtCreator to debug Python scripts as it is a C++ IDE, not Python.

          Although I'm not sure, I think @mrjj is right on this: since some release a while ago, I believe Creator now supports PySide2 editing and debugging(?)

          mrjjM 1 Reply Last reply
          0
          • JonBJ JonB

            @jsulm said in Python in QT:

            If so, then I don't think you can use QtCreator to debug Python scripts as it is a C++ IDE, not Python.

            Although I'm not sure, I think @mrjj is right on this: since some release a while ago, I believe Creator now supports PySide2 editing and debugging(?)

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @JonB
            It says so in the last link but
            Qt Creator 4.0+ can be used to open the PySide and Shiboken CMakeLists.txt files as projects, and thus provide usual IDE features for developing PySide - project file navigation, code completion (C++ only), following symbols under cursor (C++ only), syntax highlighting, locator usage, debugging, etc.

            so it sounds like it can but i did not try it as it uses cmake which i dont use.

            JonBJ 1 Reply Last reply
            0
            • mrjjM mrjj

              @JonB
              It says so in the last link but
              Qt Creator 4.0+ can be used to open the PySide and Shiboken CMakeLists.txt files as projects, and thus provide usual IDE features for developing PySide - project file navigation, code completion (C++ only), following symbols under cursor (C++ only), syntax highlighting, locator usage, debugging, etc.

              so it sounds like it can but i did not try it as it uses cmake which i dont use.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #6

              @mrjj said in Python in QT:

              code completion (C++ only), following symbols under cursor (C++ only)

              Oh dear :( That's no good, we need proper Python editing support, and use of the Python debugger if it's not saying it does that. Fortunately I'm not having to do Python atm, but sounds like PyCharm is still a better bet if this is true....

              mrjjM 1 Reply Last reply
              0
              • JonBJ JonB

                @mrjj said in Python in QT:

                code completion (C++ only), following symbols under cursor (C++ only)

                Oh dear :( That's no good, we need proper Python editing support, and use of the Python debugger if it's not saying it does that. Fortunately I'm not having to do Python atm, but sounds like PyCharm is still a better bet if this is true....

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @JonB
                Yeah i also noticed that. Not a friendly experience.
                Maybe it will come.

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  GSuarez
                  wrote on last edited by
                  #8

                  Thank you all for the discussion

                  1 Reply Last reply
                  1

                  • Login

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