请问有哪位用过python3的curses模块的吗?为什么该模块输出中文会乱码,如何解决?上网查了很多的方法,都是说要添加
import locale
locale.setlocale(locale.LC_ALL, "")
code = locale.getpreferredencoding()
但是添加后并不能解决问题.
具体代码:
cmd交互模式下
>>>import locale
>>>locale.setlocale(locale.LC_ALL, "")
>>>code = locale.getpreferredencoding()
>>>sc=curses.initscr()
>>>curses.cbreak()
>>>curses.start_color()
>>> sc.addstr(20, 10, "一二三", curses.color_pair(1))
>>> sc.refresh()
#OutPut
涓€浜屼笁>>>
希望有使用过的人过来指点一二,谢谢。