def openFrame3(self):
        """"""
        #生活小助手
        self.hide()
        self.win_main3 = tk.Toplevel()
        left = (self.win_main3.winfo_screenwidth() - 600) // 2
        top = (self.win_main3.winfo_screenheight() - 700) // 2
        self.win_main3.geometry("{:}x{:}+{:}+{:}".format(600, 700, left, top))
        a = "{:}生活小助手"
        a = a.format(self.Account)
        self.win_main3.title(a)

        #使用者關閉視窗觸發的事件(第一個刪除視窗,第二個為函式名,即過程)
        self.win_main3.protocol('WM_DELETE_WINDOW',
                                lambda: self.CloseWin(self.win_main3))

        canvas_width = 1000
        canvas_height = 1000
        canvas = tk.Canvas(self.win_main3,
                           width=canvas_width,
                           height=canvas_height)
        canvas.pack()
        #背景
        canvas.create_image(300, 350, image=self.photo_生活小助手)

        def weather():
            BotSpeak.speak("現在進入的是天氣預報介面")
            Myweather()

        def invoice():
            BotSpeak.speak("現在進入的是兌獎查詢介面")
            invoiceMyApp()

        def Foreign():
            BotSpeak.speak("現在進入的是匯率轉換介面")
            MyForeignExchange()

        def requests():
            BotSpeak.speak("現在進入的是星座運勢介面")
            Myrequests()

        but_weather = tk.Button(self.win_main3,
                                image=self.photo_weather,
                                command=weather)
        but_weather.place(x=44, y=5)
        but_tick = tk.Button(self.win_main3,
                             image=self.photo_tick,
                             command=invoice)
        but_tick.place(x=310, y=295)
        but_money = tk.Button(self.win_main3,
                              image=self.photo_money,
                              command=Foreign)
        but_money.place(x=44, y=295)
        but_start = tk.Button(self.win_main3,
                              image=self.photo_start,
                              command=requests)
        but_start.place(x=310, y=2)
        BotSpeak.speak("現在進入的是生活小助手介面 請點選個別按鈕進入相對應的介面")
        def btn0():

            if self.A == 0:
                self.A = 1
                buttontext.set('↑')
                BotSpeak.speak("輸入方塊的焦點在重複輸入密碼")
            elif self.A == 1:
                self.A = 0
                BotSpeak.speak("輸入方塊的焦點在輸入密碼")
                buttontext.set('↓')
 def face_ID(self):
     #        print("準備臉部辨識中...")
     BotSpeak.speak("準備臉部辨識中")
     self.Account = face.my_main()
     print("Account", self.Account)
     with open('usrs_info.pickle', 'rb') as usr_file:
         usrs_info = pickle.load(usr_file)
     if self.Account in usrs_info:
         #            tk.messagebox.showinfo(title='歡迎', message='歡迎來到PDMS! ' + self.Account)
         msg = "歡迎來到KEEPING{:}".format(self.Account)
         BotSpeak.speak(msg)
         self.win_pw.destroy()
         self.chooseclear()
    def __init__(self):
        self.A = 0  #定義更改密碼的文字輸入盒的焦點
        """Constructor"""
        self.win = tk.Tk()
        self.win.geometry("600x800")
        self.win.title("Keeping_開始畫面")  #定義標題名稱
        left = (self.win.winfo_screenwidth() - 600) // 2  #指定視窗置中
        top = (self.win.winfo_screenheight() - 800) // 2
        self.win.geometry("{:}x{:}+{:}+{:}".format(600, 800, left, top))
        #圖片呼叫
        self.photo_background = tk.PhotoImage(file=r"./image/首頁.png")
        self.photo_Login = tk.PhotoImage(file=r"./image/登入_加背.png")
        self.photo_備忘錄 = tk.PhotoImage(file=r"./image/備忘錄.png")
        self.photo_行事曆 = tk.PhotoImage(file=r"./image/行事曆.png")
        self.photo_生活小助手 = tk.PhotoImage(file=r"./image/生活小助手.png")
        self.photo_日歷 = tk.PhotoImage(file=r"./image/日歷_背.png")
        self.photo_使用說明 = tk.PhotoImage(file=r"./image/使用說明.png")
        self.photo_管家 = tk.PhotoImage(file=r"./image/管家_背.png")
        self.photo_筆記 = tk.PhotoImage(file=r"./image/筆記_背.png")
        self.photo_weather = tk.PhotoImage(file=r"./image/天氣預報.png")
        self.photo_tick = tk.PhotoImage(file=r"./image/兌獎查詢.png")
        self.photo_money = tk.PhotoImage(file=r"./image/匯率換算.png")
        self.photo_start = tk.PhotoImage(file=r"./image/星座運勢.png")
        self.photo_使用說明 = tk.PhotoImage(file=r"./image/使用說明_背.png")
        self.photo_喇叭 = tk.PhotoImage(file=r"./image/喇叭.png")

        canvas_width = 1000  #新增一個畫布
        canvas_height = 1000
        canvas = tk.Canvas(self.win, width=canvas_width, height=canvas_height)
        canvas.pack()
        #背景
        canvas.create_image(300, 400, image=self.photo_background)  #將背景貼到畫布上

        #選擇使用說明
        but = tk.Button(self.win,
                        image=self.photo_使用說明,
                        command=self.openFrame)
        but.place(x=410, y=10)

        #進入登入畫面
        but_Log = tk.Button(self.win,
                            image=self.photo_Login,
                            command=self.password)
        but_Log.place(x=200, y=570)
        BotSpeak.speak("歡迎來到KEEPING個人資料管理系統  請點選下方按鍵登入")
        self.win.mainloop()
        BotSpeak.speak("掰掰")
        def print_selection():
            msg = "你所選擇要進入的是{:}系統".format(var.get())
            BotSpeak.speak(msg)
            Ans = tk.messagebox.askyesno(title='小提醒',
                                         message='你是否選擇要進入' + var.get() +
                                         "的頁面?")
            if Ans:
                if var.get() == "備忘錄":
                    Login()

                elif var.get() == "行事曆":
                    date()
#                    pass
                elif var.get() == "生活小助手":
                    self.openFrame3()

                self.win_ch.destroy()  #關閉畫面
        def sign_to_Mofan_Python():
            np = new_pwd.get()
            npf = new_pwd_confirm.get()
            nn = new_name.get()
            with open('usrs_info.pickle', 'rb') as usr_file:
                exist_usr_info = pickle.load(usr_file)
            if np != npf:
                tk.messagebox.showerror('Error', '兩個密碼不相同')
            #elif nn in exist_usr_info:
            #    tk.messagebox.showerror('Error', '此帳號已存在,請直接登入!')
            else:
                exist_usr_info[nn] = np
                with open('usrs_info.pickle', 'wb') as usr_file:
                    pickle.dump(exist_usr_info, usr_file)
#                tk.messagebox.showinfo('Welcome', '恭喜你已成功更改密碼!')
                BotSpeak.speak("恭喜你已成功更改密碼!")
                win_pw_sign_up.destroy()
        def usr_login():
            usr_name = var_usr_name.get()
            usr_pwd = var_usr_pwd.get()
            try:
                with open('usrs_info.pickle', 'rb') as usr_file:
                    usrs_info = pickle.load(usr_file)
            except EOFError:
                with open('usrs_info.pickle', 'wb') as usr_file:
                    usrs_info = {'admin': 'admin'}
                    pickle.dump(usrs_info, usr_file)
            if usr_name in usrs_info:
                if usr_pwd == usrs_info[usr_name]:
                    self.Account = usr_name
                    #                    tk.messagebox.showinfo(title='歡迎', message='歡迎來到PDMS! ' + usr_name)
                    msg = "歡迎來到KEEPING{:}".format(str(usr_name))
                    BotSpeak.speak(msg)
                    #cleardata = tk.messagebox.askyesno('Welcome',
                    #                '是否要清空資料庫?')

                    #if cleardata:
                    self.win_pw.destroy()
                    self.chooseclear()

                else:
                    #                    tk.messagebox.showerror(message='密碼輸入錯誤')
                    BotSpeak.speak("密碼輸入錯誤")

            else:
                #                tk.messagebox.showerror(message='查無此人')
                BotSpeak.speak("查無此人")
                '''
 def requests():
     BotSpeak.speak("現在進入的是星座運勢介面")
     Myrequests()
 def Foreign():
     BotSpeak.speak("現在進入的是匯率轉換介面")
     MyForeignExchange()
 def invoice():
     BotSpeak.speak("現在進入的是兌獎查詢介面")
     invoiceMyApp()
 def weather():
     BotSpeak.speak("現在進入的是天氣預報介面")
     Myweather()
 def spaekHowToUse(self, tit):
     a = "{:}_使用說明書.txt".format(tit)
     with open(a, "r", encoding="UTF-8") as fd:
         data = fd.read()
         BotSpeak.speak(data)
    def password(self):
        BotSpeak.speak("請輸入密碼或者點選#鍵進行臉部辨識")
        self.hide()
        self.win_pw = tk.Toplevel()
        self.win_pw.title('root')
        left = (self.win_pw.winfo_screenwidth() - 500) // 2
        top = (self.win_pw.winfo_screenheight() - 200) // 2
        self.win_pw.geometry("{:}x{:}+{:}+{:}".format(500, 200, left, top))
        self.win_pw.bg05 = tk.PhotoImage(file=r"./image/bg05.png")
        #使用者關閉視窗觸發的事件(第一個刪除視窗,第二個為函式名,即過程)
        self.win_pw.protocol('WM_DELETE_WINDOW',
                             lambda: self.closeWindow(self.win_pw))
        canvas_width = 500
        canvas_height = 200
        canvas = tk.Canvas(self.win_pw,
                           width=canvas_width,
                           height=canvas_height)
        canvas.pack()
        #背景
        canvas.create_image(130, 10, image=self.win_pw.bg05)

        # user information
        tk.Label(self.win_pw, text='使用者名稱: ').place(x=50, y=50)
        tk.Label(self.win_pw, text='使用者密碼: ').place(x=50, y=90)

        var_usr_name = tk.StringVar()
        var_usr_name.set('105103308')
        entry_usr_name = tk.Entry(self.win_pw, textvariable=var_usr_name)
        entry_usr_name.place(x=160, y=50)
        var_usr_pwd = tk.StringVar()
        entry_usr_pwd = tk.Entry(self.win_pw,
                                 textvariable=var_usr_pwd,
                                 show='*')
        entry_usr_pwd.place(x=160, y=90)

        def usr_login():
            usr_name = var_usr_name.get()
            usr_pwd = var_usr_pwd.get()
            try:
                with open('usrs_info.pickle', 'rb') as usr_file:
                    usrs_info = pickle.load(usr_file)
            except EOFError:
                with open('usrs_info.pickle', 'wb') as usr_file:
                    usrs_info = {'admin': 'admin'}
                    pickle.dump(usrs_info, usr_file)
            if usr_name in usrs_info:
                if usr_pwd == usrs_info[usr_name]:
                    self.Account = usr_name
                    #                    tk.messagebox.showinfo(title='歡迎', message='歡迎來到PDMS! ' + usr_name)
                    msg = "歡迎來到KEEPING{:}".format(str(usr_name))
                    BotSpeak.speak(msg)
                    #cleardata = tk.messagebox.askyesno('Welcome',
                    #                '是否要清空資料庫?')

                    #if cleardata:
                    self.win_pw.destroy()
                    self.chooseclear()

                else:
                    #                    tk.messagebox.showerror(message='密碼輸入錯誤')
                    BotSpeak.speak("密碼輸入錯誤")

            else:
                #                tk.messagebox.showerror(message='查無此人')
                BotSpeak.speak("查無此人")
                '''
                is_sign_up = tk.messagebox.askyesno('Welcome',
                                    '無使用者資料,是否創建一個?')
                if is_sign_up:
                    self.usr_sign_up()
                '''

        def usr_clear():
            var_usr_name.set('105103308')
            var_usr_pwd.set('')

        # login and sign up button
        btn_login = tk.Button(self.win_pw,
                              text='登入',
                              font=('Noto Sans Mono CJK TC Regular', 18),
                              command=usr_login)
        btn_login.place(x=150, y=130)
        btn_login = tk.Button(self.win_pw,
                              text='C',
                              font=('Noto Sans Mono CJK TC Regular', 18),
                              command=usr_clear)
        btn_login.place(x=420, y=130, width=40, height=40)

        def btn01():
            entry_usr_pwd.insert(tk.END, '1')

        def btn02():
            entry_usr_pwd.insert(tk.END, '2')

        def btn03():
            entry_usr_pwd.insert(tk.END, '3')

        def btn04():
            entry_usr_pwd.insert(tk.END, '4')

        def btn05():
            entry_usr_pwd.insert(tk.END, '5')

        def btn06():
            entry_usr_pwd.insert(tk.END, '6')

        def btn07():
            entry_usr_pwd.insert(tk.END, '7')

        def btn08():
            entry_usr_pwd.insert(tk.END, '8')

        def btn09():
            entry_usr_pwd.insert(tk.END, '9')

        def btn00():
            entry_usr_pwd.insert(tk.END, '0')

        btn_login = tk.Button(self.win_pw,
                              text='#',
                              font=('Noto Sans Mono CJK TC Regular', 20),
                              command=lambda: self.face_ID())
        btn_login.place(x=340, y=130, width=40, height=40)
        btn_login = tk.Button(self.win_pw,
                              text='0',
                              font=('Noto Sans Mono CJK TC Regular', 20),
                              command=btn00)
        btn_login.place(x=380, y=130, width=40, height=40)
        btn_login = tk.Button(self.win_pw,
                              text='1',
                              font=('Noto Sans Mono CJK TC Regular', 20),
                              command=btn01)
        btn_login.place(x=340, y=90, width=40, height=40)
        btn_login = tk.Button(self.win_pw,
                              text='2',
                              font=('Noto Sans Mono CJK TC Regular', 20),
                              command=btn02)
        btn_login.place(x=380, y=90, width=40, height=40)
        btn_login = tk.Button(self.win_pw,
                              text='3',
                              font=('Noto Sans Mono CJK TC Regular', 20),
                              command=btn03)
        btn_login.place(x=420, y=90, width=40, height=40)
        btn_login = tk.Button(self.win_pw,
                              text='4',
                              font=('Noto Sans Mono CJK TC Regular', 20),
                              command=btn04)
        btn_login.place(x=340, y=50, width=40, height=40)
        btn_login = tk.Button(self.win_pw,
                              text='5',
                              font=('Noto Sans Mono CJK TC Regular', 20),
                              command=btn05)
        btn_login.place(x=380, y=50, width=40, height=40)
        btn_login = tk.Button(self.win_pw,
                              text='6',
                              font=('Noto Sans Mono CJK TC Regular', 20),
                              command=btn06)
        btn_login.place(x=420, y=50, width=40, height=40)
        btn_login = tk.Button(self.win_pw,
                              text='7',
                              font=('Noto Sans Mono CJK TC Regular', 20),
                              command=btn07)
        btn_login.place(x=340, y=10, width=40, height=40)
        btn_login = tk.Button(self.win_pw,
                              text='8',
                              font=('Noto Sans Mono CJK TC Regular', 20),
                              command=btn08)
        btn_login.place(x=380, y=10, width=40, height=40)
        btn_login = tk.Button(self.win_pw,
                              text='9',
                              font=('Noto Sans Mono CJK TC Regular', 20),
                              command=btn09)
        btn_login.place(x=420, y=10, width=40, height=40)