新增功能
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
from pathlib import Path
|
||||
|
||||
p = Path(__file__).resolve().parent / "zhenyang-ai-console.html"
|
||||
text = p.read_text(encoding="utf-8")
|
||||
start = text.index(" <script>")
|
||||
end = text.index("</script>", start) + len("</script>")
|
||||
new = (
|
||||
' <script src="qrc:///qtwebchannel/qwebchannel.js"></script>\n'
|
||||
' <script src="console-app.js"></script>'
|
||||
)
|
||||
p.write_text(text[:start] + new + text[end:], encoding="utf-8")
|
||||
print("patched html", p.stat().st_size)
|
||||
Reference in New Issue
Block a user