相关疑难解决方法(0)

(n)python中的curses pad不工作

我似乎无法让ncurses pad在python(2.6,2.7和3.2)中工作.直接使用http://docs.python.org/howto/curses.html上的代码我甚至无法让它工作.非填充代码非常有效.

import curses

def func(scr):
    pad = curses.newpad(100, 100)
    pad.addstr(0,0, "Testing")

    #  Displays a section of the pad in the middle of the screen
    pad.refresh( 0,0, 5,5, 10,10)

    scr.refresh()
    scr.getch()

if __name__ == '__main__':
    curses.wrapper(func)
Run Code Online (Sandbox Code Playgroud)

问题是什么?移除垫(并将垫更换为scr)工作正常

python ncurses

6
推荐指数
1
解决办法
1932
查看次数

如何在python-curses中创建滚动菜单

有一种方法可以在python-curses中创建滚动菜单吗?我有一个记录列表,我从sqlite3中的查询得到,我必须在一个框中显示它们但它们超过最大行数:我可以制作一个小菜单来显示它们而不会使诅咒崩溃吗?

python curses terminal python-curses

4
推荐指数
1
解决办法
4889
查看次数

如何删除python中的诅咒窗口并恢复后台窗口?

地狱男人,我正在研究python curses,我的初始窗口有initscr(),我创建了几个新的窗口来重叠它,我想知道我是否可以删除这些窗口并恢复标准屏幕而不必补充它.有办法吗?我也可以问一下是否有人可以告诉我窗口,子窗口,垫和子垫之间的区别.

我有这个代码:

stdscr = curses.initscr()
####Then I fill it with random letters
stdscr.refresh()
newwin=curses.newwin(10,20,5,5)
newwin.touchwin()
newwin.refresh()

####I want to delete newwin here so that if I write stdscr.refresh() newwin won't appear

stdscr.touchwin()
stdscr.refresh()

####And here it should appear as if no window was created.
Run Code Online (Sandbox Code Playgroud)

python curses window

2
推荐指数
1
解决办法
6463
查看次数

标签 统计

python ×3

curses ×2

ncurses ×1

python-curses ×1

terminal ×1

window ×1