mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 02:37:41 -05:00
committed by
GitHub
parent
6df5905b2b
commit
bccd5e3750
@@ -1,4 +1,4 @@
|
||||
import { registerPlugin } from "@pyscript/core";
|
||||
import { define } from "@pyscript/core";
|
||||
|
||||
// append ASAP CSS to avoid showing content
|
||||
document.head.appendChild(document.createElement("style")).textContent = `
|
||||
@@ -17,9 +17,9 @@ let bootstrap = true,
|
||||
const sharedPyodide = new Promise((resolve) => {
|
||||
const pyConfig = document.querySelector("py-config");
|
||||
const config = pyConfig?.getAttribute("src") || pyConfig?.textContent;
|
||||
registerPlugin("py-script", {
|
||||
define("py", {
|
||||
config,
|
||||
type: "pyodide",
|
||||
interpreter: "pyodide",
|
||||
codeBeforeRunWorker: `print('codeBeforeRunWorker')`,
|
||||
codeAfterRunWorker: `print('codeAfterRunWorker')`,
|
||||
onBeforeRun(pyodide, node) {
|
||||
|
||||
Reference in New Issue
Block a user