-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnato_coder_sound.py
More file actions
47 lines (42 loc) · 1.06 KB
/
nato_coder_sound.py
File metadata and controls
47 lines (42 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import winsound
nato_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' : 'X-ray',
'Y' : 'Yankee',
'Z' : 'Zulu',
' ' : 'Space'
}
print('Welcome to the NATO coder app with sound. Please, enter the word or words to code in NATO phonetic alphabet. Then, press ENTER')
input = input()
print('....................................................................................................')
input = input.upper()
for ch in range(len(input)):
key = input[ch]
print(nato_codes[key])
if key == ' ':
sound = ('sounds/silence.wav')
else:
sound = ('sounds/' + key + '.wav')
winsound.PlaySound(sound, winsound.SND_NOSTOP)