https://github.com/julian-nash/python-morse-code-translator
A simple Python Morse code translator
https://github.com/julian-nash/python-morse-code-translator
Last synced: 9 months ago
JSON representation
A simple Python Morse code translator
- Host: GitHub
- URL: https://github.com/julian-nash/python-morse-code-translator
- Owner: Julian-Nash
- Created: 2019-04-01T22:19:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-10T02:10:27.000Z (almost 3 years ago)
- Last Synced: 2025-03-24T15:21:46.251Z (9 months ago)
- Language: Python
- Size: 2.93 KB
- Stars: 4
- Watchers: 0
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Simple Python Morse Code translator
Translates text to morse code and morse code to text using a small set of International morse code. Includes a small suite of basic tests.
### Usage
After cloning this repo, run:
```sh
python example.py
```
Output:
```sh
- .... .. ... ... - .-. .. -. --. .... .- ... -... . . -. - .-. .- -. ... .-.. .- - . -.. - --- -- --- .-. ... . -.-. --- -.. . .- -. -.. -... .- -.-. -.- .- --. .- .. -.
this string has been translated to morse code and back again
```
Feel free to change the text in the example. The example calls `translate_morse` using the output of `translate_text`, which is provided with a string.
### Tests
To run the tests:
```sh
python tests.py
```