L
L
Lumus2022-03-17 08:11:41
Python
Lumus, 2022-03-17 08:11:41

When you run the exe, it immediately crashes, although there is an input () how to fix it?

I compile the file in the py extension to exe and when the exe is launched , it immediately crashes, although there is a input()way to fix it?

<br>
import time<br>
from os import *<br>
import playsound<br>
import pyttsx3<br>
import speech_recognition as sr<br>
speak_engine = pyttsx3.init()<br>
def speak(what):<br>
    print(what)<br>
    speak_engine.say(what)<br>
    speak_engine.runAndWait()<br>
    speak_engine.stop()<br>
def my_alarm():<br>
    speak("На сколько минут ставим будильник")<br>
    r1 = sr.Recognizer()<br>
    with sr.Microphone(device_index=1) as source:<br>
        s = r1.listen(source)<br>
    voice1 = r1.recognize_google(s, language="ru-RU").lower()<br>
    time.sleep(int(voice1)*60)<br>
    playsound.playsound('C:\\Users\\'+str(getlogin())+'\\Desktop\\Music\\Imagine Dragons - Believer.mp3')<br>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lumus, 2022-03-19
@Lumus

As it turned out, I just wrote functions and I don’t call them anywhere, so the program in the exe does not output anything

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question