在《python编程:从入门到实践》中。16章16.2.4节获取两个字母的国别码:
书中代码:
from pygal.i18n import COUNTRIES
for country_code in sorted(COUNTRIES.keys()):
print(country_code, COUNTRIES[country_code])
运行报错:
Traceback (most recent call last):
File "D:\Users\……\16章\countries.py", line 1, in <