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
Forum Updated to NodeBB v4.3 + New Features

Python in QT

Scheduled Pinned Locked Moved Solved Language Bindings
8 Posts 4 Posters 1.3k 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.
  • G Offline
    G Offline
    GSuarez
    wrote on 15 Jul 2020, 14:54 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

    J 1 Reply Last reply 15 Jul 2020, 15:09
    0
    • G GSuarez
      15 Jul 2020, 14:54

      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

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 15 Jul 2020, 15:09 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

      J 1 Reply Last reply 15 Jul 2020, 16:18
      1
      • M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 15 Jul 2020, 15:14 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
        • J jsulm
          15 Jul 2020, 15:09

          @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.

          J Offline
          J Offline
          JonB
          wrote on 15 Jul 2020, 16:18 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(?)

          M 1 Reply Last reply 15 Jul 2020, 16:20
          0
          • J JonB
            15 Jul 2020, 16:18

            @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(?)

            M Offline
            M Offline
            mrjj
            Lifetime Qt Champion
            wrote on 15 Jul 2020, 16:20 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.

            J 1 Reply Last reply 15 Jul 2020, 16:23
            0
            • M mrjj
              15 Jul 2020, 16:20

              @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.

              J Offline
              J Offline
              JonB
              wrote on 15 Jul 2020, 16:23 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....

              M 1 Reply Last reply 15 Jul 2020, 16:24
              0
              • J JonB
                15 Jul 2020, 16:23

                @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....

                M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 15 Jul 2020, 16:24 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 17 Jul 2020, 08:38 last edited by
                  #8

                  Thank you all for the discussion

                  1 Reply Last reply
                  1

                  8/8

                  17 Jul 2020, 08:38

                  • Login

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