久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<small id='2Q8jd'></small><noframes id='2Q8jd'>

    1. <tfoot id='2Q8jd'></tfoot>
      <i id='2Q8jd'><tr id='2Q8jd'><dt id='2Q8jd'><q id='2Q8jd'><span id='2Q8jd'><b id='2Q8jd'><form id='2Q8jd'><ins id='2Q8jd'></ins><ul id='2Q8jd'></ul><sub id='2Q8jd'></sub></form><legend id='2Q8jd'></legend><bdo id='2Q8jd'><pre id='2Q8jd'><center id='2Q8jd'></center></pre></bdo></b><th id='2Q8jd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='2Q8jd'><tfoot id='2Q8jd'></tfoot><dl id='2Q8jd'><fieldset id='2Q8jd'></fieldset></dl></div>

      <legend id='2Q8jd'><style id='2Q8jd'><dir id='2Q8jd'><q id='2Q8jd'></q></dir></style></legend>
        <bdo id='2Q8jd'></bdo><ul id='2Q8jd'></ul>

        如何使用 Kivy 獲取文本輸入的值

        How to get value of textinput with Kivy(如何使用 Kivy 獲取文本輸入的值)
        <legend id='NQpWG'><style id='NQpWG'><dir id='NQpWG'><q id='NQpWG'></q></dir></style></legend>
        • <small id='NQpWG'></small><noframes id='NQpWG'>

          <tfoot id='NQpWG'></tfoot>

            <tbody id='NQpWG'></tbody>

                <bdo id='NQpWG'></bdo><ul id='NQpWG'></ul>
                1. <i id='NQpWG'><tr id='NQpWG'><dt id='NQpWG'><q id='NQpWG'><span id='NQpWG'><b id='NQpWG'><form id='NQpWG'><ins id='NQpWG'></ins><ul id='NQpWG'></ul><sub id='NQpWG'></sub></form><legend id='NQpWG'></legend><bdo id='NQpWG'><pre id='NQpWG'><center id='NQpWG'></center></pre></bdo></b><th id='NQpWG'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='NQpWG'><tfoot id='NQpWG'></tfoot><dl id='NQpWG'><fieldset id='NQpWG'></fieldset></dl></div>

                  本文介紹了如何使用 Kivy 獲取文本輸入的值的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我是 Kivy 的新手,由于我無法在 PySide 上練習(一些動態庫損壞或者我不知道是什么),我想試試這個巨大的工具.

                  I'm new to Kivy and as i'm not able to practice on PySide (some dynamic libraries broken or i don't know what) i want to try this huge tool.

                  我現在迷路了,我試著這樣做:在 Kivy 應用中獲取文本輸入值

                  I'm lost right now, i tried to do like this : Get textinput value in Kivy app

                  但我不這樣做:

                  <ProduitScreen>:
                      GridLayout:
                          rows: 3
                          cols: 2
                          padding: 10
                          spacing: 10
                          Label:
                              font_size: 20
                              text: 'Nom du produit'
                          TextInput:
                              font_size: 20
                              id: nom
                          Label:
                              font_size: 20
                              text: 'Prix'
                          TextInput:
                              font_size: 20
                              id: prix
                          Button:
                              text: 'Ajouter'
                              on_press: self.ajouter()
                          Button:
                              text: 'Quitter'
                              on_press: root.manager.current = 'menu'
                  

                  因此,帶有Ajouter"字段文本的按鈕必須允許我獲取兩個字段的值并將它們添加到列表中,但是:

                  So, the Button with the field text filled with 'Ajouter' has to permit me to get the value of both fields and add them into a list but :

                  AttributeError: 'Button' object has no attribute 'ajouter'
                  

                  在我的課堂上是這樣定義的:

                  And in my class it's defined like that :

                  class ProduitScreen(Screen):
                      def ajouter():
                          print "%s au prix de %d a ete ajoute" % (self.nom.txt , float(self.prix.txt))
                  

                  有人能告訴我怎么做嗎?

                  Does someone can tell me how to do that ?

                  blackquote 不保存縮進,所以有完整的代碼 http://pastebin.com/W1WJ8NcL

                  EDIT : The blackquote doesn't save the indentation so there is the full code http://pastebin.com/W1WJ8NcL

                  推薦答案

                  ajouter 方法是 ProduitScreen 的成員而不是 Button 所以你應該使用 root 來引用它:

                  ajouter method is a member of ProduitScreen not Button so you should use root to refer to it:

                      Button:
                          text: 'Ajouter'
                          on_press: root.ajouter()
                  

                  同時解決您對 ajouter 的定義的問題:

                  Also fix issues on your definition of ajouter:

                  class ProduitScreen(Screen):
                      def ajouter(self):
                          print "%s au prix de %f a ete ajoute" % (self.nom.text , float(self.prix.text))
                  

                  為了在 Python 代碼中使用 nomprix,請將其添加到 kv 代碼中:

                  In order to use nom and prix inside your python code, add this to kv code:

                  <ProduitScreen>:
                      nom: nom
                      prix: prix
                  

                  這篇關于如何使用 Kivy 獲取文本輸入的值的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)
                    <bdo id='eORkC'></bdo><ul id='eORkC'></ul>

                        <tbody id='eORkC'></tbody>

                            <legend id='eORkC'><style id='eORkC'><dir id='eORkC'><q id='eORkC'></q></dir></style></legend>

                            <small id='eORkC'></small><noframes id='eORkC'>

                          1. <tfoot id='eORkC'></tfoot>
                            <i id='eORkC'><tr id='eORkC'><dt id='eORkC'><q id='eORkC'><span id='eORkC'><b id='eORkC'><form id='eORkC'><ins id='eORkC'></ins><ul id='eORkC'></ul><sub id='eORkC'></sub></form><legend id='eORkC'></legend><bdo id='eORkC'><pre id='eORkC'><center id='eORkC'></center></pre></bdo></b><th id='eORkC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='eORkC'><tfoot id='eORkC'></tfoot><dl id='eORkC'><fieldset id='eORkC'></fieldset></dl></div>
                            主站蜘蛛池模板: 伊人影院99 | 在线看一区二区 | 午夜精品久久久久久不卡欧美一级 | www亚洲精品 | 亚洲国产精品久久久久婷婷老年 | 免费一级片 | 午夜影院在线 | 久久久国产一区二区三区 | 国产免费av网 | 热久色 | 久久的色 | 在线一区视频 | 91亚洲国产成人久久精品网站 | 亚洲综合区 | 亚洲精品福利在线 | 国产一区二区三区网站 | 久久精品欧美一区二区三区不卡 | 偷拍自拍网址 | 欧美888 | 日韩一区二区三区在线观看 | 91麻豆精品国产91久久久资源速度 | 水蜜桃亚洲一二三四在线 | 欧美成人在线免费 | 亚洲成人天堂 | 欧美a√| 在线播放中文字幕 | www.亚洲视频.com | 免费看a| 成人在线精品视频 | 欧美精品在欧美一区二区 | 国产麻豆乱码精品一区二区三区 | 久久精品91久久久久久再现 | 水蜜桃久久夜色精品一区 | 亚洲一区二区三区免费视频 | 亚洲二区视频 | 亚洲人在线播放 | 中文字幕一区在线观看视频 | 午夜影院在线观看视频 | 最大av在线 | 日韩av在线中文字幕 | 91精品国产91久久综合桃花 |