def check_exists(selector_id):
try:
webdriver.find_element(selector_id)
except NoSuchElementException:
return False
return True
def check_exists(selector, selector_id):
try:
webdriver.find_element_by_selector(selector_id)
except NoSuchElementException:
return False
return True
pydub.AudioSegment.from_mp3(file_src)
def recognition(file_src, file_src2):
with open(file_src, 'rb') as f:
audio = f.read()
sound = pydub.AudioSegment(audio)
sound.export(file_src2, format="wav")
sample_audio = sr.AudioFile(file_src2)
key = sr.recognize_google(sample_audio)
return key
True False
import speech_recognition as sr
import pydub
import os.path
def recognition(file_src, file_src2):
sound = pydub.AudioSegment.from_mp3(file_src)
sound.export(file_src2, format="wav")
sample_audio = sr.AudioFile(file_src2)
key = sr.recognize_google(sample_audio)
return key
print(os.path.isfile('audio5.mp3'), os.path.isfile('test.waw'))
True False
with open(file_src, 'rb') as f:
print(f.readlines())
--onefile
и у вас в папке dist будет один exe со всеми модулями