@@ -96,9 +96,9 @@ class Element:
96
96
pyscript = PyScript()
97
97
`
98
98
99
- let loadInterpreter = async function ( ) : any {
100
- /* @ts -ignore */
99
+ let loadInterpreter = async function ( ) : Promise < any > {
101
100
console . log ( "creating pyodide runtime" ) ;
101
+ /* @ts -ignore */
102
102
pyodide = await loadPyodide ( {
103
103
stdout : console . log ,
104
104
stderr : console . log
@@ -108,15 +108,15 @@ let loadInterpreter = async function(): any {
108
108
console . log ( "loading micropip" ) ;
109
109
await pyodide . loadPackage ( "micropip" ) ;
110
110
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");
120
120
121
121
console . log ( "creating additional definitions" ) ;
122
122
let output = pyodide . runPython ( additional_definitions ) ;
@@ -125,7 +125,7 @@ let loadInterpreter = async function(): any {
125
125
return pyodide ;
126
126
}
127
127
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 > {
129
129
await runtime . loadPackage ( package_name ) ;
130
130
}
131
131
0 commit comments