Does your Python program need a graphical user interface? Here are five tools to help you build.
In this tutorial we’ll be using py2app to create a standalone OSX application from a Python 2 or 3 source code with asimple Tkinter user interface.
'py2app is a Python setuptools command which will allow you to make standalone application bundles and plugins from Python scripts. py2app is similar in purpose and design to py2exe for Windows.'
Relevant links about py2app:
This guide is loosely based on the official tutorial.Based on a Python file called
Sandwich.py , we’ll create an application called Sandwich.app .
Prerequisites
Create a custom directory and create a virtualenv:
Now create a very simple Tkinter app with the filename
Sandwich.py :
Allowing apps from unidentified developers mac. This little app will look like this:
Install py2app
The original version of py2app has a bug due to a newer version of ModuleGraph. Imade a fork of the project and fixed this bug on Github.Install it with pip like this:
Create a
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |