From 6407eea858228c1a40c9d1f9879296cd195b9eeb Mon Sep 17 00:00:00 2001 From: yutent Date: Thu, 31 Aug 2023 19:18:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20create=5Fhmr=5Fserver?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- create_hmr_server.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 create_hmr_server.md diff --git a/create_hmr_server.md b/create_hmr_server.md new file mode 100644 index 0000000..2246aa1 --- /dev/null +++ b/create_hmr_server.md @@ -0,0 +1,14 @@ +内置热更新的支持, 依赖于`python3-watchdog`实现, 需要手动安装这个依赖。 + + +```python +from webengine.gtk3 import WebEngine, create_hmr_server + +web = WebEngine() +hmr = create_hmr_server() # 无需任何额外参数 + +web.set_root(path_to_web_root) +web.use(hmr) # 必须先设置网页根目录之后, 才可以加载**热更新**模块 +web.load() + +``` \ No newline at end of file