Loading AI tools
多点触控应用软件 来自维基百科,自由的百科全书
Kivy是開源Python函式庫,用於開發行動應用程式和其它採用自然用户界面的多點觸控應用軟件。它可以在Android,iOS,Linux,OS X和Windows執行。採用MIT授權條款,Kivy是自由並且開源的軟件。
Kivy的主要架構由Kivy組織開發,[3] 並有Python用於Android,[4]Kivy iOS,[5]和其它許多函式庫被使用在所有平台。在2012年,Kivy從Python軟體基金會獲得$5000美元補助,用於移植Kivy到Python 3.3。[6]Kivy也支援由Bountysource贊助的樹莓派。[7]
其架構包括所有建造應用程式的元素,例如:
Kivy改良了PyMT專案,並且推薦給新的專案採用。[9]
以下是一個按鈕的Hello World程式範例:
from kivy.app import App
from kivy.uix.button import Button
class TestApp(App):
def build(self):
return Button(text='Hello World')
TestApp().run()
Kivy語言(Kv)是致力於描述使用者介面和與使用者互動的一種語言。就像QML,它能夠簡單的建造整個使用者介面並加上互動。例如,建造一個包括檔案瀏覽器,和取消/載入按鈕的對話框,它能夠採用Python快速的造出基本的控制項,之後用Kv造出使用者介面。
在main.py:
class LoadDialog(FloatLayout):
def load(self, filename): pass
def cancel(self): pass
並且在相關的Kv:
#:kivy 1.4.0
<LoadDialog>:
BoxLayout:
size: root.size
pos: root.pos
orientation: "vertical"
FileChooserListView:
id: filechooser
BoxLayout:
size_hint_y: None
height: 30
Button:
text: "Cancel"
on_release: root.cancel()
Button:
text: "Load"
on_release: root.load(filechooser.path, filechooser.selection)
Seamless Wikipedia browsing. On steroids.
Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.
Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.