Created
February 22, 2010 13:32
-
-
Save slubman/311067 to your computer and use it in GitHub Desktop.
Convert a word or a phrase to NATO phonetic alphabet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
codes = { | |
'a' : "Alpha", | |
'b' : "Bravo", | |
'c' : "Charlie", | |
'd' : "Delta", | |
'e' : "Echo", | |
'f' : "Foxtrot", | |
'g' : "Golf", | |
'h' : "Hotel", | |
'i' : "India", | |
'j' : "Juliet", | |
'k' : "Kilo", | |
'l' : "Lima", | |
'm' : "Mike", | |
'n' : "November", | |
'o' : "Oscar", | |
'p' : "Papa", | |
'q' : "Quebec", | |
'r' : "Romeo", | |
's' : "Sierra", | |
't' : "Tango", | |
'u' : "Uniform", | |
'v' : "Victor", | |
'w' : "Whisky", | |
'x' : "XRay", | |
'y' : "Yankee", | |
'z' : "Zulu", | |
'0' : "Zero", | |
'1' : "One", | |
'2' : "Two", | |
'3' : "Three", | |
'4' : "Four", | |
'5' : "Five", | |
'6' : "Six", | |
'7': "Seven", | |
'8' : "Eight", | |
'9' : "nine" | |
} | |
print "Traduction de \"%s\"" % sys.argv[1] | |
for lettre in sys.argv[1].lower(): | |
if lettre in codes: | |
print codes[lettre] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment