例如,我在第一行有一个字符串“Hello world”。
我怎样才能把它移到第二行呢
ps:我知道我可以使用这样的代码:
import curses
stdscr = initscr()
stdscr.adstr(x,y,"Hello World")
y += 1
stdscr.erase()
stdscr.adstr(x,y,"Hello World")
stdscr.getch()
但是在这个“Hello World”下我有很多上下文,我想找到一种只移动或删除“Hello World”的方法。我该怎么做?在
Tags:
使用^{} :
顺便说一句,}。在
addstr
的参数是y, x, str
,而不是{见Demo
如果文本只有一行,则可以使用^{} 函数从光标开始删除整行:
或者,您可以使用^{} 函数插入一整行空白:
^{pr2}$相关问题 更多 >
编程相关推荐