파이썬[Python]: kivy - QueryDict클래스

kivy.utils 모듈 - QueryDict 클래스(class)


/// 설명

.(dot)으로 딕셔너리를 생성(혹은 query)할 수 있습니다.

참고: utils to wealkproxy 모듈 목록

※ 형식
QueryDict()

reference
https://kivy.org/doc/stable/api-kivy.utils.html

/// 예제

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import kivy
 
kivy.require('2.1.0')
 
from kivy.app import App
from kivy.core.window import Window
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.utils import QueryDict
 
Window.clearcolor = (1111)
Window.size = (5631001)
Window.top, Window.left = 302900
 
 
class FantasticApp(App):
    def _bt_release(self, bt_inst):
        test_dict = QueryDict()
        test_dict.a = 1
        self.lb.text = f"key: a, value: {test_dict.a}"
 
    def build(self):
        bl = BoxLayout(orientation="vertical")
 
        self.lb = lb = Label(text="None", color ="black")
 
        bl.add_widget(lb)
        bl.add_widget(Button(text="QueryDict",
                             on_release=self._bt_release))
        return bl
 
 
FantasticApp().run()
 
cs

/// 출력


* 실행환경: Microsoft Windows 10 Homes
* 인터프리터: 파이썬(Python 3.9)


– 당신을 응원합니다. –

댓글

이 블로그의 인기 게시물

파이썬[Python]: 내장함수 - from_bytes 메서드

파이썬[Python]: 내장함수 - __len__ 메서드

파이썬[Python]: kivy - 한글 사용

파이썬[Python]: 내장함수 - bit_length 메서드

C 언어: sin 함수, cos 함수, tan 함수