13 lines
447 B
Python
13 lines
447 B
Python
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)
|