Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 46690ca

Browse files
committed
remove pyscript being loaded externally for now
1 parent df08837 commit 46690ca

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

pyscriptjs/examples/todo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from datetime import datetime as dt
2-
from pyscript import Element
2+
# from pyscript import Element
33
from js import console
44

55
tasks = []

pyscriptjs/src/interpreter.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ class Element:
9696
pyscript = PyScript()
9797
`
9898

99-
let loadInterpreter = async function(): any {
100-
/* @ts-ignore */
99+
let loadInterpreter = async function(): Promise<any> {
101100
console.log("creating pyodide runtime");
101+
/* @ts-ignore */
102102
pyodide = await loadPyodide({
103103
stdout: console.log,
104104
stderr: console.log
@@ -108,15 +108,15 @@ let loadInterpreter = async function(): any {
108108
console.log("loading micropip");
109109
await pyodide.loadPackage("micropip");
110110
console.log('loading pyscript module');
111-
await pyodide.runPythonAsync(`
112-
from pyodide.http import pyfetch
113-
response = await pyfetch("/build/pyscript.py")
114-
with open("pyscript.py", "wb") as f:
115-
content = await response.bytes()
116-
print(content)
117-
f.write(content)
118-
`)
119-
let pkg = pyodide.pyimport("pyscript");
111+
// await pyodide.runPythonAsync(`
112+
// from pyodide.http import pyfetch
113+
// response = await pyfetch("/build/pyscript.py")
114+
// with open("pyscript.py", "wb") as f:
115+
// content = await response.bytes()
116+
// print(content)
117+
// f.write(content)
118+
// `)
119+
// let pkg = pyodide.pyimport("pyscript");
120120

121121
console.log("creating additional definitions");
122122
let output = pyodide.runPython(additional_definitions);
@@ -125,7 +125,7 @@ let loadInterpreter = async function(): any {
125125
return pyodide;
126126
}
127127

128-
let loadPackage = async function(package_name: string[] | string, runtime: any): any {
128+
let loadPackage = async function(package_name: string[] | string, runtime: any): Promise<any> {
129129
await runtime.loadPackage(package_name);
130130
}
131131

0 commit comments

Comments
 (0)