Skip to content
This repository has been archived by the owner on Dec 14, 2020. It is now read-only.

patrickmoffitt/python-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo 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:

  • 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

Demo

1 Tested on Mac OS 10.15, Ubuntu 20.04, and Windows 10

Project Status

This project has been archived and is no longer being maintained by the author.

About

How to Build an Electron GUI for a Python Module

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published