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 -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -