-1

Iam developing a python program which included pyqt5 and also mysql.connector for using mysql as back end. I have almost completed the program and it contains about 20 .py files for different qt window. How to convert this to .exe format?

programer
  • 1
  • 4

1 Answers1

0

Have you considered using Pyinstaller?

It's as simple as installing it:

pip install pyinstaller

and then running it against the name of your main python file. E.g., if it's called main.py:

pyinstaller --onefile main.py

TSeymour
  • 729
  • 3
  • 17
  • but i told know there are about 20 .py files. And also mysql – programer Nov 20 '20 at 06:20
  • If you're saying there are 20 different programs (that you would run independently), then my suggestion doesn't work. However, if you're saying there is one file you run (e.g., main.py) that import and uses code in 19 other python files (e.g., using import calls), then Pyinstaller will figure that out and bundle everything up properly. Lastly, if you mean that there are one or more python files and several data files that must be opened and used (e.g., database files, images, etc.) then you can handle this with Pyinstaller, but it's a bit more work (see the Pyinstaller docs). – TSeymour Nov 20 '20 at 22:12