小编Fil*_*ila的帖子

使用 utf-8 字符作为诅咒边框

我不能使用\xe2\x96\x88字符来诅咒边界。

\n

代码示例:

\n
import curses\n\nstdscr = curses.initscr()\nc = \'\xe2\x96\x88\'\nstdscr.border(c, c, c, c, c, c, c, c)\nstdscr.getch()\n
Run Code Online (Sandbox Code Playgroud)\n

我收到此错误:

\n
\n

溢出错误:字节不适合 chtype

\n
\n

不过我可以用来addstr写一些 utf-8 字符,如下所示:

\n
stdscr.addstr(0, 0, "\xe2\x96\x88")\n
Run Code Online (Sandbox Code Playgroud)\n

感谢您的帮助。

\n

python gnome-terminal python-3.x python-curses ubuntu-18.04

4
推荐指数
1
解决办法
2039
查看次数