Hadar
Hadar

Reputation: 668

run python program via clickable desktop icon

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.

Upvotes: 4

Views: 9615

Answers (2)

Virtual Dreamer
Virtual Dreamer

Reputation: 43

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

Upvotes: 1

ErikDM
ErikDM

Reputation: 78

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

Upvotes: 2

Related Questions