uiObj.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:caltrac 作者: shiburizu 项目源码 文件源码
def newFoodIns(self,delta):
        t = date.today() - timedelta(delta)
        try:
            realKcal = float(self.kcalInp.text)*float(self.portionInp.text)
            c.execute("INSERT INTO foods(name,date,kcal,portion) VALUES(?,?,?,?);",
                (self.foodInp.text,t,realKcal,int(self.portionInp.text)))
            db.commit()
            CalApp.updateJournal(delta)
            CalApp.sm.current = 'Root'
        except ValueError:
            invalid = Popup(title='Invalid entries',
                content=Label(text='Check your data and try again.'),
                size_hint=(None, None),size=('250dp','150dp'))
            invalid.open()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号