mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 11:15:36 -05:00
support different pyodide versions (#328)
* add PyLoader class * create global loader during app creation time and remove it when pyscript loading operations are done * make the loader global and open/close when apps is starting. Also add concept of app config so users can set if they want to autoclose the loader of handle it themselves * add pyconfig file * auto add global config if there's no config set in the page * export initializer type * define type for config * move initialization out of svelte file, into app config * change runtimes from strings to objects * fix typo
This commit is contained in:
@@ -3,11 +3,12 @@ import { getLastPath } from './utils';
|
||||
let pyodideReadyPromise;
|
||||
let pyodide;
|
||||
|
||||
const loadInterpreter = async function (): Promise<any> {
|
||||
const loadInterpreter = async function (indexUrl:string): Promise<any> {
|
||||
console.log('creating pyodide runtime');
|
||||
// eslint-disable-next-line
|
||||
// @ts-ignore
|
||||
pyodide = await loadPyodide({
|
||||
// indexURL: indexUrl,
|
||||
stdout: console.log,
|
||||
stderr: console.log,
|
||||
fullStdLib: false
|
||||
|
||||
Reference in New Issue
Block a user