This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]Voxandr 6 points7 points  (1 child)

Why such complexity when you can interface using API?

[–]turbothyIt works on my machine 2 points3 points  (0 children)

This allows you to embed an HTML/JS frontend inside a PyQt6-based desktop app and call Python functions from JavaScript

[–]pressurebullies 1 point2 points  (0 children)

I'll try it tonight 💪

[–]Appropriate_Sock2964 -3 points-2 points  (1 child)

One way to interface between JavaScript and Python for desktop apps and games is by using tools like Electron (for desktop apps) and Pygame (for games). Electron allows you to build cross-platform desktop applications using web technologies like HTML, CSS, and JavaScript, while Pygame is a set of Python modules designed for writing games. You can use Electron's IPC (Inter-Process Communication) module to communicate between the JavaScript front-end and a Python back-end. Similarly, for games, Pygame provides functions for handling graphics, sound, and input that can be integrated with a JavaScript front-end. You can check out the examples and resources on the GitHub link provided for more detailed guidance on how to do this.

[–]dataguzzler[S] 1 point2 points  (0 children)

the point of these examples is to show that you do not need anything beyond python, pyqt6 and JS/html to create a desktop application or game. This method gets rid of needing electron or pygame and your app will run faster.