This is a Python program that creates a graphical user interface (GUI) using the tkinter module. The GUI is an English to Morse code translator.
The program defines a dictionary MORSE_CODE_DICT that contains the Morse code translations for letters, numbers, and some punctuation. It then defines a function translate_to_morse that takes a string input and returns the Morse code translation of that input. The function uses the MORSE_CODE_DICT dictionary to look up the Morse code for each character in the input string. If the character is not in the dictionary (e.g., a space), it is left as is in the Morse code translation.
The program also defines two functions for handling translation and clearing the input and output boxes, respectively. The translation function gets the input text from the input box, calls the translate_to_morse function to get the Morse code translation, and inserts the translation into the output box. The clear function deletes the contents of the input and output boxes.
The program then creates a tkinter GUI window with a title, size, and background color. It creates an input box, an output box, and two buttons for translating and clearing the input and output boxes. The program then starts the tkinter event loop to display the GUI window and handle user interactions with the input and output boxes and buttons.
.py link:
https://mega.nz/file/D7ZRWLoI#t-aH22O...