This Python program converts regular text into Morse code. It utilizes a dictionary to map letters, numbers, and spaces to their Morse code equivalents. This is a simple and efficient tool for encoding text in Morse code.
-
Clone this repository to your local machine:
git clone https://github.com/Kishanjaisoorya/Morse-code-converter-python.git
-
Navigate to the project directory:
cd morse-code-converter
-
Run the Python script:
python morse_code_converter.py
-
Enter the text you want to convert to Morse code when prompted.
-
The program will display the Morse code representation of your input.
You can customize the Morse code dictionary in the morse_code_dict
variable within the morse_code_converter.py
file to add support for additional characters or special symbols.
# Define a dictionary that maps characters to Morse code
morse_code_dict = {
'A': '.-', 'B': '-...', ...,
' ': ' ', # Add custom mappings here
}
Input: Hello, World!
Output: .... . .-.. .-.. --- --..-- / .-- --- .-. .-.. -.. -.-.--
Feel free to modify and adapt this code for your projects as needed.
This project is licensed under the MIT License.
Remember to replace `"Kishanjaisoorya"` in the clone command with your actual GitHub username and ensure you have a `LICENSE` file with the appropriate license text in your repository.