You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/plain-javascript/README.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,22 @@
3
3
This template should help get you started developing with Tauri and Python Plugin
4
4
and Vanilla Javascript
5
5
6
-
## Modifications on default template to add plugin:
6
+
## Quick Start
7
+
- install rust, python and nodeJs
8
+
- run `npm install` in the tauri-plugin-python base path (`cd ../../`)
9
+
- run `npm run build` in the tauri-plugin-python base path
10
+
- run `npm install` in the example path (`cd examples/plain-javascript`)
11
+
- run `npm run tauri dev` to start the application
12
+
13
+
## Manual modifications on default template to add plugin:
7
14
- add `tauri-plugin-python` to Cargo.toml
8
15
- add `tauri-plugin-python-api` to package.json
9
16
- modify `permissions:[]` in src-tauri/capabilities/default.json and add "python:default"
10
17
- modify `src-tauri/src-python/main.py` and add python code, for example `def greet_python(..`
11
18
- add `.plugin(tauri_plugin_python::init())` to `src-tauri/src/lib.rs`
12
-
- include javascript for python plugin for example by adding `<script type="module" src="/tauri-plugin-python-api/index.iife.js" defer></script>`
19
+
- 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>`
13
20
- register python functions in javascript by calling `registerFunction("greet_python");`
14
-
- calling python function by calling `py.greet_python(...)`
21
+
- calling python function by calling `call.greet_python(...)`
0 commit comments