Page 509 - 3-2
P. 509

screen.fill(BLACK)
                                    screen.blit(camera,(170,400))

                                    pygame.display.flip()
                                    time.sleep(7)

                                    pygame.quit()
                                    system_restart()






                            if (re.search(u' 몇 시', transcript, re.I) or re.search(u' 메시', transcript, re.I)or
            re.search(u' 며시', transcript, re.I)):



                                            now = time.localtime()
                                            hour = now.tm_hour%12

                                            if hour == 0:
                                                    hour = 12

                                            s = " 현재 시각....%s  시 %s  분 입니다." % (hour, now.tm_min)
                                            print (s)



                                            os.system('wget     -q      -U     Mozilla     -O      output.mp3
            "http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&textlen=32&client=tw-ob&q=%
            s&tl=ko-kr"' % s)

                                            pygame.mixer.music.load("output.mp3")
                                            pygame.mixer.music.play()

                                            time.sleep(5)
                                            system_restart()



                            if (re.search(u' 몇 일', transcript, re.I) or re.search(u' 며칠', transcript, re.I)or
            re.search(u' 날짜',  transcript,  re.I)or  re.search(u' 날자',  transcript,  re.I)or  re.search(u' 몇이',
            transcript, re.I)):



                                            now = time.localtime()



                                            week = ( ' 월', ' 화', ' 수', ' 목', ' 금', ' 토', ' 일' );



                                            t = " 오늘은 %s   년 %s  월 %s 일 ....%s 요일 입니다"       % (now.tm_year,
            now.tm_mon, now.tm_mday, week[now.tm_wday])

                                            print (t)



                                                         - 509 -
   504   505   506   507   508   509   510   511   512   513   514