Last active
November 9, 2019 09:05
-
-
Save gsscoder/a966a477ed747484a0545cba3fd5e379 to your computer and use it in GitHub Desktop.
Script to turn languages code into part of a regex
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
# file URL: https://raw.githubusercontent.com/gsscoder/test-data/master/language-codes-3b2.csv | |
buf = '' | |
with open('language-codes-3b2.csv') as csv: | |
data = csv.readlines() | |
for d in data[1:]: | |
langs = d.split(',') | |
buf += f'{langs[0].upper()}|{langs[1].upper()}|' | |
print(buf) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment