-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShipTypeLookUp.py
47 lines (44 loc) · 1.38 KB
/
ShipTypeLookUp.py
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
#!/usr/bin/env python3
import os
if os.name == "nt":
import ctypes
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID('Ship Type LookUp')
shipNames = {
"DD": "Destroyer",
"DE": "Coastal Defense Ship",
"CL": "Light Cruiser",
"CT": "Training Cruiser",
"CLT": "Torpedo Cruiser",
"CA": "Heavy Cruiser",
"CAV": "Aviation Cruiser",
"BB": "Battleship",
"BBV": "Aviation Battleship",
"FBB": "Fast Battleship",
"CVL": "Light Aircraft Carrier",
"CV": "Regular Aircraft Carrier",
"CVB": "Armored Aircraft Carrier",
"SSV": "Submarine Aircraft Carrier",
"SS": "Submarine",
"AV": "Seaplane Tender",
"AS": "Submarine Tender",
"LHA": "Amphibious Assault Ship",
"AO": "Fleet Oiler",
"AR": "Repair Ship"
}
if __name__ == "__main__":
keepGoing = True
while keepGoing:
inp = str(input("Enter the Short or Long Name for the ship type (enter Q to quit)> "))
if inp.upper() == "Q":
keepGoing = False
else:
try:
if len(inp) > 3:
print("{}\n".format(
list(shipNames.keys())[list(shipNames.values()).index(inp.title())]
))
pass
else:
print("{}\n".format(shipNames[inp.upper()]))
except Exception:
print("Not Found\n")