PyScript Core Documentation (#1560)

This commit is contained in:
Andrea Giammarchi
2023-06-27 16:53:19 +02:00
committed by GitHub
parent bf6470c046
commit 9121071ba3
18 changed files with 627 additions and 69 deletions

View File

@@ -57,15 +57,4 @@ img = document.createElement("img")
img.style.transform = "scale(.5)"
img.src = "data:image/png;base64," + base64.b64encode(buf.read()).decode("UTF-8")
# document.body.append(img) fails for some reason I don't understand
# same would be for document.querySelector("#image").append(img)
# those would work in any JS counterpart though ... but for demo sake:
document.querySelector("#image").innerHTML = img.outerHTML
# about pyodide issue
print(xworker.window.Array(1, 2)) # this works
xworker.window.console.log(1, 2) # this works too
# xworker.window.console.log(xworker.window.Array(1, 2)) # this doesn't
# xworker.window.console.log([1, 2]) # also this doesn't
# xworker.window.console.log(to_js({})) # this doesn't neither
document.body.append(img)