Build pywebview apps easily
Project description
webexe
Turn your HTML + Python project into a desktop application.
webexe uses pywebview to combine a web frontend with a Python backend, then optionally packages it into a Windows executable.
Features
- Use HTML / CSS / JavaScript as your UI
- Use Python as your backend
- Expose selected Python APIs to JavaScript
- Development mode with debugging support
- Build standalone executable with PyInstaller
How it works
HTML / JS
|
v
pywebview
|
v
Python API
|
v
Windows EXE
Only functions exposed through api are available to the frontend.
Example:
# back.py
def hello():
return "Hello from Python"
api = {
"hello": hello
}
Frontend:
const result = await window.pywebview.api.hello();
console.log(result);
Installation
pip install webexe
Create a project
Your project should contain:
myapp/
│
├─ index.html
├─ back.py
└─ build.py
Development
Run:
python build.py --dev
Development mode:
- Runs directly without packaging
- Opens pywebview debug tools
- Faster for testing
Build
Create executable:
python build.py
Output:
dist/
└─ MyApp.exe
Example
index.html
<!doctype html>
<html>
<body>
<h1>Hello webexe</h1>
<button onclick="test()">
Call Python
</button>
<script>
async function test() {
const result =
await window.pywebview.api.hello();
alert(result);
}
</script>
</body>
</html>
back.py
def hello():
return "Hello from Python"
api = {
"hello": hello
}
Why webexe?
Electron is powerful, but sometimes you only need:
- A lightweight desktop shell
- A web UI
- Python automation/backend
webexe provides a simpler bridge between web technologies and Python.
Roadmap
-
webexe initproject generator - Custom application name
- Better error messages
- More build options
Issues
Found a bug or have an idea?
Open an issue and include:
- Python version
- OS
- webexe version
- Error message
- Steps to reproduce
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file webexe-0.0.6.tar.gz.
File metadata
- Download URL: webexe-0.0.6.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de1864acfbdeab5ce62a9113633c2cdae85aa6c653a9ed72f1290250fb8d0102
|
|
| MD5 |
743403a55a0a3aea4d7bb4f2f2d3ed71
|
|
| BLAKE2b-256 |
65e647c3b69d14f1e906bc48e5a1c22c8af6fc2b6544d9e97ce44d2fd0a72183
|
File details
Details for the file webexe-0.0.6-py3-none-any.whl.
File metadata
- Download URL: webexe-0.0.6-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb961151f97d72d8da4f89579f48a85af5de4223ba1255d9f6a57dc76773d40a
|
|
| MD5 |
4a3f285542c1f064788c29f9c5c9cbce
|
|
| BLAKE2b-256 |
87fd1cb93004c0a68e54be51dd62007394f2144c008d7b6e77d7bb0598010fdf
|