https://github.com/patrickmoffitt/python-example
How to Build an Electron GUI for a Python Module
https://github.com/patrickmoffitt/python-example
electron gui python
Last synced: 9 months ago
JSON representation
How to Build an Electron GUI for a Python Module
- Host: GitHub
- URL: https://github.com/patrickmoffitt/python-example
- Owner: patrickmoffitt
- License: mit
- Archived: true
- Created: 2017-06-09T16:22:33.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-12-13T19:17:21.000Z (about 5 years ago)
- Last Synced: 2025-04-30T08:56:30.915Z (9 months ago)
- Topics: electron, gui, python
- Language: JavaScript
- Size: 757 KB
- Stars: 107
- Watchers: 8
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

How to Build an Electron GUI for a Python Module
------------------------------------------------
This project demonstrates how to display the output of a Python module in Electron. The demonstration code performs the following features across platforms [1](#f1):
- Detect if Python 3+ is installed
- Detect if application specific Python module dependencies are installed
- List installed, top-level, Python modules in an Electron BrowserWindow
September 2020 Update
---------------------
- Revised the Python code to version 3.8 best practices.
- Revised the Electron code to version 10.1
- Tested the project on Mac OS 10.15, Ubuntu 20.04, and Windows 10.
Quick Code Tour
---------------
- The code entry point is in **package.json** under the key "main". The value is "main.js"
- **main.js** creates a BrowserWindow and loads **index.html**.
- **index.html** displays a button to click to get a list of top-level Python modules and loads **renderer.js**.
- **renderer.js** loads jQuery and provides an event handler for the button. It also checks for Python 3+ and dependencies. On Win32 it also unpacks it's Python modules from the Electron Asar and places them in app.getPath('userData'). See controller.initPythonWin32() for more.
Animated Screenshot
-------------------

1 Tested on Mac OS 10.15, Ubuntu 20.04, and Windows 10[↩](#a1)
Project Status
--------------
This project has been archived and is no longer being maintained by the author.