4

I've made a python program using Tkinter(GUI) and I would like to enter it by creating a dedicated icon on my desktop. (I want to send the file to my friend, without him having to install python or any interpreter)

the file is a some-what game that I want to share with friends and family, which are not familiar with coding.

Hadar
  • 658
  • 4
  • 17

2 Answers2

2

You can simply use Pyinstaller to create a standalone .exe.

Run this from the Windows cmd to create a standalone executable file: pyinstaller.exe --onefile --noconsole --icon=your_image_here.ico app.py

ErikDM
  • 78
  • 4
1

you can install Pyinstaller by using pip

pip install pyinstaller

go to the directory where your file is saved and type:

pyinstaller.exe --onefile --windowed path/to/your/file.py

--onefile (compresses your files into one .exe file) --windowed (removes the console when you run your file) path/to/your/file.py (or simply file.py when you want to convert the file in the same directory)

if you have any error using it, remove the --windowed flag and run file.exe on command line to see the error

Virtual Dreamer
  • 43
  • 1
  • 12