TTS(Text To Speech)
1) pip install gTTs
2) pip install playsoundfrom gtts import gTTS from playsound import playsound text='안녕하세요, 오윤범입니다.' tts=gTTS(text=text, lang='ko') tts.save('./Python_practice/output/hi.mp3') print('생성 완료!') playsound('././Python_practice/output/hi.mp3') print('음성출력 완료!')
- output 폴더에 hi.mp3 생성 / "안녕하세요, 오윤범입니다." 음성 출력
PyQt 를 활용한 TTS App
Qt Designer을 이용하여 ttsApp.ui 작성
import sys from PyQt5 import uic from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * from gtts import gTTS from playsound import playsound import time class qtApp(QWidget): def __init__(self): super().__init__() uic.loadUi('./Python_practice/ttsApp.ui',self) #Qt Designer로 만든 ui 사용 self.setWindowTitle('텍스트 투 스피치') self.btnQrGen.clicked.connect(self.btnQrGenClicked) self.txtQrData.returnPressed.connect(self.btnQrGenClicked) def btnQrGenClicked(self): text=self.txtQrData.text() if text=='': QMessageBox.warning(self,'경고','텍스트를 입력하세요') return tts=gTTS(text=text, lang='ko') tts.save('./Python_practice/output/hi.mp3') time.sleep(1.0) playsound('././Python_practice/output/hi.mp3') if __name__=='__main__': app=QApplication(sys.argv) ex=qtApp() ex.show() sys.exit(app.exec_())
생성 버튼 Click시 사용자가 입력한 문자열을 읽어줌
암호 해제 APP
암호는.zip의 비밀번호는 1234로 설정되어있음
# 암호 해제 앱 import itertools import time import zipfile pwd_string='0123456789' # 패스워드에 영문자도 들어있으면 9 뒤에 영어 소/대문자 다 넣어야함 file=zipfile.ZipFile('./Python_practice/암호는.zip') isFind = False #암호를 찾았는지 for i in range(1,5): attempts=itertools.product(pwd_string, repeat=i) for attempt in attempts: try_pass=''.join(attempt) print(try_pass) #time.sleep(0.01) try: file.extractall(pwd=try_pass.encode(encoding='utf-8')) print(f'암호는 {try_pass} 입니다') isFind=True; break # 암호를 찾으면 break except: pass if isFind==True : break
압축파일의 암호를 찾아내며 이를 .txt 파일로 저장해줌
Looking ahead, Paraulogic d'avui remains committed to pushing the boundaries of what is possible in the field of language technology, constantly innovating and evolving to meet the changing needs of its users and the broader society. Whether it's exploring new applications of artificial intelligence and natural language processing or partnering with like-minded organizations to advance language preservation and revitalization efforts, Paraulogic https://paraulogicavui.es/ d'avui is dedicated to driving positive change and making a lasting impact on the world. As technology continues to advance and the global community becomes increasingly interconnected, Paraulogic d'avui stands ready to lead the way, harnessing the power of language to bridge divides, foster understanding, and create a more inclusive and harmonious future for generations to come.