使用 skulpt 作为 Python 执行器
Some checks failed
Deploy / build-and-deploy (push) Has been cancelled

This commit is contained in:
2026-01-13 20:19:50 +08:00
parent ff170ae2ce
commit 8260aa197d
3 changed files with 190 additions and 9 deletions

View File

@@ -19,6 +19,10 @@ function runSkulptTurtle() {
const canvas = turtleCanvas.value
if (!canvas) return
canvas.innerHTML = ""
// Prevent UI from being stuck forever on infinite loops (still runs on main thread).
// Skulpt checks this limit periodically and throws a timeout error.
;(Sk as any).execLimit = 5000
;(Sk as any).execStart = new Date()
Sk.configure({
output: console.log,
read: builtinRead,