Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
pyodide
Commits
294aee57
Commit
294aee57
authored
Nov 12, 2018
by
Michael Droettboom
Committed by
GitHub
Nov 12, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #247 from oeway/patch-1
languagePluginLoader is a Promise, not function
parents
1287eebd
090a8068
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
docs/using_pyodide_from_javascript.md
docs/using_pyodide_from_javascript.md
+3
-3
No files found.
docs/using_pyodide_from_javascript.md
View file @
294aee57
...
...
@@ -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
return
s a
This has a single
`Promise`
object
which bootstraps the Python environment:
`languagePluginLoader`
. Since this must happen asynchronously, it
i
s 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
\n
sys.version
'
));
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment