Run python in Tauri

352 views Asked by At

How am I able to execute a python function including parameters with tauri? I have seen other posts stating to use sidecars, although I'm not sure how to work with those aswell.

1

There are 1 answers

0
Ethan Steere On
  1. You include the python binary and python files with your app. Then you will declare a tauri handler in the src-tauri directory that uses std::process::Command to start the python binary with your desired python file and capture the result through standard output.

  2. You can use a crate like py03 to link python to your tauri binary and communicate with python through the rust foreign function interface.

I would recommend using rust directly for any functionality to avoid these complexities.