mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 10:17:23 -05:00
41 lines
1.6 KiB
HTML
41 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>PyScript Bridge</title>
|
|
<script type="importmap">
|
|
{
|
|
"imports": {
|
|
"https://esm.run/@pyscript/bridge": "https://esm.run/@pyscript/bridge@latest",
|
|
"https://esm.run/@pyscript/bridge/test/test.js": "https://esm.run/@pyscript/bridge@latest/test/test.js"
|
|
}
|
|
}
|
|
</script>
|
|
<style>body { font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; }</style>
|
|
<link rel="stylesheet" href="https://pyscript.net/releases/2025.5.1/core.css" />
|
|
<script type="module" src="https://pyscript.net/releases/2025.5.1/core.js"></script>
|
|
<script type="module">
|
|
const cdn_test = 'https://esm.run/@pyscript/bridge/test/test.js';
|
|
const { ffi: { test_func, test_other, version } } = await import(cdn_test);
|
|
|
|
console.time("⏱️ first invoke");
|
|
const result = await test_func("PyScript Bridge");
|
|
console.timeEnd("⏱️ first invoke");
|
|
|
|
document.body.append(
|
|
Object.assign(
|
|
document.createElement("h3"),
|
|
{ textContent: result },
|
|
),
|
|
document.createElement("hr"),
|
|
await version(),
|
|
);
|
|
|
|
console.time("⏱️ other invokes");
|
|
await test_other("🐍");
|
|
console.timeEnd("⏱️ other invokes");
|
|
</script>
|
|
</head>
|
|
</html>
|