【问题标题】:How can I bundle Python 3.x to my Electron App that uses ReactJs?如何将 Python 3.x 捆绑到使用 ReactJs 的 Electron 应用程序中?
【发布时间】:2020-01-15 08:45:20
【问题描述】:

我有一个要在客户计算机上使用的电子应用程序。

应用程序需要打开 IEDriver.exe 才能打开一些带有一些代理的 URL。所以我通过 Python-Shell 包调用了一个使用 selenium 和 IEDriver 的 python 脚本。

当我构建我的电子应用程序时,它在我的机器上运行良好,因为我已经安装了 Python 3.x。但是当我将它发布给客户使用时,Python 3.x 应该安装在他们的机器上。那么如何将 Python3.x 与我的应用程序捆绑在一起呢?

这是我的构建配置,提前致谢。

    "scripts": {
        "start": "react-scripts start",
        "build": "react-scripts build && npm run electron-build",
        "react-build": "react-scripts build",
        "test": "react-scripts test",
        "eject": "react-scripts eject",
        "electron-start": "electron .",
        "electron-build": "electron-builder",
        "postinstall": "electron-builder install-app-deps"
    },
    "build": {
      "appId": "sampleAppId",
      "extends": null,
      "win": {
        "asar": true,
        "target": "nsis",
        "icon": "./build/assets/icon.png"
      },
      "nsis": {
        "oneClick": true,
        "installerLanguages": "en_US",
        "displayLanguageSelector": true,
        "multiLanguageInstaller": true,
        "unicode": true
      },
      "files": [
        "./build/**/*",
        "./public/Main.js",
        "./src/electron/*"
      ]
     }

【问题讨论】:

    标签: python reactjs electron publish


    【解决方案1】:

    您可以使用捆绑任何东西。 Innosetup.

    您可以使用Standalone - Portable Winpython。

    【讨论】:

    • mac 和 linux 用户呢?
    猜你喜欢
    • 2018-06-01
    • 2014-10-08
    • 1970-01-01
    • 1970-01-01
    • 2018-04-27
    • 2019-09-15
    • 2013-07-29
    • 2020-01-22
    • 1970-01-01
    相关资源
    最近更新 更多