Passing Mojo Data to Python
Hand values across the interop bridge.
Crossing the Bridge
To use a Python library, your Mojo values must cross into Python first. That hand-off is the heart of interop. 🌉
Numbers Convert
Mojo numbers turn into Python numbers automatically when you pass them. A Mojo Int becomes a Python int the library can read.
var n = 42
var result = np.array([n])All lessons in this course
- Using NumPy from Mojo
- Passing Mojo Data to Python
- Reading Python Objects Back
- Interop Performance Gotchas