Skip to content

This Python program converts normal text to Morse code using a predefined dictionary, offering a simple and efficient text-to-Morse conversion.

License

Notifications You must be signed in to change notification settings

Kishanjaisoorya/Morse-code-convertor-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Morse Code Converter

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.

Usage

  1. Clone this repository to your local machine:

    git clone https://github.com/Kishanjaisoorya/Morse-code-converter-python.git
    
  2. Navigate to the project directory:

    cd morse-code-converter
    
  3. Run the Python script:

    python morse_code_converter.py
    
  4. Enter the text you want to convert to Morse code when prompted.

  5. The program will display the Morse code representation of your input.

Customization

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
}

Example

Input: Hello, World!
Output: .... . .-.. .-.. --- --..-- / .-- --- .-. .-.. -.. -.-.-- 

Feel free to modify and adapt this code for your projects as needed.

License

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.

About

This Python program converts normal text to Morse code using a predefined dictionary, offering a simple and efficient text-to-Morse conversion.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages