While the setup file required by cx_freeze presents an additional step in the process, it also enables great flexibility.
#PROGRAMS TO RUN EXE ON MAC .EXE#
exe file will be available in a directory within the folder that contains setup.py.
For this example, however, it’s fairly simple: setup.pyĮxecutables = ) The setup.py file configures the options for cx_freeze, and can get complicated if you’re trying to do something very particular.
Before running cx_freeze, you’ll need to create a file called “setup.py” that is stored in the same folder as the pascals_triangle.py program. This process is almost as simple with cx_freeze, but requires an extra configuration step. This creates a folder called “dist” in the folder that contains your Python code, and within that folder you’ll find your.
#PROGRAMS TO RUN EXE ON MAC HOW TO#
How to Install Python Packages with the ActiveState Platform If you already have Python installed, you can skip this step. Both of these tools are versatile and easy to use, but depending on your use case, you may prefer one over the other.
Here we’ll consider two of the most popular options: cx_freeze and PyInstaller. They will “freeze” your code and build an executable file for you. How can you distribute your Python code to users who expect to simply click on an executable file?įortunately, there are many Python utilities that help convert files from. Your friend balks, “Command line? Oh no, that’s not for me.” Or, maybe you’re an Admin that has to get everyone in the organization (yep, even the non-technical ones) to run your Python script. Only first, he’ll have to install Python, and then run the program from the command line or IDLE shell. You send a friend a directory with all your scripts and tell him to give it a shot. Picture this scenario: you’ve just created a fantastic Python program and want to share it with the world. exe is a task more common than you’d imagine.