简体   繁体   中英

Printing a calendar with Chinese characters in Month and day using Python

Below is my code:

import calendar

chinese = calendar.LocaleTextCalendar(6, "CHINESE")

chinese.pryear(2016)

The calendar printed out is not able to display the month and day in Chinese characters.

chinese = calendar.LocaleTextCalendar(6, "zh_CN.UTF-8")

CHINESE is not local set, you should serve a correct local, zh_CN.UTF-8 will work. Good luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM