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

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

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

  2. <tfoot id='yNAea'></tfoot>

      Kivy/Python Countdown App 項目 kivy 沒有屬性 'built

      Kivy/Python Countdown App project kivy has no attribute #39;built#39; error(Kivy/Python Countdown App 項目 kivy 沒有屬性 built 錯誤)

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

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

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

                <tfoot id='wuKQe'></tfoot>

                本文介紹了Kivy/Python Countdown App 項目 kivy 沒有屬性 'built' 錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                問題:什么是沒有屬性已構(gòu)建"錯誤,我需要做什么來更正此代碼,以便它可以接收日期時間對象并顯示倒計時?抱歉,帖子太長了.

                Question: What is a 'has no attribute 'built' error, and what do I need to do to correct this code so that it can take in a datetime object and display the count down? Sorry for the long post.

                我已經(jīng)提供了代碼和 .kv 文件的鏈接.

                I've provided the code and a link to the .kv file.

                我嘗試創(chuàng)建一個倒計時時鐘,它將 datetime 對象作為參數(shù)并倒計時到該日期(使用 python 和 kivy).它基本上是對 Adam Giermanowski 的倒計時教程.

                I tried to create a countdown clock that takes a datetime object as a parameter and counts down to that date (using python and kivy). It's basically an slight adaptation of Adam Giermanowski's countdown timer tutorial.

                這是我的代碼:

                from kivy.app import App
                from kivy.uix.label import Label
                from kivy.uix.boxlayout import BoxLayout
                from kivy.properties import StringProperty
                from kivy.clock import Clock
                import datetime
                
                #datetime object
                b= datetime.datetime(2016,9,12,3,5)
                
                class Counter_Timer(BoxLayout):
                    days = StringProperty()
                    hours = StringProperty()
                    minutes = StringProperty()
                    seconds = StringProperty()
                
                    def __init__(self, datetimeOBJ):
                        self.datetimeOBJ = datetimeOBJ
                
                    def update(self, dt):
                        #the difference in time
                        delta = self.datetimeOBJ - datetime.datetime.now()
                        self.days = str(delta.days)
                        hour_string = str(delta).split(', ')[1]
                        self.hours = hour_string.split(':')[0]
                        self.minutes = hour_string.split(':')[1]
                        self.seconds = hour_string.split(':')[2].split('.')[0]
                
                
                class Counter(App):
                    #takes a datetime object as a parameter 
                    def __init__(self, datetimeOBJ):
                        self.datetimeOBJ = datetimeOBJ 
                
                    def build(self):
                        Counter = Counter_Timer(self.datetimeOBJ)
                        Clock.schedule_interval(Counter.update, 1.0)
                        return Counter
                
                if __name__=='__main__':
                    Counter(b).run()
                

                這是 Counter(b).run() 行的錯誤:

                Here's the error on the Counter(b).run() line:

                AttributeError: 'Counter' object has no attribute 'built'
                

                推薦答案

                你必須在重寫 __init__ 時調(diào)用超類的構(gòu)造函數(shù),這樣構(gòu)造函數(shù)所做的所有事情才能擁有課堂作業(yè)的其他方法已完成.你的 init 方法應該是這樣的:

                You have to call the superclasses constructor when you override __init__, so that all of the things that that constructor does in order to have the other methods of the class work gets done. Your init method should be this:

                def __init__(self, datetimeOBJ):
                    App.init(self)
                    self.datetimeOBJ = datetimeOBJ 
                

                這篇關于Kivy/Python Countdown App 項目 kivy 沒有屬性 'built' 錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關文檔推薦

                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 - 自動更改角色顏色)
                <i id='OSvfl'><tr id='OSvfl'><dt id='OSvfl'><q id='OSvfl'><span id='OSvfl'><b id='OSvfl'><form id='OSvfl'><ins id='OSvfl'></ins><ul id='OSvfl'></ul><sub id='OSvfl'></sub></form><legend id='OSvfl'></legend><bdo id='OSvfl'><pre id='OSvfl'><center id='OSvfl'></center></pre></bdo></b><th id='OSvfl'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='OSvfl'><tfoot id='OSvfl'></tfoot><dl id='OSvfl'><fieldset id='OSvfl'></fieldset></dl></div>
                      • <bdo id='OSvfl'></bdo><ul id='OSvfl'></ul>

                            <tbody id='OSvfl'></tbody>

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

                          <tfoot id='OSvfl'></tfoot>
                          <legend id='OSvfl'><style id='OSvfl'><dir id='OSvfl'><q id='OSvfl'></q></dir></style></legend>

                          主站蜘蛛池模板: 欧美精品一区二区三区在线 | 国产高清视频一区二区 | 四虎影院在线观看av | 国产精品福利视频 | 神马久久香蕉 | 在线看无码的免费网站 | 伊人网伊人 | 久久激情网 | 91久久久久久久久久久 | 91在线电影| 久久久91精品国产一区二区三区 | 国产一区二区三区在线免费观看 | 国产精品久久久99 | sese视频在线观看 | 欧美在线一区二区三区 | 黄色a级一级片 | 搞黄网站在线观看 | 中文精品视频 | 精品久久久久久亚洲精品 | 日韩成人| 自拍偷拍亚洲欧美 | 国产精品视频二区三区 | 国产在线看片 | av在线视 | 成人欧美一区二区三区 | 中文字幕国产高清 | 亚洲欧美在线视频 | 看av网址| 国产精品毛片久久久久久久 | 一区二区三区韩国 | 一区二区精品 | 能看的av网站 | 一区二区三区精品在线 | 91极品尤物在线播放国产 | 亚洲影音| 久草www | 国产九九九九 | 欧美 视频 | 国产精品亚洲一区 | 成人乱人乱一区二区三区软件 | 一级片视频免费观看 |