File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
- importScripts ( "https://cdn.jsdelivr.net/npm/ pyodide@0 .23.4/pyodide.min .js" ) ;
1
+ importScripts ( "https://cdn.jsdelivr.net/pyodide/v0 .23.4/full/ pyodide.js" ) ;
2
2
declare var loadPyodide ;
3
3
4
4
let onStdout : ( ( str ) => void ) | null = null ;
5
5
6
6
// Start loading Pyodide asynchronously.
7
7
const loadPython = ( async ( ) => {
8
- return await loadPyodide ( {
8
+ let pyodide = await loadPyodide ( {
9
9
stdout : ( msg ) => {
10
10
if ( msg === "Python initialization complete" ) return ;
11
11
if ( onStdout ) onStdout ( msg ) ;
12
12
} ,
13
13
} ) ;
14
+
15
+ // Install micropip by default. Users can install
16
+ // additional packages using `micropip.install()`.
17
+ await pyodide . loadPackage ( "micropip" ) ;
18
+
19
+ return pyodide ;
14
20
} ) ( ) ;
15
21
16
22
self . onmessage = async ( e : MessageEvent ) => {
You can’t perform that action at this time.
0 commit comments