mirror of https://github.com/pyodide/pyodide.git
Improve REPL input behavior (#2509)
This commit is contained in:
parent
cefaa2f04c
commit
9341edcf9a
|
@ -14,6 +14,9 @@ substitutions:
|
|||
|
||||
## Unreleased
|
||||
|
||||
- {{ Fix }} Fix output bug with using `input()` on online console
|
||||
{pr}`2509`
|
||||
|
||||
- {{ Enhancement }} Update sqlite version to latest stable release
|
||||
{pr}`2477`
|
||||
|
||||
|
|
|
@ -25,7 +25,14 @@
|
|||
}
|
||||
|
||||
async function main() {
|
||||
globalThis.pyodide = await loadPyodide();
|
||||
var term;
|
||||
globalThis.pyodide = await loadPyodide({
|
||||
stdin: () => {
|
||||
var result = prompt();
|
||||
term.echo(result);
|
||||
return result;
|
||||
},
|
||||
});
|
||||
let namespace = pyodide.globals.get("dict")();
|
||||
pyodide.runPython(
|
||||
`
|
||||
|
@ -117,7 +124,7 @@
|
|||
unlock();
|
||||
}
|
||||
|
||||
let term = $("body").terminal(interpreter, {
|
||||
term = $("body").terminal(interpreter, {
|
||||
greetings: banner,
|
||||
prompt: ps1,
|
||||
completionEscape: false,
|
||||
|
|
Loading…
Reference in New Issue