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

Bundle python into Qt application dmg and exe

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 2.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.
  • B Offline
    B Offline
    bhupi
    wrote on 30 May 2016, 12:49 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

    R 1 Reply Last reply 30 May 2016, 13:20
    0
    • B bhupi
      30 May 2016, 12:49

      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

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 30 May 2016, 13:20 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
      • B Offline
        B Offline
        bhupi
        wrote on 30 May 2016, 13:47 last edited by
        #3

        @raven-worx

        Thanks I will look into these.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 30 May 2016, 22:08 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

          B 1 Reply Last reply 31 May 2016, 06:39
          0
          • S SGaist
            30 May 2016, 22:08

            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 ?

            B Offline
            B Offline
            bhupi
            wrote on 31 May 2016, 06:39 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
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 31 May 2016, 22:26 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

              B 1 Reply Last reply 1 Jun 2016, 10:07
              0
              • S SGaist
                31 May 2016, 22:26

                QMAKE_BUNDLE_DATA is your friend for that

                B Offline
                B Offline
                bhupi
                wrote on 1 Jun 2016, 10:07 last edited by
                #7

                @SGaist I did it using QMAKE_BUNDLE_DATA
                thanks

                1 Reply Last reply
                0

                1/7

                30 May 2016, 12:49

                • Login

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