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. Bundle python into Qt application dmg and exe
QtWS25 Last Chance

Bundle python into Qt application dmg and exe

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 2.2k 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.
  • bhupiB Offline
    bhupiB Offline
    bhupi
    wrote on last edited by A Former User
    #1

    HI

    I need to execute python script from my desktop application which will run on both mac and windows platform.

    I want to take advice what and which will be the best way to bundle python in my Qt standalone application(exe and dmg). I read about Pythonqt cython etc.

    Thanks

    raven-worxR 1 Reply Last reply
    0
    • bhupiB bhupi

      HI

      I need to execute python script from my desktop application which will run on both mac and windows platform.

      I want to take advice what and which will be the best way to bundle python in my Qt standalone application(exe and dmg). I read about Pythonqt cython etc.

      Thanks

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @bhupi
      you can bundle the python interpreter executable (there is a portable version of python on the web), extract it and call it with QProcess passing your script.
      It's by far not the most beautiful solution. Better notify the user that the system hasn't python installed and that they need to install it in order to use your application.

      Is this script written by yourself?
      If yes and depending on the needed capabilities you might want to use Qt's JavaScript engine instead?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • bhupiB Offline
        bhupiB Offline
        bhupi
        wrote on last edited by
        #3

        @raven-worx

        Thanks I will look into these.

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

          Hi,

          To add to @raven-worx, OS X has python installed by default, so basically it will rather be a Windows problem.

          Did you check the embedding python chapter of Python's documentation ?

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

          bhupiB 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            To add to @raven-worx, OS X has python installed by default, so basically it will rather be a Windows problem.

            Did you check the embedding python chapter of Python's documentation ?

            bhupiB Offline
            bhupiB Offline
            bhupi
            wrote on last edited by
            #5

            I executed Python script using QProcess. But how i can bundle that script with qt dmg file which is i am creating using macdeployqt.

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

              QMAKE_BUNDLE_DATA is your friend for that

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

              bhupiB 1 Reply Last reply
              0
              • SGaistS SGaist

                QMAKE_BUNDLE_DATA is your friend for that

                bhupiB Offline
                bhupiB Offline
                bhupi
                wrote on last edited by
                #7

                @SGaist I did it using QMAKE_BUNDLE_DATA
                thanks

                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