简体   繁体   中英

Python - Printing unicode to console window with WConio

I'm writing a terminal game in python. It has a map loader function, normally it works fine when I use regular characters in the map. (abcdefg) but when I use something like █, and save the map as 'ansi', it renders it as a half solid. When I change the encoding to unicode, the display is scrambled with output such as ^a^a^a^a^a and the like. When I save it as unicode big endian or unicode little endian, it doesn't display the map at all. I'm wondering what's going on. Can anyone help, or am I posting this in the wrong section?

您可以做的是使用: x=ord(character)这将允许您获取ASCII值,然后您可以使用: print chr(x) ,它应该为您提供所需的字符。

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