0

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?

1 Answers1

0

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

DarkRace
  • 31
  • 5
  • thanks for your answer and help. But how exactly can I convert the two svg files and the two pythin files into one exe? I found the command --onefile but when I run it the exe keeps crashing and presumably did not include the svg files – Mephisto_08 Apr 09 '20 at 06:11
  • add path of files in your script read this : https://www.reddit.com/r/learnpython/comments/4kjie3/how_to_include_gui_images_with_pyinstaller/ – DarkRace Apr 09 '20 at 12:53