开发者

How do I move printing position up one line in terminal

I'm already aware of using \b and \r to move back one character and to the beginning on the line respectively. But i开发者_StackOverflow社区s there a way, (specifically in python,) to move the cursor position up 1 line? I'm trying to avoid using curses, but if this is the best option then so be it.


The cuu1 capability will give you the sequence you need in order to do so.

echo -e "aa\n$(tput cuu1)b"
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜