简体   繁体   中英

Create an EXE file from several .py and .svg files

hello i have a question about creating exe files.

I have a python file named main.py. Furthermore, this main.py needs another file functions.py and two files with the names svg1.svg and scg2.svg.

Now I want to convert this program to an.exe. so far I've only changed individual.py files. Unfortunately I did not find anything on the internet about how to create an.exe from several.py files and.svg files.

Can anyone tell me what tool to do this with?

Edit:I took this command to include my two svg files. Python_KuKa is my folder in which all files are located.

pyinstaller --onefile main.py \ --add-data Python_KuKa/_SVG_KuKa_P.svg;funktionen.py\ --add-data Python_KuKa/_SVG_Kurbelschema_Leer_Rotate.svg;funktionen.py

However, when I do this, the error occurs:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\'

So what is my mistake?

You can use pyinstaller python library to convert python file to exe file. and you can also convert directory of related files to.exe using PyInstaller.

You can read more from here: https://pypi.org/project/PyInstaller/

There is also an alternative way using buildozer:

https://buildozer.readthedocs.io/en/latest/

you can also see this Build Multiple.py files into a single executable file using pyinstaller

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM