Skip to content

Instantly share code, notes, and snippets.

@freakboy3742
Created April 17, 2017 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freakboy3742/24be30a7f55c00c77b722ca30100d91e to your computer and use it in GitHub Desktop.
Save freakboy3742/24be30a7f55c00c77b722ca30100d91e to your computer and use it in GitHub Desktop.
Tutorial

Cross-platform Native GUI development with BeeWare

Description

Both your title and this description are made public and displayed in the conference program to help attendees decide whether they are interested in this presentation. Limit this description to a few concise paragraphs.

Have you ever wanted to write a GUI application you can run on your laptop? What about an app that you can run on your phone? Historically, these have been difficult to achieve with Python, and impossible to achieve without learning a different API for each platform. But no more.

BeeWare is a collection of tools and libraries that allows you to build cross-platform native GUI applications in pure Python, targeting desktop, mobile and web platforms. In this tutorial, you'll be introduced to the BeeWare suite of tools and libraries, and use those tools to develop, from scratch, a simple GUI application. You'll then deploy that application as a standalone desktop application, a mobile phone application, and a single page webapp - without making any changes to the application's codebase.

Audience

1–2 paragraphs that should answer three questions:

  1. Who is this tutorial for?
  2. What background knowledge or experience do you expect students to have?
  3. What do you expect students to learn, or to be able to do after attending your tutorial?

This tutorial is for Python developers who wish to learn how to build native user interfaces for their Python code. This tutorial is not suitable for complete Python novices; a basic ability to diagnose simple and common problems in Python is required.

A basic familiarity with pip, distutils, and the Python developer toolchain on the student's platform of choice is required. However, no specialist knowledge about GUI programming or mobile APIs is required.

In this tutorial, students will build, in pure Python, a simple cross-platform application, and deploy that application to a desktop platform (macOS, Linux/GTK+ or Windows), a mobile phone (iOS or Android), and as a single-page website. Upon completion of the tutorial, students will be able to write their own cross-platform applications using the BeeWare suite. With the knowledge obtained through this tutorial, advanced students should be able to develop additional widgets or capabilities of their own.

Outline

Make an outline that lists the topics and activities you will guide your students through over the 3 hours of your tutorial. Provide timings for each activity — indicate when and for how long you will lecture, and when and for how long students will be tackling hands-on exercises. This is a very important criteria! Generally speaking, the more detailed the outline, the more confidence the committee will have that you can deliver the material in the allotted time.

  • Introduction and welcome (5 minutes)
* Overview of the BeeWare project (30 minutes)
  • How Python runs on different platforms - 5 minutes
- Bridges
  • Rubicon (macOS/iOS) - 5 minutes
  • VOC (Android) - 5 minutes
  • Batavia (Web) - 5 minutes
- Toga, a cross platform widget toolkit
  • Describing the cross-platform philosophy adopted by Toga: 5 minutes
  • Briefcase, a cross platform packaging tool
  • Brief usage instructions: 5 minutes
* A first working example (20 minutes)
  • Develop a "hello world" application for a desktop platform This is approximately 20 lines of code.
  • Code walkthrough and explanation: 10 minutes
  • Hands on: 10 minutes
* A more interesting example (30 minutes)
  • Develop an "Imperial to metric" converter for a desktop platform This is approximately 60 lines of code.
  • Code walkthrough and explanation: 10 minutes
  • Hands on: 20 minutes
* Packaging as an app (20 minutes)
  • Take the "Imperial to metric" converter for desktop, and package it as a standalone desktop app.
  • Explanation: 10 minutes
  • Hands on: 10 minutes
* Taking it mobile (20 minutes)
  • Take the "Imperial to metric" converter and deploy it to a mobile phone.
  • Explanation: 10 minutes
  • Hands on: 10 minutes
* Taking it to the web (20 minutes)
  • Take the "Imperial to metric" converter app and deploy it as a website. This will have the site running as a local Django development server; deploying to a public site is left as an exercise for later.
  • Code walkthrough and explanation: 10 minutes
  • Hands on: 10 minutes
* Digging into the internals (30 minutes)
- How to access native platform features:
  • Rubicon: 10 minutes
  • VOC: 10 minutes
  • Batavia: 10 minutes
* Writing your own cross-platform widget (Time permitting)
  • A look at the internals of a simple widget: 10 minutes
  • Writing a custom widget: 20 minutes
* Wrap up (5 minutes)
  • Where to from here?
  • How to help the project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment