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

    1. <legend id='mvX3j'><style id='mvX3j'><dir id='mvX3j'><q id='mvX3j'></q></dir></style></legend>

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

        • <bdo id='mvX3j'></bdo><ul id='mvX3j'></ul>

        <i id='mvX3j'><tr id='mvX3j'><dt id='mvX3j'><q id='mvX3j'><span id='mvX3j'><b id='mvX3j'><form id='mvX3j'><ins id='mvX3j'></ins><ul id='mvX3j'></ul><sub id='mvX3j'></sub></form><legend id='mvX3j'></legend><bdo id='mvX3j'><pre id='mvX3j'><center id='mvX3j'></center></pre></bdo></b><th id='mvX3j'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='mvX3j'><tfoot id='mvX3j'></tfoot><dl id='mvX3j'><fieldset id='mvX3j'></fieldset></dl></div>
      1. <tfoot id='mvX3j'></tfoot>
      2. 用于簡單計算的 Kivy 輸入值

        Kivy input values for simple calculations(用于簡單計算的 Kivy 輸入值)
          <bdo id='eiLdj'></bdo><ul id='eiLdj'></ul>
          • <legend id='eiLdj'><style id='eiLdj'><dir id='eiLdj'><q id='eiLdj'></q></dir></style></legend>
              <tbody id='eiLdj'></tbody>

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

            <tfoot id='eiLdj'></tfoot>

              • <i id='eiLdj'><tr id='eiLdj'><dt id='eiLdj'><q id='eiLdj'><span id='eiLdj'><b id='eiLdj'><form id='eiLdj'><ins id='eiLdj'></ins><ul id='eiLdj'></ul><sub id='eiLdj'></sub></form><legend id='eiLdj'></legend><bdo id='eiLdj'><pre id='eiLdj'><center id='eiLdj'></center></pre></bdo></b><th id='eiLdj'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='eiLdj'><tfoot id='eiLdj'></tfoot><dl id='eiLdj'><fieldset id='eiLdj'></fieldset></dl></div>
                1. 本文介紹了用于簡單計算的 Kivy 輸入值的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我對 Kivy 很陌生(昨天開始),我正在嘗試創建一個足夠簡單的應用程序,該應用程序具有用于計算體積的多個高度和面積值的輸入框.我找不到任何這樣做的工作方法.到目前為止,我得到的只有這個:

                  I'm quite new to Kivy (started yesterday) and am trying to create a simple enough app that has input boxes for several values of height and area to calculate volumes. I cant find any working methods of doing this. So far all I have got is this:

                  from kivy.app import App
                  from kivy.lang import Builder
                  from kivy.uix.screenmanager import ScreenManager, Screen
                  
                  
                  Builder.load_string("""
                  <MenuScreen>:
                      FloatLayout:
                  
                          Label:
                              text: 'Please Select an Area to Work With:'
                              pos: 230, 490
                              size_hint: .15, .05
                              font_size: 23
                  
                  
                  
                          Button:
                              text: "A"
                              pos: 230, 100
                              size_hint: .4,.1
                              font_size: 23
                              on_press: root.manager.current = 'settings'
                  
                  
                          Button:
                              text: "B"
                              pos: 230, 210
                              size_hint: .4,.1
                              font_size: 23
                              on_press: root.manager.current = 'settings'
                  
                  
                          Button:
                              text: "C"
                              pos: 230, 320
                              size_hint: .4,.1
                              font_size: 23
                              on_press: root.manager.current = 'settings'
                  
                  
                  
                          Button:
                              text: "D"
                              pos: 230, 420
                              size_hint: .4,.1
                              font_size: 23
                              on_press: root.manager.current = 'settings'
                  
                  
                  
                  
                  
                  
                  <SettingsScreen>:
                      GridLayout:
                          Label:
                              text: 'Room 1'
                              pos: 6, 460
                              size_hint: .15, .05
                              font_size: 23
                  
                          Label:
                              text: 'Room 2'
                              pos: 6, 420
                              size_hint: .15, .05
                              font_size: 23
                  
                          Label:
                              text: 'Room 3'
                              pos: 6, 380
                              size_hint: .15, .05
                              font_size: 23
                  
                          Label:
                              text: 'Room 4'
                              pos: 6, 340
                              size_hint: .15, .05
                              font_size: 23
                  
                          Label:
                              text: 'Room 5'
                              pos: 6, 300
                              size_hint: .15, .05
                              font_size: 23
                  
                          Label:
                              text: 'Room 6'
                              pos: 6, 260
                              size_hint: .15, .05
                              font_size: 23
                  
                          TextInput:
                              text1: "0"
                              multiline: False
                              pos: 200,420
                              font_size: 23
                              on_text: viewer.text = self.text1
                              size_hint: .001, .001
                  
                          TextInput:
                              text2: "0"
                              multiline: False
                              pos: 200, 420
                              font_size: 23
                              on_text: viewer.text = self.text2
                              size_hint: .001, .001
                  
                          TextInput:
                              text3: "0"
                              multiline: False
                              pos: 200,380
                              font_size: 23
                              on_text: viewer.text = self.text3
                              size_hint: .001, .001
                  
                          TextInput:
                              text4: "0"
                              multiline: False
                              pos: 200,340
                              font_size: 23
                              on_text: viewer.text = self.text4
                              size_hint: .001, .001
                  
                  
                          TextInput:
                              text5: "0"
                              multiline: False
                              pos: 200,300
                              font_size: 23
                              on_text: viewer.text = self.text5
                              size_hint: .001, .001
                  
                          TextInput:
                              text6: "0"
                              multiline: False
                              pos: 200,240
                              font_size: 23
                              on_text: viewer.text = self.text6
                              size_hint: .001, .001
                  """)
                  
                  # Declare both screen
                  class MenuScreen(Screen):
                      pass
                  
                  class SettingsScreen(Screen):
                      pass
                  
                  # Create the screen manager
                  sm = ScreenManager()
                  sm.add_widget(MenuScreen(name='menu'))
                  sm.add_widget(SettingsScreen(name='settings'))
                  
                  class TestApp(App):
                  
                      def build(self):
                          return sm
                  
                  if __name__ == '__main__':
                      TestApp().run()
                  

                  我計劃為每個按下的按鈕設置唯一的第二頁,但希望有任何幫助.

                  Im planning to have the second page unique for each button pressed, but want Any help would be appreciated.

                  推薦答案

                  希望我能理解你的問題.您正在尋求執行此操作的方法.簡單的答案是您擁有整個 Python 來執行您想要的所有操作.Kivy 是一個提供大量組件來設計 GUI 的庫.它還為您提供了一種由 Builder.load_string() 解析的語言.這是一個可能或多或少是您正在尋找的示例.它有點像第一個屏幕上的計算器.第二個屏幕是空的,您可以使用底部按鈕在它們之間移動.

                  I hope I got to understand your question. You are asking for methods to do this. The plain answer is that you have the whole Python to do all the operations you want. Kivy is a library that provides a lot of components to design GUI. It also provides you with a language that is parsed by the Builder.load_string(). Here is an example that might be more or less what you are looking for. It is sort of a calculator on the first screen. The second screen is empty and you can move between them with the bottom buttons.

                  第一個屏幕上的計算器有兩個 InputTexts 和兩個按鈕(SumProduct).Sum 按鈕直接在 kivy 語言上實現了求和.Product Button 調用根中的一個方法(Calc 的一個實例).該方法本身并不存在.我在 kivy 部分下面的 python 代碼中創建.對于我所說的代碼,有一些注釋.

                  The calculator on the first screen has two InputTexts and two buttons (Sum and Product). The Sum Button has the implementation of a sum directly on the kivy language. The Product Button calls a method in the root (an instance of Calc). The method doesn't exist by itself. I created in the python code below the kivy section. There is some comments on the code for what I am saying.

                  from kivy.app import App
                  from kivy.lang import Builder
                  from kivy.uix.floatlayout import FloatLayout
                  
                  Builder.load_string("""
                  <Calc>:
                      # This are attributes of the class Calc now
                      a: _a
                      b: _b
                      result: _result
                      AnchorLayout:
                          anchor_x: 'center'
                          anchor_y: 'top'
                          ScreenManager:
                              size_hint: 1, .9
                              id: _screen_manager
                              Screen:
                                  name: 'screen1'
                                  GridLayout:
                                      cols:1
                                      TextInput:
                                          id: _a
                                          text: '3'
                                      TextInput:
                                          id: _b
                                          text: '5'
                                      Label:
                                          id: _result
                                      Button:
                                          text: 'sum'
                                          # You can do the opertion directly
                                          on_press: _result.text = str(int(_a.text) + int(_b.text))
                                      Button:
                                          text: 'product'
                                          # Or you can call a method from the root class (instance of calc)
                                          on_press: root.product(*args)
                              Screen:
                                  name: 'screen2'
                                  Label: 
                                      text: 'The second screen'
                      AnchorLayout:
                          anchor_x: 'center'
                          anchor_y: 'bottom'
                          BoxLayout:
                              orientation: 'horizontal'
                              size_hint: 1, .1
                              Button:
                                  text: 'Go to Screen 1'
                                  on_press: _screen_manager.current = 'screen1'
                              Button:
                                  text: 'Go to Screen 2'
                                  on_press: _screen_manager.current = 'screen2'""")
                  
                  class Calc(FloatLayout):
                      # define the multiplication of a function
                      def product(self, instance):
                          # self.result, self.a and self.b where defined explicitely in the kv
                          self.result.text = str(int(self.a.text) * int(self.b.text))
                  
                  class TestApp(App):
                      def build(self):
                          return Calc()
                  
                  if __name__ == '__main__':
                      TestApp().run()
                  

                  這篇關于用于簡單計算的 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 - 自動更改角色顏色)

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

                    <small id='4mDHs'></small><noframes id='4mDHs'>

                    • <legend id='4mDHs'><style id='4mDHs'><dir id='4mDHs'><q id='4mDHs'></q></dir></style></legend>

                    • <tfoot id='4mDHs'></tfoot>
                          • <bdo id='4mDHs'></bdo><ul id='4mDHs'></ul>
                            主站蜘蛛池模板: 国产精品久久久久久久久久不蜜臀 | 国产精品欧美一区二区 | 国产高清免费视频 | 亚洲欧美视频一区 | av性色全交蜜桃成熟时 | 91视视频在线观看入口直接观看 | 日韩精品一区二区在线观看 | 精品成人一区二区 | 中文字幕av一区二区三区 | 欧美性精品 | 午夜国产 | 午夜天堂 | 麻豆av网| 精品国产乱码一区二区三 | 小h片免费观看久久久久 | 国产高清免费视频 | 亚洲 欧美 日韩在线 | 日韩视频国产 | 久久精品国产99国产 | 国产视频线观看永久免费 | 亚洲一区二区三区欧美 | 日本三级网站在线观看 | 国产91综合| 一区二区免费在线观看 | 欧洲亚洲一区 | 日韩免费av网站 | 黄色av观看 | 精品欧美一区二区三区久久久 | 久草青青| 久久九九99 | 欧美日韩一区精品 | 日韩在线欧美 | www.99热.com| 天天综合网91 | 国产区第一页 | 午夜影院网站 | 欧美综合一区二区 | 国产婷婷色一区二区三区 | 天堂成人国产精品一区 | 国产精品久久网 | 精品国产一区二区久久 |