【问题标题】:Printing special characters in Python [closed]在 Python 中打印特殊字符 [关闭]
【发布时间】:2015-08-14 06:31:37
【问题描述】:

我是一名初学者 Python 程序员,我想使用这个字符:█。我试过只是这样做:print "█" 但我总是出错。我一直在寻找解决方案,但没有发现任何对我有帮助的东西。

【问题讨论】:

标签: python printing character special-characters unique


【解决方案1】:

您可以使用 \uxxxx 表示法打印任何 unicode 符号。例如,2588 是 unicode 块的代码。

 print('\u2588')

【讨论】:

  • 奇怪的是,这只适用于我在 Python 3 中,看起来 OP 正在使用 Python 2。
  • 问题中方式的上下文太少,甚至无法开始回答。
猜你喜欢
  • 2014-07-27
  • 1970-01-01
  • 2021-01-12
  • 2013-08-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-03-01
  • 2015-11-30
相关资源
最近更新 更多