Kivy
lastmod 2025-03-24created 2019-10-1614 edits
|
Kivy - Open source Python library for rapid development of applications that make use of innovative user interfaces, such as multi-touch apps.
Categories
- ScreenManager
- KivyMD
- FrostedGlass - A Glassmorphism-style background.
How to install
Linux
MacOSX
$ opy -m pip install kivy
## Gstreamer is not included, so if you would like to use media playback with kivy, you should install ffpyplayer like so
$ python -m pip install ffpyplayer
Make sure to set KIVY_VIDEO=ffpyplayer env variable before running the app.
Pixel rendering
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
class Container(BoxLayout):
pass
class TestName(App):
def build(self):
Builder.load_string("""
<Container>:
id: contain
image: image
Image:
source: "smile.png"
allow_stretch: True
id: image
""")
root = Container()
root.image.texture.mag_filter = 'nearest'
return root
if __name__ == '__main__':
TestName().run()
Config
If you apply argparse yourself, you need to disable kivy's argparse. Do it as follows.
# -*- coding: utf-8 -*-
import os
os.environ["KIVY_NO_ARGS"] = "1" # 이렇게 하면 된다.
import kivy # noqa
kivy.require("2.0.0")
## 이후, kivy 의 설정값을 직접 수정하고 싶다면:
from kivy.config import Config # noqa
Config.set("graphics", "width", "800")
Config.set("graphics", "height", "600")
See also
- Python
- Python:RenderingEngines
- pygame
- pyglet
- panda3d
- Python Arcade
- kivy (KivEnt)
- wxPython
- Minidun
- buildozer
Favorite site
Tutorials
- Flowers That Dye the Mountain Red : Naver Blog - Getting started with Kivy 1 (version 1.11.1 - Installation) (as of 2020/05/07, checked up to lesson 18)
Guide
- Python KIVY | Making a simple clock | Python GUI framework
- How do you make a simple mobile application using Kivy in Python?
- Things you must know before making an Android app with Kivy! (From the basics to real-world use!)
Pages that link here