Exemple #1
0
    def pronunciationC(self):
        #발음교정
        getText = questionText3.get("1.0", "end")
        script = str(getText)
        # \n 안 지워주면 result -500 에러
        script = script.rstrip("\n")
        #이미지 경로
        winImg = "image/win.jpg"
        loseImg = "image/lose.jpg"
        imgDir = "image/win.jpg"

        result = proCorrect(script)
        pronunciationText3.delete(1.0, "end")
        pronunciationText3.insert(1.0,
                                  "Your pronunciation score is " + str(result))
        pronunciationText3.tag_configure("center", justify='center')
        pronunciationText3.tag_add("center", "1.0", "end")

        if result > 3:
            imgDir = "image/win.jpg"
        else:
            imgDir = "image/lose.jpg"

        self.rLoad = Image.open(imgDir)
        self.rLoad = self.rLoad.resize((350, 200))
        self.rRender = ImageTk.PhotoImage(self.rLoad)
        rlmg = tk.Label(self, image=self.rRender)
        rlmg.image = self.rRender
        rlmg.place(x=425, y=75)
Exemple #2
0
    def pronunciationC(self):
        #발음교정
        getText = questionText2.get("1.0", "end")
        script = str(getText)
        # \n 안 지워주면 result -500 에러
        script = script.rstrip("\n")
        #이미지 경로
        winImg = "image//win.jpg"
        loseImg = "image//lose.jpg"
        imgDir = "image//win.jpg"

        result = proCorrect(script)
        pronunciationText2.delete(1.0, "end")
        pronunciationText2.insert(1.0,
                                  "Your pronunciation score is " + str(result))
        pronunciationText2.tag_configure("center", justify='center')
        pronunciationText2.tag_add("center", "1.0", "end")
        # Add Motor Control Code
        if result > 3:
            imgDir = "image//win.jpg"

            p1.ChangeDutyCycle(12.5)
            p.ChangeDutyCycle(12.5)  # MAX
            time.sleep(1)
            p1.ChangeDutyCycle(2.5)
            p.ChangeDutyCycle(2.5)  # MIN
            time.sleep(1)
        else:
            imgDir = "image//lose.jpg"

        self.rLoad = Image.open(imgDir)
        self.rLoad = self.rLoad.resize((350, 200))
        self.rRender = ImageTk.PhotoImage(self.rLoad)
        rlmg = tk.Label(self, image=self.rRender)
        rlmg.image = self.rRender
        rlmg.place(x=425, y=75)