# How to Make Executables

#Basic#Pyinstaller

We can use Pyinstaller (opens new window) to package Python scripts into standalone executables. And it works across different platforms.

More

It's worth noting that Pyinstaller can compile to a single executable file, when --onefile option is chosen. Also on which OS it is run, it makes matching executable, i.e. .exe when run on Windows

# Getting started

First, we need to install Pyinstaller from PyPI

pip install pyinstaller
1

Then, go to the script folder and run

pyinstaller script.py
1

The bundle will be generated in a folder called dist.

As mentioned above, if we prefer single executable file, include the --onefile option.

pyinstaller script.py --onefile
1

# Assignment 21

Use Pyinstaller to make your solution to Assignment 20 an executable.