Run generated .py files without python installation

Andrew Whiteman :

I am coding a PyQt5 based GUI application needs to be able to create and run arbitrary Python scripts at runtime. If I convert this application to a .exe, the main GUI Window will run properly. However, I do not know how I can run the short .py scripts that my application creates. Is it possible to runs these without a system wide Python installation?

I don't want ways to compile my python application to exe. This problem relates to generated .py scripts

Vlad :

No, it won't work. But you can make a small tool that will load the scripts and eval them within the context of packed executable. Look here for more details. One thing to be mindful of is that your eval executable should import all the dependencies needed by your generated .py files

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=297318&siteId=1
Recommended