drillP71-dbftGuiDate.py 文件源码

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

项目:Portfolio 作者: rebeccapizano 项目源码 文件源码
def __init__(self):
        wx.Frame.__init__(self, None, wx.ID_ANY,
                          "File and Folder Dialogs Tutorial")
        global panel
        panel = wx.Panel(self, wx.ID_ANY)
        self.currentDirectory = os.getcwd()

        # create the buttons and bindings
        dirDlgBtn1 = wx.Button(panel, label="Choose Source")
        dirDlgBtn1.Bind(wx.EVT_BUTTON, self.onDir1)

        dirDlgBtn2 = wx.Button(panel, label="Choose Destination")
        dirDlgBtn2.Bind(wx.EVT_BUTTON, self.onDir2)

        moveBtn=wx.Button(panel, label="Check and Move Files")
        moveBtn.Bind(wx.EVT_BUTTON, self.moveUFiles) 
        #moveBtn.Bind(wx.EVT_BUTTON, panel.Update) 

        #SQLite
        conn = sqlite3.connect('checkTimes.db')
        conn.execute('CREATE TABLE if not exists \
                    Checks(ID INTEGER PRIMARY KEY AUTOINCREMENT, \
                    checkTime DATETIME)')
        cursor = conn.execute("SELECT checkTime from Checks \
                    where oid = (SELECT max(oid) from Checks)")
        rows = cursor.fetchall()
        conn.commit()

        #Show Last Time Checked
        timestr=str(rows).replace("[(u'", '').replace("',)]", '')
        TextA=wx.StaticText(panel, -1, 'Last checked: '+timestr, (100, 175))
        TextA.SetForegroundColour('Navy')
        font = wx.Font(8, wx.DECORATIVE, wx.NORMAL, wx.NORMAL)
        #TextA.SetFont(font)

        # put the buttons in a sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(dirDlgBtn1, 0, wx.ALL|wx.CENTER, 5)
        sizer.Add(dirDlgBtn2, 0, wx.ALL|wx.CENTER, 5)
        sizer.Add(moveBtn, 0, wx.ALL|wx.CENTER, 5)
        panel.SetSizer(sizer)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号