开始kivy

'''
Application example using build() + return
==========================================

An application can be build if you return a widget on build(), or if you set
self.root.
'''

import kivy
kivy.require('1.0.7')

from kivy.app import App
from kivy.uix.button import Button


class TestApp(App):

    def build(self):
        # return a Button() as a root widget
        return Button(text='hello world')

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

给文件取名为main.py

 

如果你设置好系统环境变量的话,在cmd下运行,kivy.bat main.py

 

就会看到结果。

 

 

你可能感兴趣的:(kivy)