does pyside deploy encrypt source code?
-
I'm using qml and pyside6 in my project and was trying to protect my source code from user access, does pyside6-deploy encrypt source code?
also when I try to use created exe standalone in any directory other than project folder it crashes with error:
QQmlApplicationEngine failed to load component
file:///C:/Users/**/OneDrive/Desktop/qml/app.qml: No such file or directory
Traceback (most recent call last):
File "C:\Users**\AppData\Local\Temp\ONEFIL~1\main.py", line 2747, in <module>
IndexError: list index out of range
QThread: Destroyed while thread is still runninghow can I add qml and image files into exe file so it doesn't need those files be put alongside exe?
-
Hi,
For encryption, AFAIK, no.
For your file loading issue, use Qt resource system. -
pyside6-deploy
doesn't encrypt your source code—it packages it into the executable. To protect the code, you might want to obfuscate it using tools likepyarmor
or[cython](https://syntaxscenarios.com/python/scientific-notation/)
.For the QML and image files issue, you can include them in the executable by modifying your
.spec
file if you're usingPyInstaller
. Add:datas = [ ('qml', 'qml'), ('images', 'images') ]
Then in the
Analysis
section:a = Analysis( ['main.py'], datas=datas, ... )
This ensures the QML and images are bundled inside the executable. Let me know if you need further clarification!