Spaces:
Running
Running
File size: 448 Bytes
d8f7e3d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
from collections import OrderedDict
lang_codes = OrderedDict()
with open("lang_code.txt", "r") as file:
for line in file:
line = line.strip()
if line.startswith("----"):
continue
iso, lang = line.split("\t", 1)
lang_codes[lang + "(" + iso + ")"] = iso
# print(lang_codes)
print(len(lang_codes))
language_names = list(lang_codes.keys())
print(language_names)
print(lang_codes[language_names[0]])
|