Open MRYingLEE opened 2 months ago
In some customized code, I ran the following Typescript code for testing:
Curious where you run this code?
I put my testing code in the function of async execute(content: any, parent: any) , with an if-else branch near https://github.com/jupyterlite/pyodide-kernel/blob/67a976f0d8c8d21e246f46703c3940bb5f95e187/packages/pyodide-kernel/src/worker.ts#L307.
In future, the code will be run in a Jupyterlab frontend extension. For example, to let AI explain code along with the current values of the used global variables.
In a Jupyterlite with slightly customized Pyodide environment, I failed to access value of a global variable. In UI, I ran the following assignment statement in a cell:
In some customized code, I ran the following Typescript code for testing:
It failed to get the value of the global variable. But if the newCode assigned some value to vaiable "a", then the globals.get("a") would succeed afterwards.
It seems the namespace of Pyodide kernel is independent to that of pyodide.runPythonAsync().
Please clarify. Thanks,