Converting python code to Executable format (.exe)

There are many tools or libraries that can help us to create executable files for python code. I found that there are some packages for converting python code to .exe file python 2.7 or 3.4, but not 3.6. Please, check the following links to find the packages: 


I have worked with PyInstaller and it works nicely. However, PyInstaller works for python 2.7. So, you need to check at first your current python version. Use the following command:

which python2.7
which pip2
pip2 install pyinstaller              # use pip2 to install in python2.7 package.
pyinstaller your_code.py         # run pyinstaller to convert your python file.


If you want an executable file for windows, you need to run PyInstaller in windows. If you run PyInstaller in Linux, it will create an executable file for Linux.

Finally, I used auto-py-to-exe software on my windows laptop. I installed and keep the auto-py-to-exe.exe file in my "C:\ProgramData\Anaconda3\Scripts" folder where I have a conda.exe file.

After running the software, you can set some parameters (a single executable file or a folder) and create .exe file for python code.

There are some sample codes and discussion: 
https://pypi.org/project/auto-py-to-exe/

মন্তব্যসমূহ