Skip to content

Instantly share code, notes, and snippets.

@rdapaz
Created February 11, 2021 00:30
Show Gist options
  • Save rdapaz/1c7db6ee1e9b88da4a3fdc685ca2a850 to your computer and use it in GitHub Desktop.
Save rdapaz/1c7db6ee1e9b88da4a3fdc685ca2a850 to your computer and use it in GitHub Desktop.
Clever data munging with hashes
abbrevs = [
'STP',
'TCP',
'TI',
'USB',
'UTP',
'VLAN',
'VLANs',
'VM',
'VMs',
'VPN',
]
defns = """
ACL|Access Control List
BIA|Business Impact Assessment
BoD|Basis of Design
""".splitlines()
defns = {x:y for x, y in [r.split('|') for r in defns if len(r) > 0]}
y = {x: defns.get(x, '') for x in abbrevs}
for k, v in y.items():
print(k, v, sep="|")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment