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
You either need to have python installed on the target machine or ship the shared python library with your package. You also may link the python library statically - PyO3 may do this by default if it finds a static python library. In addition, you need to copy the python files so that python files are next to the binary. The file `src-python/main.py` is required for the plugin to work correctly. You may also add additional python files or use a venv environment. The included resources can be configurable in the `tauri.conf.json` file. Check the tauri and PyO3 documentation for additional info.
67
+
You either need to have python installed on the target machine or ship the shared
68
+
python library with your package. You also may link the python library statically - PyO3
69
+
may do this by default if it finds a static python library. In addition, you need
70
+
to copy the python files so that python files are next to the binary.
71
+
72
+
The file `src-python/main.py` is required for the plugin to work correctly.
73
+
You may also add additional python files or use a venv environment.
74
+
The included resources can be configurable in the `tauri.conf.json` file.
75
+
76
+
Check the tauri and PyO3 documentation for additional info.
68
77
69
78
## Security considerations
70
79
Generally, this plugin has been created by "security by default" concept. Python functions can only be called if registered from rust.
71
80
72
81
Keep in mind that this plugin can make it possible to run arbitrary python code.
73
-
It is therefore highly recommended to **not make the user interface accessible by a network URL**.
82
+
It is therefore highly recommended to **make sure the user interface is not accessible by a network URL** in production.
74
83
75
84
The "runPython" command is disabled by default via permissions. If enabled, it is possible to
76
-
inject python code via javascript.
85
+
inject python code directly via javascript.
77
86
Also, the function "register" is disabled by default. If enabled, it can
78
87
add control from javascript which functions can be called. This avoids to modify rust code when changing or adding python code.
79
88
Both functions can be enabled during development for rapid prototyping.
80
89
90
+
## Alternatives
91
+
If already know that you just want to develop completely in python, you might want to take a look at [pytauri](https://github.com/WSH032/pytauri).
92
+
It is a different approach to have all tauri functionality completely in python.
93
+
94
+
This approach here with tauri-plugin-python is more lightweight and it is for you, if you
95
+
- still want to write rust code
96
+
- already have a tauri application and just need a specific python library
97
+
- just want to simply support rare custom plugins
98
+
- if you want to embed python code directly in your javascript
0 commit comments