You are on page 1of 7

Kivy

Librarie Python
Open source
Cross-platform: Linux, Windows, OS X, Android, iOS
Puncte slabe: fiesiere mari, timpul de executie, echipa mica de devs.

Versiunea curenta 1.8.0: http://kivy.org/#download

Exemplu de aplicatie

from kivy.app import App


from kivy.uix.button import Button
class TestApp(App):
def build(self):
return Button(text='Hello World')
TestApp().run()

Aplicatie Paint #1
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.graphics import Color, Ellipse
class MyPaintWidget(Widget):
def on_touch_down(self, touch):
with self.canvas:
Color(1, 1, 0)
d = 30.
Ellipse(pos=(touch.x - d / 2, touch.y - d / 2), size=(d, d))
class MyPaintApp(App):
def build(self):
return MyPaintWidget()
MyPaintApp().run()

Aplicatie Paint #2
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.graphics import Color, Ellipse, Line
class MyPaintWidget(Widget):
def on_touch_down(self, touch):
with self.canvas:
Color(1, 1, 0)
d = 30.
Ellipse(pos=(touch.x - d / 2, touch.y - d / 2), size=(d, d))
touch.ud['line'] = Line(points=(touch.x, touch.y))
def on_touch_move(self, touch):
touch.ud['line'].points += [touch.x, touch.y]
class MyPaintApp(App):
def build(self):
return MyPaintWidget()
MyPaintApp().run()

Aplicatie Paint #3
from random import random
*
*
*
def on_touch_down(self, touch):
color = (random(), random(), random())
with self.canvas:
Color(*color)
d = 30.
Ellipse(pos=(touch.x - d / 2, touch.y - d / 2), size=(d, d))
touch.ud['line'] = Line(points=(touch.x, touch.y))
*
*
*

Aplicatii pe Android/iOS

2048

Sudoku

Reversi

Weather

Sfarsit!

Multumesc pentru atentie!

Musat Alin-Gabriel
Cls a XII-a A, CNNB Braila

You might also like