Skip to Content
Kivy Cookbook
book

Kivy Cookbook

by Hugo Solis
August 2015
Intermediate to advanced
246 pages
4h 21m
English
Packt Publishing
Content preview from Kivy Cookbook

Advanced text manipulation

Text is one of the most commonly used contents used in the apps. The recipe will create an app with a label widget where we will use text rendering to make our Hello World.

How to do it…

We are going to use one simple Python files that will just show our Hello World text. To complete the recipe:

  1. Import the usual kivy packages.
  2. Also, import the label package.
  3. Define the e9app class instanced as app.
  4. Define the method build() to the class.
  5. Return the label widget with our Hello World text.
    import kivy kivy.require('1.9.0') # Code tested in this version! from kivy.app import App from kivy.uix.label import Label class e9App(App): def build(self): return Label(text='Hello [ref=world][color=0000ff]World[/color][/ref]', markup=True, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Creating Apps in Kivy

Creating Apps in Kivy

Dusty Phillips
Kivy Blueprints

Kivy Blueprints

Mark Vasilkov

Publisher Resources

ISBN: 9781783987382Supplemental Content