To instruct PyInstaller how to build Luxocator, we must create a specification file, which we will call Luxocator.spec
. Actually, the specification file is a Python script that uses a PyInstaller class called Analysis
and PyInstaller functions called PYZ
, EXE
, and BUNDLE
. The Analysis
class is responsible for analyzing one or more Python scripts (in our case, just Luxocator.py
) and tracing all the dependencies that must be bundled with these scripts in order to make a redistributable application. Sometimes, Analysis
makes mistakes or omissions, so we will modify the list of dependencies after it is initialized. Then, we will zip the scripts, make an executable, and make an app bundle using PYZ
, EXE
, and BUNDLE
, respectively. Here is the implementation:
import os a = Analysis(['Luxocator.py'], pathex=['.'], hiddenimports=[], hookspath=None, runtime_hooks=None) # Determine the platform. platform = os.name if platform == 'nt': # We are on Windows...