我可以在Python shell中写斜体吗? [英] Can I write italics to the Python shell?

查看:341
本文介绍了我可以在Python shell中写斜体吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以这样写:

>>> text_output = "Hello World."
>>> print text_output

...如果将text_output打印到Python Shell,它会以斜体打印吗?

...where if the text_output is printed to the Python Shell, it is printed in italics?

推荐答案

如果您的控制台支持斜体字.例如 rxvt-unicode 使用

If your console supports italics. Eg rxvt-unicode using ansi escape code

>>> print "\x1B[3mHello World\x1B[23m"

这篇关于我可以在Python shell中写斜体吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆