#๐Ÿ”’ Best Library to Connect a Python Backend with a HTML/CSS/JS GUI for a Desktop App

24 messages ยท Page 1 of 1 (latest)

dense shuttle
#

Hello,

I am trying to make a desktop app version of a small terminal program I made. This will be my first desktop app. The program prompts the user to input data which gets printed as a little report and, upon confirming that the info is correct, the program connects to the Google Sheets API to save those results as a new row in a certain Sheets file.

I now want to make a GUI for this program and turn it into a small widget that runs from an executable that sits atop a webpage so that the user can input the info easier. I included a picture of some sketches I drew of how I'm currently thinking it will work.

I want to use HTML/CSS/JS to make the GUI- because I already know how to use them to make web applications- and want to process the data inputted into the GUI in Python, display the results from Python to the GUI, and upon confirmation from the user, have Python connect to the Sheets API and add to the Sheets spreadsheet. I've connected Python to a webpage with Flask, but read that it's unwieldy for desktop apps.

In the comments is a list of libraries I've found and some pros and cons about them. Is there any within or without them that you'd recommend to create a small, always-on-top desktop app that connects a Python backend to a HTML/CSS/JS GUI or some other customizable GUI?

Thank you in advance

pale jasperBOT
#

@dense shuttle

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

dense shuttle
#

The options I've found are thus:

  1. Electron
    Pros:
  • There is a Medium article from like 6 years ago detailing how it worked
  • There is an Electron-Flask template on GitHub, that might allow for easier translation between the languages than was mentioned in the article
    Cons:
  • I have seen comments stating that Electron apps don't work well in Linux
  • I have also seen comments stating that debugging between the languages can be difficult
  • Also, it apparently eats a lot of user memory
  1. Python-eel
    Pros:
  • It seems to be currently up-kept, with the GitHub page last being updated 2 months ago
  • It's README says it's good for small utility apps, like the one I'm trying to make
    Cons:
  • I can't find a lot of resources about it outside of the Github page
  • I can't find a lot of comparisons between it and other options
  1. Tkinter
    Pros:
  • Accessibility
  • It's just Python
    Cons:
  • Hideous, apparently
  • Doesn't allow for HTML/CSS/JS for GUI customization
  • Saw a comment saying it doesn't work properly with screen readers
  1. PyQt
    Pros:
  • Good interface tools
  • Extensive documentation
    Cons:
  • Mentioned as being "difficult to theme"
  • Apparently has a steep learning curve
  • Seems to rely on knowing C++, which I do not
  • Also does not allow for customization with HTML/CSS/JS
brisk sage
#

A lot of stuff to read bruh

#

I suggest shortening ur queries makes it easier for ppl to answer

#

Also, electron seems like a really good option for u imo. I have used electron in Linux, didn't run into much issues so far

dense shuttle
dense shuttle
dull bone
#

what does "an executable that sits atop a webpage" mean?

dense shuttle
# dull bone what does "an executable that sits atop a webpage" mean?

The app would be packaged where you can run an .exe file and it opens the app that's always-on-top, even if you click off it, like how a popup extension in the browser does. The intention is for the user to be able to copy and paste details from a website into the app's textbox.

dull bone
#

sorry didn't understand that at all

#

are you buiding a web site?

#

is your web site going to distribute executable programs?

brisk sage
#

That's what I understood

dense shuttle
# dull bone are you buiding a web site?

No, just the desktop app.
I had heard that pyinstaller could be used to turn Python code into an executable and found some StackOverflow answers that mentioned being able to package Electron, at least, into a single executable file as well.
I'll admit I still have to look further into it

dense shuttle
brisk sage
dense shuttle
#

@brisk sage Do you know any tutorials or examples about using Python with Electron that you'd recommend looking at?

dull bone
#

OK I cannot help at all with pyinstaller; good luck

dense shuttle
pale jasperBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.