mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
12 lines
300 B
JavaScript
12 lines
300 B
JavaScript
import * as py from 'rustpython_wasm';
|
|
import pyCode from 'raw-loader!./main.py';
|
|
|
|
fetch('https://github-trending-api.now.sh/repositories')
|
|
.then(r => r.json())
|
|
.then(repos => {
|
|
const result = py.pyEval(pyCode, {
|
|
vars: { repos }
|
|
});
|
|
alert(result);
|
|
});
|