Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 764 Bytes

pyodide_pyimport.md

File metadata and controls

22 lines (15 loc) · 764 Bytes

(js_api_pyodide_pyimport)=

pyodide.pyimport(name)

Access a Python object in the global namespace from Javascript.

For example, to access the foo Python object from Javascript:

var foo = pyodide.pyimport('foo')

Parameters

name type description
names String Python variable name

Returns

name type description
object any If one of the basic types (string, number,
boolean, array, object), the Python
object is converted to Javascript and
returned. For other types, a Proxy
object to the Python object is returned.