Bundle Python App For Mac
Recently I needed to submit a Python app to the Mac App Store. Since there seemed to be no good documentation online for doing this, I had to figure it out myself. Here’s what I learned:
Building a Python app for the Mac App Store
Jun 03, 2020 At StackSocial this week you can get the Limited Edition Mac Bundle featuring Parallels Desktop for a low price of $54 with the promo code RUMORS10. This new bundle features 11 total apps for. Get the most out of your fonts. Most of your fonts contain thousands of characters, many more than you can access from the keyboard. If you want to get the most out of your fonts, then PopChar is the right tool for you. PopChar makes 'typing' of unusual characters easy without having to remember keyboard combinations. PopChar: works with all modern applications that support Unicode.
- Nov 28, 2015 In this tutorial we’ll be using py2app to create a standalone OSX application from a Python 2 or 3 source code with a simple 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: Documentation Source.
- Feb 14, 2020 PyInstaller Quickstart — PyInstaller bundles Python applications. Help keeping PyInstaller alive: Maintaining PyInstaller is a huge amount of work. PyInstaller development can only continue if users and companies provide sustainable funding. See Funding PyInstaller for how to support PyInstaller. PyInstaller freezes (packages) Python applications into stand-alone executables, under Windows, GNU/Linux, Mac OS X, FreeBSD, Solaris and AIX.
Below I will explain how to make a Python script into a Mac App Store app. I would recommend that you download my example Python app that can be submitted to the Mac App Store and examine its build system while reading the rest of this article.
Get a Python script
First, I assume you already have a Python script that you’d like to package as an application and submit.
My example app uses src/HelloAppStore.py
as the main script.
Make it into a regular app
A Python script, along with its included Python modules and dependencies, can be bundled into a regular Mac app using py2app.
I won’t repeat the py2app documentation, but you generally need to create a setup.py
file that looks something like this:
Then you can build dist/HelloAppStore.app
into a nice double-clickable app by running the command:
My example app runs the above command as part of the ./build-app.sh
script.
Alter the app to conform to Mac App Store constraints
There are several additional nontrivial restrictions that must be satisfied before an app can be submitted to the Mac App Store:
- It must be able to run in sandboxed mode.
- It must be code-signed.
- It must not depend on any deprecated APIs (like QuickTime), even from included libraries.
- It must not include any PowerPC code, even from included libraries.
- It must have a large app icon (with sizes up to 1024x1024).
- It must have a specified app store category.
- It must not have any content that Apple finds offensive in its sole discretion.
An exhaustive list of restrictions can be found in the Mac App Store Review Guidelines.
Sandboxing
Mac App Store apps must be sandboxed. Sandboxed apps are restricted in several ways, but the most significant restriction is the inability to read/write arbitrary files.
In particular an app cannot write to a file outside of its sandbox container unless a native1 open/save dialog is used to prompt for the location of the file or the file already resides within the app’s container directory.
Hello, we are delighted to current you most recent Sofware.Doodle Jump Hack Cheats has been intended for you, to aid your everyday living and that you can derive a lot more satisfaction from the game, and at the similar time do not squander your funds.This will allow you conveniently get Coins / Diamonds.Software in advance of the realease was examined by extra than 200 beta testers from. Lima Sky 4.5 44,847 votes. Travel with the cartoon character as high as possible! This jumping upwards game will test your reaction speed and hopping skills. You will be challenged to leap from platform to platform while collecting power-ups. Use a jetpack to blast upwards at the speed of light!
It’s a good idea to read the App Sandboxing documentation to understand the full set of restrictions and how to overcome them when necessary (and when possible).
My example app enables sandboxing by specifying that com.apple.security.app-sandbox = true
in the src/app.entitlements
file. This entitlements file is used in the code-signing process described in the next section.
Code-signing
Mac App Store apps must be code-signed. This means you must go through some extra hoops to generate signing certificates, download them to your dev machine, and alter your build script to sign the final app package with it.
These certificates have to be generated by Apple as part of your Mac Developer Program subscription ($99/year). And renewed annually if you wish to continue making app updates.
Jan 05, 2017 WiFi using WifiSlax 4.11 in Mac OS X and Windows Hack Wifi In Mac PC – Wi-Fi Hack permits you to break any remote system with WEP security. Controlled via AirCrack-NG, the well known, cross-stage, foreign security splitting charge line device, Wi-Fi Crack that makes you stride by-venture through the procedure of breaking the security of a WEP. Hack WiFi using WifiSlax 4.11 in Mac OS X and Windows. By using an Bootable USB, we can boot WifiSlax on both Mac or Windows PC. At for Mac, after press the Power button, just keep holding the Option key to go to the Boot menu. In this instruction, we did on a Windows Laptop. Mac os wifi driver.
Since Python apps are built outside of Xcode, you’ll have to use the codesign
tool manually to sign your app.
My example app runs the codesign
tool as part of the ./build-app.sh
script, recursively signing the inner frameworks, helper tools, and finally the outer application binaries. As part of the signing process the application binaries are also embedded with entitlements, which are used to enable sandboxing.
See the Code Signing Guide for more information about manual code-signing.
Deprecated APIs
Your Python script probably won’t be directly using any deprecated APIs. However your Python script might depend on other libraries that do. Such dependencies can be difficult or impossible to eliminate. Typically you have to modify and recompile the dependency manually.
In particular the very popular wxPython GUI toolkit depends on deprecated QuickTime APIs at the time of writing, making any Python app that depends on it inadmissible to be submitted to the Mac App Store.
My example app has no workarounds for deprecated APIs.
PowerPC Code
Your Python script probably won’t be directly using any old PowerPC code. However, again, your Python script might depend on other libraries that do. In fact Python 2.7 itself includes PowerPC code.
Luckily any PowerPC code can be stripped out easily using the lipo
tool, so you just need to add some extra lipo
commands to your build script.
My example app uses lipo
in the ./build-app.sh
script to remove PowerPC code from the python2.7
library.
Large App Icon
If you don’t have an app icon you’ll have to create one. If you do already have an app icon, I’ll bet you it doesn’t meet the minimum 1024x1024 pixel size requirement.
Creating an icon entails creating several images for your icon at various specific sizes, and then using the iconutil
command to generate a final .icns
icon file.
My example app contains a ./build-icon.sh
script that can be used to generate src/Icon.icns
from images in the src/Icon.iconset
directory.
See the Icon Design Guidelines in the OS X Human Interface Guidelines for more information about creating icons.
App Store Category
The Info.plist
file inside a Mac App Store app is required to specify what category on the Mac App Store it belongs to under the LSApplicationCategoryType
key.
So far as I can tell, the set of valid values for this key is not documented anywhere. Therefore to find new values, I created a new Cocoa Application project in Xcode (where I could specify the app category in a dropdown), compiled the app, and opened its Info.plist
file to see what value it had for the LSApplicationCategoryType
key.
Submitting your app to the store
Regular apps written in Objective-C for the Mac App Store are usually submitted directly from within Xcode. This is not an option for Python apps that you build outside of Xcode.
Instead you have to use an older app submission tool called Application Loader to upload your app. However Application Loader doesn’t submit a .app
package directly; it requires an installer .pkg
instead.
An installer package can be built from your .app
using the productbuild
tool.
My example app runs the productbuild
tool as part of the ./build-pkg.sh
script which creates an installer package containing the app.
For more information about the productbuild
tool, see its man page.
Fin
Hopefully you should now have a good idea of what is involved in submitting a Python app to the Mac App Store.
If you’d like to actually try out the process of submitting an app, try building and submitting my example app using the instructions in its README.
Please send comments and corrections to David Foster.
Therefore if you are using a GUI toolkit that uses a simulated open/save dialog rather than a native one, your app won’t be able to access the files the user selects!↩
Download version 3.2.7 for | |
Windows • Mac • | |
NB! Windows installer is signed with new identity and you may receive a warning dialog from Defender until it gains more reputation. Just click 'More info' and 'Run anyway'. |
Python Book Bundle
Features
Easy to get started. Thonny comes with Python 3.7 built in, so just one simple installer is needed and you're ready to learn programming. (You can also use a separate Python installation, if necessary.) The initial user interface is stripped of all features that may distract beginners. |
No-hassle variables. Once you're done with hello-worlds, select View → Variables and see how your programs and shell commands affect Python variables. |
Simple debugger. Just press Ctrl+F5 instead of F5 and you can run your programs step-by-step, no breakpoints needed. Press F6 for a big step and F7 for a small step. Steps follow program structure, not just code lines. |
Step through expression evaluation. If you use small steps, then you can even see how Python evaluates your expressions. You can think of this light-blue box as a piece of paper where Python replaces subexpressions with their values, piece-by-piece. |
Faithful representation of function calls. Stepping into a function call opens a new window with separate local variables table and code pointer. Good understanding of how function calls work is especially important for understanding recursion. |
Highlights syntax errors. Unclosed quotes and parentheses are the most common beginners' syntax errors. Thonny's editor makes these easy to spot. |
Explains scopes. Highlighting variable occurrences reminds you that the same name doesn't always mean the same variable and helps spotting typos. Local variables are visually distinguished from globals. |
Mode for explaining references. Variables are initially presented according to simplified model (name → value) but you can switch to more realistic model (name → address/id → value). |
Code completion. Students can explore APIs with the help of code completion. |
Beginner friendly system shell. Select Tools → Open system shell to install extra packages or learn handling Python on command line. PATH and conflicts with other Python interpreters are taken care of by Thonny. |
Simple and clean pip GUI. Select Tools → Manage packages for even easier installation of 3rd party packages. |
Demo
Credits
Main development of Thonny took place in Institute of Computer Science of University of Tartu, Estonia.
Development of several features in Thonny 3.0 was proposed and supported by Raspberry Pi Foundation.
Since September 2018 development of Thonny is partially supported by Cybernetica AS.
We are also grateful for the help of several contributors from the open-source community around the world.
Instructions & downloads
- Installation instructions
Free App For Mac
Latest stable releases are linked in the download box at the top of this page. Older releases and prereleases can be found at https://github.com/thonny/thonny/releases
Plug-ins
Thonny has simple infrastructure for extensions. Please contact us for details!
These are some known Thonny plug-ins: