python IDLE shell似乎没有正确处理一些转义 [英] python IDLE shell appears not to handle some escapes correctly

查看:372
本文介绍了python IDLE shell似乎没有正确处理一些转义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如\b backspace打印为quad(在下面的示例中显示为[])。但是\换行符是OK。

For example \b backspace prints as quad (shown as [] in example below). But \n newline is Ok.

>>> print 'abc\bd'
abc[]d
>>> print 'abc\nd'
abc
d

我在Vista下运行pro),python 2.7

Im running under Vista (pro), python 2.7

我一直试图在这个问题上搜索这个问题,并且无法找到任何相关的东西,这似乎是奇怪的,让我想知道是否有一些设置或其他可能我的设置错了不知道要找什么。

Ive tried googling this issue generally and in SO and cant find anything relevant, which seems odd and makes me wonder if theres some setting or other may be wrong in my setup. Not sure what to look for.

推荐答案




错误或我应该找什么?

是否合理预期退格,特别是工作?

What am I doing wrong or what should I be looking for?
Is it reasonable to expect backspace, specifically, to work?



不,IDLE不支持backspace,返回,也不是formfeed,也不是ANSI转义序列。

No, IDLE does not support backspace, nor carriage-return, nor formfeed, nor ANSI escape sequences.

你期待 \b 将光标移动一个单元格在IDLE的交互式shell窗口左侧。它不这样做IDLE在其shell窗口中不支持光标寻址,除了换行符和tab。

You are expecting \b to move the cursor one cell to the left in IDLE's interactive shell window. It doesn't do that. IDLE does not support cursor addressing in its shell window, with the exception of newline and tab.

这篇关于python IDLE shell似乎没有正确处理一些转义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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