Hi, thanks for this good tool.
In a normal python program, we can use
# in main program
a = demoClass()
a.doSomething1()
# after a while
a.doSomething2() # this can use some internal object
static
or global
variableI realize that every python allocated object will keep in memory and the 2nd execution of the python script can access them. However, the current implementation (pyodide.runPython
) looks like it is to execute a one-time python script for the 1st time, 2nd time, 3rd time...
The only way I think of is to use like
if 'myVar' in globals():
# it means 2nd time and do a different thing, e.g. use existing object
A little tricky, or is it possible to add one parameter for runPython
to specify different behavior for the same python code in the future? Or using pyodide.eval_code_async
(instead of runPythonAsync
) to adjust the parameters passed into the 2nd time execution and use it to do conditional statement?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4