1# ACRN Configurator WASM Python Module
2
3Every file must set `__package__ = 'configurator.pyodide'` before import,
4set this magic var can resolve python relative import error when we direct run it.
5
6## Function define
7
8Every python script need a test function and a main function.
9
10### test
11
12run script will call this function,
13so please set script default params in this function
14
15### main
16
17in js side will use this function.
18like:
19
20```javascript
21// after pyodide install all dependices
22var launch_cfg_gen = pyodide.pyimport("configurator.pyodide.launch_cfg_gen").main;
23var board_xml = this.readFile('xxxx/board.xml');
24var scenario_xml = this.readFile('xxx/scenario.xml');
25var launch_scripts = launch_cfg_gen(board_xml, scenario_xml);
26console.log(launch_scripts)
27```
28