A starting point for setting up an app with an Electron GUI and a Python backend.
It is recommended that you set up two virtual environments for this project. One Python2 and one Python3. You will need the Python2 environment to be able to install the Node.js module zerorpc, since zerorpc needs to be compiled. The compiler in Node.js only works with Python3.
- Debug - Should debug output be active or not.
- ZeroRPC - Settings related to the ZeroRPC server
- connection - Settings related to the connection to the ZeroRPC server
- host - Address of the backend server, default is localhost or 127.0.0.1
- port - Port of the backend server, default is 8484
- connection - Settings related to the connection to the ZeroRPC server
- Python - Settings related to the python backend server
- path - Settings related to the paths
- environment dir - Base directory of the python environment. It is assumed that the python executable is in the subfolder bin/
- server dir - Directory in which the server script resides
- server script - Name of the backend server script
- path - Settings related to the paths
Before every npm install the command electron-rebuild (node_modules/.bin/electron-rebuild) needs to be executed. This small script bundles the two commands.
NOTE: Before running this script, make sure that your Python2 virtual environment is activated.
NOTE:
- In order to install pyinstaller you can't use pip version 19.1. You need to use 18.1 or lower. This is due to a bug in pip 19.1.
- In order to install the node module zerorpc you need the MSBuild tools installed. You can install them by running the command npm install --global windows-build-tools in PowerShell as an administrator.