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). ...@@ -8,14 +8,14 @@ Iodide](using_pyodide_from_iodide.md).
Include `pyodide.js` in your project. Include `pyodide.js` in your project.
This has a single function which bootstraps the Python environment: This has a single `Promise` object which bootstraps the Python environment:
`languagePluginLoader`. Since this must happen asynchronously, it returns a `languagePluginLoader`. Since this must happen asynchronously, it is a
`Promise`, which you must call `then` on to complete initialization. When the `Promise`, which you must call `then` on to complete initialization. When the
promise resolves, pyodide will have installed a namespace in global scope: promise resolves, pyodide will have installed a namespace in global scope:
`pyodide`. `pyodide`.
```javascript ```javascript
languagePluginLoader().then(() => { languagePluginLoader.then(() => {
// pyodide is now ready to use... // pyodide is now ready to use...
console.log(pyodide.runPython('import sys\nsys.version')); 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