[PYTHON] kivy introduction

This is a kivy article that I will do my best because I can't find too much information. I don't use the Advent Calendar because I work as a member of society. It is an irregular update.

The working OS looks like this.

Mac OS 10.12.3 (February 15, 2017)

Preparation for installation

Install by referring to the original site. As a preliminary preparation, perform the following work.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install the latest version of Python

Install the latest version of Python.

brew install python python3

Bring kivy from the head family

Bring kivy from the original site (kivy.org).

Follow the instructions and tap the following command

brew install sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer
pip install -I Cython==0.23
USE_OSX_FRAMEWORKS=0 pip install kivy

The part that may not be needed because it is a development version

USE_OSX_FRAMEWORKS=0 pip install https://github.com/kivy/kivy/archive/master.zip

I've done it

Test run

I ran kivy as follows.

$ kivy
zsh: command not found: kivy

(# ^ Ω ^) Piki Piki

Save the following with the extension py.

import kivy
kivy.require('1.0.6') # replace with your current kivy version !

from kivy.app import App
from kivy.uix.label import Label


class MyApp(App):

    def build(self):
        return Label(text='Hello world')


if __name__ == '__main__':
    MyApp().run()

Type the following command from Terminal.

python xxx.py

If it works, it's done.

The next theme is "My job is to create a version that I want to run as an exe or app, not from the CUI!" looking forward to! (This tension is the content I wrote with the momentum only this time.)

Recommended Posts

kivy introduction
Introduction
Kivy installation
Introduction to MQTT (Introduction)
Introduction to Scrapy (1)
Introduction to Scrapy (3)
tensorflow-gpu introduction memo
[Introduction] Reinforcement learning
Introduction of Python
Introduction of scikit-optimize
Introduction to Tkinter 1: Introduction
pytorch super introduction
Introduction of PyGMT
Flask development introduction
Introduction to PyQt
Introduction to Scrapy (2)
About Kivy root
[Linux] Introduction to Linux
Introduction to Scrapy (4)
H2O.ai Introduction memo
Introduction to discord.py (2)
real-time-Personal-estimation (system introduction)
Introduction of cymel
Introduction to discord.py
Introduction of Python