Earlier we would have seen several other directory of file created during the command execution lets see what are those files and directory first
Spec File
This holds the information of the executable created when script was passed as an argument for PyInstaller. These information by default includes the filepath of the executable, whether cipher is enabled, we can also use editor to open the files for inspecting the parameters.
Build Directory
This directory will be created in the same folder where the script file is located by fault unless the external; directory was passed as an argument. This directory contains some logs file and working files created during the command execution.
Dist Directory
This folder will also be created by default in the same directory of the script file unless it was mentioned externally in the argument to store else where. This folder will holds actual app bungle we have created from for script. This single bundle is what we need to share to the others.
By default the executable name will be same as the name of the script file
Commonly Used Options
1. -h or --help
This will display help message along with each arguments.
2. -v or --version
This will display the current version of the PyInstaller
Example
Here we have a currency converter tkinter application, on which we will use pyinstaller to convert our py file to exe. Here we will be using a set of arguments on pyinstaller which will be explained below.
pyinstaller --hidden-import=pkg_resources.py2_warn -w -F -i "Path to the Icon file" "Path to the script file"
The usually when converting script it exe using Pyinstaller, it will automatically build executable by compressing required resources but on some tkinter application few resources are not including when build, causing executable not to run. To avoid his we additional import pkg_resources.py2_warn.
By passing -w, no console window will appear which is usually used for I/O operations and nature of the application. -F is used to denote the Pyinstaller to create a single executable.