admin管理员组文章数量:1573095
kivy是一个免费、开源、跨平台的Python应用程序开发框架,编写好的程序可以直接打包为手机apk(安装包),下面我简要介绍实现的过程:
1、首先安装kivy模块,这个可以直接参考官方文档,输入对应安装命令就行,如下:
a. ensure you have the latest pip and wheel:
python -m pip install --upgrade pip wheel setuptools
b. Install the dependencies(skip gstreamer(~120MB) if not needed, see kivy’s dependencies)
python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
python -m pip install kivy.deps.gstreamer
For the python3.5+, you can also use the angle backend instead of glew. This can be installed with:
python -m pip install kivy.deps.angle
c. Install kivy
python -m pip install kivy
d. (optional) Install kivy examples
python -m pip install kivy_examples
2、安装完成之后,可以测试一下是否安装成功代码如下,基本窗口,正中间放置一个button按钮
from kivy.app import App
from kivy.uix.button import Button
class testApp(App):
def build(self):
return Button(text='hello kivy')
testApp().run()
运行结果如下:
版权声明:本文标题:Python编写手机App————kivy 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1727732715a1127192.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论