Packaging Python script for iOS
In this recipe, we will be learning to package a Python script for iOS. iOS is a mobile operating system developed by Apple Inc for its devices, including the iPhone, iPad, and iPod Touch. To write, test and run this application, we will be requiring a Macintosh computer.
First of all, we will be creating a Kivy Python script that comprises a button and a label. When a button is clicked, the application simply displays the message Welcome to Python on Smartphones
. This Kivy Python script is made in a folder. So, create a folder named helloworld
and write the following code in a file named main.py
:
from kivy.app import Appfrom kivy.uix.button import Button from kivy.uix.label import Label from kivy.uix.boxlayout import BoxLayout class WelcomeApp(App): def build(self): layout = BoxLayout(orientation='horizontal') pushButton = Button(text='Click Me') pushButton.bind(on_press=self.showMessage) self.labelMessage = Label...