Curses module.

Alex bogus at antispam.com
Tue Jul 15 19:03:33 EDT 2003


Hello all,

I'm trying to learn Python, in particular the curses module. My system 
is running Slackware 9.0 and the verion of Python that comes installed 
with Slackware 9.0 is Python 2.2.2.

I've been trying to access the curses.wrapper module without any 
success. I know that the wrapper exists in /usr/lib/python2.2/curses yet 
any reference that I make to it is rebuffed by the interpreter.

Here's the python script I'm trying to run:

[code]

#!/usr/bin/python
#
# My first attempts at writing a curses interface using python

import curses

def newWindow():
	begin_x = 20 ; begin_y = 7
	height = 5 ; width = 40
	win = curses.newwin(height, width, begin_y, begin_x)
	return

# Pass the function to the curses wrapper

curses.wrapper(newWindow())

[/code]

This is the error message that I get when I try to run the script from 
the CLI:

Traceback (most recent call last):
   File "./curses3.py", line 15, in ?
     curses.wrapper(newWindow())
AttributeError: 'module' object has no attribute 'wrapper'

Any ideas as to what I could be doing wrong?


Alex the Python Newbie





More information about the Python-list mailing list