Hi,
I want to develop a curses based app. ( new to curses also) and found
urwid.
I have installed the latest urwid release and tried my hand running the
first tutorial . I am getting the following error .
dropalready-lm:python sharadg$ ./urwid_ex.py
Traceback (most recent call last):
File "./urwid_ex.py", line 8, in <module>
rows,cols = ui.get_cols_rows()
File "build/bdist.macosx-10.5-i386/egg/urwid/curses_display.py", line
497, in get_cols_rows
AttributeError: 'NoneType' object has no attribute 'getmaxyx'
Code :
#!/usr/bin/python
import urwid.curses_display
import urwid
import sys
ui = urwid.curses_display.Screen()
cols,rows = ui.get_cols_rows()
print "Row is %d and Cols is %d" %(rows,cols)
def run():
canvas = urwid.TextCanvas("[Hello World]")
ui.draw_screen((20,1),canvas)
while not ui.get_input():
pass
ui.run_wrapper(run)
I have ncurses installed.
dropalready-lm:python sharadg$ uname -a
Darwin dropalready-lm 9.5.0 Darwin Kernel Version 9.5.0: Wed Sep 3
11:29:43 PDT 2008; root:xnu-1228.7.58~1/RELEASE_I386 i386
dropalready-lm:python sharadg$ python
Python 2.5.1 (r251:54863, Apr 15 2008, 22:57:26)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
dropalready-lm:python sharadg$ port installed
ncurses @5.6_0 (active)
ncursesw @5.6_1 (active)
I ran the program from Terminal.app.
When I imported urwid.raw_display instead of curses_display I was able
to get the rows and cols.
What am I doing wrong here ?
Sharad
_______________________________________________
Urwid mailing list
[email protected]
http://lists.excess.org/mailman/listinfo/urwid