mojo-python-interop - Mojo-Python Interoperability Guide
Write Mojo code that interoperates with Python using current syntax and conventions
Tags
Updated: 2026-05-28Capabilities
Typical Inputs
Typical Outputs
What this skill does
- import Python modules
- convert Python objects
- convert Mojo types
- create Python collections
- access Python attributes
- evaluate Python code
- handle Python exceptions
- build Python extensions
- export Mojo functions
- export Mojo types
- import Mojo modules
Inputs
- Python modules
- Python types
- Python code
- Python objects
- Python extension definitions
Outputs
- Python shared libraries
- Python modules
- Python objects
- Mojo types as Python objects
Requirements
- Mojo compiler
