This template should help get you started developing with Tauri and Python Plugin and Vanilla Javascript
- install rust, python and nodeJs
- run
npm installin the tauri-plugin-python base path (cd ../../) - run
npm run buildin the tauri-plugin-python base path - run
npm installin the example path (cd examples/plain-javascript) - run
npm run tauri devto start the application
To run this sample app on iOS:
- run
npx @tauri-apps/cli plugin ios initto init ios project files - run
npm run tauri ios devto start the application on iOS in develop mode
- add
tauri-plugin-pythonto Cargo.toml - add
tauri-plugin-python-apito package.json - modify
permissions:[]in src-tauri/capabilities/default.json and add "python:default" - modify
src-tauri/src-python/main.pyand add python code, for exampledef greet_python(.. - add
.plugin(tauri_plugin_python::init(["greet_python"]))tosrc-tauri/src/lib.rs - include javascript for python plugin in the index.html file for example by adding
<script type="module" src="/tauri-plugin-python-api/index.iife.js" defer></script> - register python functions in javascript by calling
registerJs("greet_python"); - calling python function by calling
call.greet_python(...)
