Published on: 01.09.2017
I wanted to create single file that person could run on Windows machine, from my Pythone code.
After some investigation I found PyInstaller and 1 hour later I had my EXE file from Python code.
Process for generating EXE files from Python code with PyInstaller was quite easy, at least from my experience.
I have used it on Windows 7 64-bit and had no problems.
Steps for generating exe file with PyInstaller
This will install PyInstaller
pip install pyinstaller
This will generate script.exe in dist directory
pyinstaller --onefile script.py
After this you have your EXE program.
How PyInstaller is working
Here I have used
--onefile option for PyInstaller what will make one file EXE program.
If you just use pyinstaller script.py, with out
--onefile option, than in dist folder you will get folder script with EXE file and all additional files for your EXE file to work.
If you use
--onefile option, then your one file EXE program need every time to uncompresses all files every time when it starts.
Comparison of some others solutions.