https://github.com/acetrak/pywebview-quick-start
Developing Desktop Applications with pywebview + vite
https://github.com/acetrak/pywebview-quick-start
desktop desktop-application pywebview
Last synced: 3 days ago
JSON representation
Developing Desktop Applications with pywebview + vite
- Host: GitHub
- URL: https://github.com/acetrak/pywebview-quick-start
- Owner: acetrak
- Created: 2023-05-19T03:05:32.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-02-16T01:43:24.000Z (about 1 year ago)
- Last Synced: 2025-05-06T18:08:50.905Z (10 months ago)
- Topics: desktop, desktop-application, pywebview
- Language: JavaScript
- Homepage:
- Size: 136 KB
- Stars: 8
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Developing Desktop Applications with pywebview + vite
# Directory Structure
-app vite application (frontend)
-main.py application entry file
# Development Stage
1. Enter /app directory
`pnpm i`
`pnpm run dev`
2. Configure `main.py`
```python
if __name__ == '__main__':
api = Api()
window = webview.create_window('pywebview', 'http://localhost:5173', js_api=api, )
webview.start(debug=True)
```
3. Launch the main program
Run `main.py`
# Packaging the Application
1. Enter /app directory
`pnpm run build`
2. Configure `main.py`
```python
if __name__ == '__main__':
api = Api()
window = webview.create_window('pywebview + vue3', server, js_api=api, )
webview.start(debug=False)
```
3. Use `auto-py-to-exe` for packaging
```bash
pip install auto-py-to-exe
# Launch the tool
auto-py-to-exe
```
Select the entry point `main.py`, and add the gui directory generated from the vite build
