The PyScript Bridge Helper (#2353)

* The PyScript Bridge Helper

* added importmap to test latest versions with ease
This commit is contained in:
Andrea Giammarchi
2025-06-26 12:41:29 +02:00
committed by GitHub
parent d68260c0c7
commit 7336ae545e
9 changed files with 352 additions and 0 deletions

22
bridge/test/test.py Normal file
View File

@@ -0,0 +1,22 @@
from pyscript import config, RUNNING_IN_WORKER
type = config["type"]
print(f"{type}-script", RUNNING_IN_WORKER and "worker" or "main")
def test_func(message):
print("Python", message)
return message
def test_other(message):
print("Python", message)
return message
def version():
try:
from sys_version import version
except ImportError:
version = lambda: "no config"
return version()