How to convert a py application to .exe ?

+2 Benjamin Coal · March 28, 2015
How do I convert a py application made with Tkinter (with modules) to an .exe?

I was looking at I am new to python, I have only watched Buckys python tuts (in the last two days) and nowhere is exe conversion mentioned. 


Post a Reply


Oldest  Newest  Rating
+1 alex constantin · March 28, 2015
Look at this post on the forum:
0 Nicholas Pryor · March 28, 2015
You don't.

What I mean is, a .exe file is just simply an executable file(Machine code) To get your file to be executable you need to install a compiler for Python. I just got into Python, but I am pretty sure its Interpreted not compiled.
0 Timothy Walter · March 28, 2015
I haven't used this for awhile, but I think the link below is what you are looking for. Py2exe will create your exe and include all of the required python files so that the end user will not require Python to be installed.

Best of luck, let us know if you have questions on it.

0 Benjamin Coal · March 28, 2015
of course you can? maybe not will Tkinter directly otherwise what's the point? 
0 Chris Weaver · March 30, 2015
Go to

once you download the .zip file
extract the contents & enter the command:
python py2exe [in linux, use sudo before 'python' && with windows, 'run as admin' on cmd.exe ]

then you go to the directory/folder you keep you r scripts in &&  create a file called

open a text editor && type :

from distutils.core import setup
import py2exe

setup(console=[''])  [this is whatever program you have written]
now save

make sure * works before you even try to make it an .exe file.
make the file executable in the properties tab, run the command :

python py2exe
and you will have your file.exe

also for Unix users if you would like to use this module, you need to install the C Header file
'windows.h' else you get the STDIOError #include<windows.h>

also, python is an Interpreted language not a Compiled one!
core python/lots libs & modules is written from C so it is very easy to make
it Compileable!! importing ctypes is solely for win32 and me being a linux user
at times create programs that unexpectedly wind up being C'like', I will
save the file && it will be && file.pyc.
also python is a Glue Language mening you can use almost any other type
of llanguage in python and it sticks
html, css, javascript, jquery etc ...
CPython, Jython[JavaPython] it goes on & on!!! sudy up rookies
  • 1



This section is all about snakes! Just kidding.

Bucky Roberts Administrator