I have made a program which uses pygame, tkinter, pyttsx3 and more. I want to convert this program to and executable .exe file to share with my friends. How can I do that without any issues?
Asked
Active
Viewed 247 times
-1
-
4Does this answer your question? [How can I convert a .py to .exe for Python?](https://stackoverflow.com/questions/41570359/how-can-i-convert-a-py-to-exe-for-python) – xszym Sep 07 '20 at 12:59
-
Does this answer your question? [Converting tkinter to exe](https://stackoverflow.com/questions/48299396/converting-tkinter-to-exe) – drops Sep 07 '20 at 12:59
2 Answers
0
To convert your pythone code into an executable file I suggest to use the tool pyinstaller. in your command prompt:
> pip install pyinstaller
Then in cmd open the current folder where you have the code stored. For example
> D:
> cd folder
Then you just run the command (with the name of your file where you have the code):
> pyinstaller --onefile code.py
You will find your executable in a separate folder called dist
I hope it helps you, it should work. It is how I transformed my codes into executable.

Doru Bolboceanu
- 154
- 1
- 7
-
No! After doing this just some python screen opens and nothing happen. – Sunny Tripathi Sep 07 '20 at 14:49
-
Do you have all your code in one file ? Or you use multiple files with different code for this application – Doru Bolboceanu Sep 07 '20 at 15:40
-
All the codes are in one file. When i open the exe only a black screen open but the pygame window doesn't show up. – Sunny Tripathi Sep 08 '20 at 07:04
0
An alternative is py2exe.
pip install py2exe
Or on Linux:
pip3 install py2exe
Here's the link to the tutorial on the py2exe website. https://www.py2exe.org/index.cgi/Tutorial

Lykas
- 52
- 8