You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Webview Python supports binding asynchronous Python functions that can be called from JavaScript. This is useful for time-consuming operations that should not block the main thread.
156
+
157
+
```python
158
+
import asyncio
159
+
from webview.webview import Webview, Size, SizeHint
160
+
161
+
webview = Webview(debug=True)
162
+
163
+
# Async Python function that can be called from JavaScript
For a more complete example, see [bind_in_local_async.py](examples/bind_in_local_async.py) and [bind_in_local_async.html](examples/bind_in_local_async.html) in the examples directory.
226
+
153
227
## Features
154
228
155
229
- Create desktop applications using HTML, CSS, and JavaScript
156
230
- Load local HTML files or remote URLs
157
231
- Bidirectional Python-JavaScript communication
232
+
- Support for async Python functions with JavaScript promises
233
+
- Progress reporting for long-running tasks
158
234
- Window size and title customization
159
235
- Debug mode for development
160
236
- Cross-platform support (Windows, macOS, Linux)
@@ -261,6 +337,7 @@ python -m build -n -w
261
337
262
338
-[x] Publish to PyPI
263
339
-[x] Setup GitHub Actions for CI/CD
340
+
-[x] Add async function support
264
341
-[ ] Add preact example
265
342
-[ ] Add three.js example
266
343
-[ ] Add three.js fiber example
@@ -271,7 +348,11 @@ python -m build -n -w
271
348
## References
272
349
273
350
-[Webview](https://github.com/webview/webview)
351
+
-[webview C API IMPL](https://github.com/webview/webview/blob/master/core/include/webview/c_api_impl.hh)
352
+
-[Webview C API](https://github.com/webview/webview/blob/master/src/webview.h)
0 commit comments