A simple Python script that translates a string of text into Morse code. The script follows the standard Morse code alphabet, and currently, special characters like @, #, etc., are not supported.
- Python 3.6 or higher installed on your system.
1- Clone this repository or download the project files.
2- Run the Python script to start the application.
python Morse-Code.py
3- Using the script:
- Input the string you want to convert from text to Morse code (without special characters).
- Press Enter, and the script will output the equivalent Morse code.
Type in the text you want to convert into morse code: hello world
Output:
**** * *-** *-** --- / *-- --- *-* *-** -**
morse_alphabet
dictionary: Stores the mapping from text to Morse code.morse_converter
function:- Converts a string to Morse code using list comprehension.
- Handles characters not in the dictionary via error handling (KeyError).
- Returns the final Morse code string.
- User Input: The script prompts the user for input and displays the Morse code output.
This project is open-source and available under the MIT License.
If you have any questions, feel free to reach out to me at yagopais@id.uff.br.