tempfile and curses (putwin() and getwin())

Matt Garman fake at not-real.bogus
Wed Nov 10 05:43:32 CET 2004


On Fri, 05 Nov 2004 19:50:34 GMT, Matt Garman <fake at not-real.bogus> wrote:
>      addStuffToStdScr()
> 
>      tmpfile = tempfile.TemporaryFile()
>      stdscr.putwin(tmpfile)
> 
>      subWindowRoutine()
> 
>      stdscr = curses.getwin(tmpfile)
>      stdscr.refresh()
> 
>  Then an exception is thrown and I get the following message:
> 
>      stdscr.refresh()
>      _curses.error: refresh() for a pad requires 6 arguments

I figured out that I need to add the following before calling
getwin():

        tmpfile.seek(0)

Which makes sense; that's why it worked when manually creating the
temp file---I closed and re-opened that file between the calls to
putwin() and getwin() (and open() automatically sets the file
position to zero).

One of those things that seem obvious in hindsite :)

Matt

-- 
Matt Garman
email at: http://raw-sewage.net/index.php?file=email



More information about the Python-list mailing list