{"id":26649804,"url":"https://github.com/non-npc/javascript-and-python-interfacing-examples","last_synced_at":"2026-03-01T03:03:44.441Z","repository":{"id":282106468,"uuid":"946318129","full_name":"non-npc/Javascript-and-python-interfacing-examples","owner":"non-npc","description":"Examples of interfacing between javascript and python for desktop apps and games","archived":false,"fork":false,"pushed_at":"2025-03-12T20:00:36.000Z","size":117,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T03:14:37.349Z","etag":null,"topics":["bridge","desktop-app","desktop-game","html-css-javascript","javascript","pyqt6","python","webview"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/non-npc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-11T00:31:05.000Z","updated_at":"2025-03-12T20:00:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"08759b55-3ec0-4092-82ce-13697a308516","html_url":"https://github.com/non-npc/Javascript-and-python-interfacing-examples","commit_stats":null,"previous_names":["non-npc/javascript-and-python-interfacing-examples"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/non-npc/Javascript-and-python-interfacing-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/non-npc%2FJavascript-and-python-interfacing-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/non-npc%2FJavascript-and-python-interfacing-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/non-npc%2FJavascript-and-python-interfacing-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/non-npc%2FJavascript-and-python-interfacing-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/non-npc","download_url":"https://codeload.github.com/non-npc/Javascript-and-python-interfacing-examples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/non-npc%2FJavascript-and-python-interfacing-examples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29959284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T01:47:18.291Z","status":"online","status_checked_at":"2026-03-01T02:00:07.437Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bridge","desktop-app","desktop-game","html-css-javascript","javascript","pyqt6","python","webview"],"created_at":"2025-03-25T01:01:44.270Z","updated_at":"2026-03-01T03:03:44.412Z","avatar_url":"https://github.com/non-npc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Javascript-and-python-interfacing-examples\nExamples of interfacing between javascript and python for desktop apps and games without requiring a localhost server component.\n\nYou can achieve the same functionality as [eel](https://github.com/python-eel/Eel) or Electron by using PyQt6's QWebEngineView in combination with QWebChannel to create a bridge between Python and JavaScript.\\\nThis allows you to embed an HTML/JS frontend inside a PyQt6-based desktop app and call Python functions from JavaScript (and vice versa).\n\n# How This Works:\n**QWebEngineView:** A browser component inside PyQt6 that can render HTML, CSS, and JavaScript.\\\n  pip install PyQt6-WebEngine\\\n**QWebChannel:** A communication bridge that lets JavaScript call Python functions directly.\\\n  qwebchannel.js is available [here](https://github.com/qt/qtwebchannel/blob/dev/examples/webchannel/shared/qwebchannel.js)\\\n**Python acts as the backend**, while **HTML/JavaScript provide the frontend**.\n\n\n# Examples:\n\n**main.py** will load **multi-threading_demo.html** by default.\\\nTo try the other demos, simply replace that line 160 in main.py with the name of the desired demo file you wish to see.\n\n## multi-threading_demo.html\n![Screenshot 1](screenshot01.png)\n\n1. Echo Demo\n    - takes the input and sends it to python then back to javascript\n2. Multi-Threading Demo\n    - each click creates a task that runs for the input number of seconds in parallel with other running tasks\n3. Data Processing Demo\n    - takes the input and send it to python where it is validated or denied then sent back to javascript\n\n## game_demo.html (pixel.js game)\n![Screenshot 2](screenshot02.png)\n\nUses the pixel.js coin collector game demo, with added save/load game state functionality.\\\nDemonstrates how to use the qwebchannel bridge to send save/load messages and data to python for processing.\n\n*The assets are from the pixel.js coin collector demo (https://github.com/rastating/pixel.js)*\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnon-npc%2Fjavascript-and-python-interfacing-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnon-npc%2Fjavascript-and-python-interfacing-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnon-npc%2Fjavascript-and-python-interfacing-examples/lists"}