python - Case-insensitive language-to-iso code? -


is there way simplify following:

>>> pycountry.languages.get(name='english') traceback (most recent call last):   file "<stdin>", line 1, in <module>   file "/library/python/2.7/site-packages/pycountry/db.py", line 114, in     return self.indices[field][value] keyerror: 'english' >>> pycountry.languages.get(name='english') traceback (most recent call last):   file "<stdin>", line 1, in <module>   file "/library/python/2.7/site-packages/pycountry/db.py", line 114, in     return self.indices[field][value] keyerror: 'english' >>> pycountry.languages.get(name='english') <pycountry.db.language object @ 0x1096374d0> 

in above, 'english' item doesn't result in exception.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

html - href attribute breaking an element -

html - How can i make an element from a bottom stacking context stays in front of another higher stacking context? -