hacktoberfest
hacktoberfest copied to clipboard
Update converting user input to speech.py
trafficstars
Key Improvements Window Title: Added a title to the Tkinter window for better context.
Input Validation:
Trimmed the input text using .strip() to remove leading and trailing spaces. Added a check to ensure the user does not submit an empty string. If the input is empty, a warning message is shown using messagebox.showwarning. Output File Format: Changed the output file extension from .mp4 to .mp3, as gTTS typically saves audio files in the MP3 format, which is more widely supported.
String Formatting: Used an f-string for the os.system command for better readability.
Entry Width: Specified a width for the Entry widget to improve the layout.