Commit 294aee57 authored by Michael Droettboom's avatar Michael Droettboom Committed by GitHub

Merge pull request #247 from oeway/patch-1

languagePluginLoader is a Promise, not function
parents 1287eebd 090a8068
......@@ -8,14 +8,14 @@ Iodide](using_pyodide_from_iodide.md).
Include `pyodide.js` in your project.
This has a single function which bootstraps the Python environment:
`languagePluginLoader`. Since this must happen asynchronously, it returns a
This has a single `Promise` object which bootstraps the Python environment:
`languagePluginLoader`. Since this must happen asynchronously, it is a
`Promise`, which you must call `then` on to complete initialization. When the
promise resolves, pyodide will have installed a namespace in global scope:
`pyodide`.
```javascript
languagePluginLoader().then(() => {
languagePluginLoader.then(() => {
// pyodide is now ready to use...
console.log(pyodide.runPython('import sys\nsys.version'));
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment