ncurses programming

S

Sinan Nalkaya

hi, i want to use ncurses library in python i`ve found proper library
for that, PyNcurses.
then i searched for some documentation about ncurses programming, i only
found that web site ;
http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/
this howto is nice but seems to me, this is for experienced ncurses
programmers who have just migrated to python so i dont understand
anything from examples and howto. what should i do ? firstly should i
learn ncurses programmin on C then migrate to python?
thanks.
 
N

ncf

I don't know too much about (n)curses, but I feel that it's worth
pointing out that Python has a (built-in?) module named `curses` that
supports ncurses as of Python version 1.6.

I don't think it'd be necessary to learn how to use ncurses in C first,
though. The Python docs for the curses module is pretty straight
forward, and they link to what I feel is a pretty good tutorial on the
module.

Py Docs: http://docs.python.org/lib/module-curses.html
Tutorial: http://www.python.org/doc/howto/curses/curses.html

Also, if you choose to take the Python module route, you might want to
consider using the curses.wrapper module to ensure that if any errors
happen, it will close out curses all of the way instead of allowing
curses to screw up your console window.

Wish I could be of more help. Any questions and I'll gladly look into
it to the best of my abilities.

-Wes
 
N

ncf

I don't know too much about (n)curses, but I feel that it's worth
pointing out that Python has a (built-in?) module named `curses` that
supports ncurses as of Python version 1.6.

I don't think it'd be necessary to learn how to use ncurses in C first,
though. The Python docs for the curses module is pretty straight
forward, and they link to what I feel is a pretty good tutorial on the
module.

Py Docs: http://docs.python.org/lib/module-curses.html
Tutorial: http://www.python.org/doc/howto/curses/curses.html

Also, if you choose to take the Python module route, you might want to
consider using the curses.wrapper module to ensure that if any errors
happen, it will close out curses all of the way instead of allowing
curses to screw up your console window.

Wish I could be of more help. Any questions and I'll gladly look into
it to the best of my abilities.

-Wes
 
G

Grant Edwards

hi, i want to use ncurses library in python i`ve found proper
library for that, PyNcurses. then i searched for some
documentation about ncurses programming, i only found that web
site ; http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/
this howto is nice but seems to me, this is for experienced
ncurses programmers who have just migrated to python so i dont
understand anything from examples and howto. what should i do
? firstly should i learn ncurses programmin on C then migrate
to python? thanks.

Here's an introductory page:

http://gnosis.cx/publish/programming/charming_python_6.html

If what you want to do is fairly simple. the "newt" libarary
might worth looking at. It's very light-weight, easy to use,
and has a bunch of built-in widget types (text entry boxes,
radio buttons, progress bars, message boxes, etc). It's main
restriction when compated to something like ncurses/forms is
that newt's windows are "stacked" and the user can only
interact with the top one.

Newt was originally developed by RedHat for their text-mode
installer and sysadmin tools that were written in Python.

The documents are a bit sparse and sometimes out-of-date, but
there are a few decent example programs in the source distro.

The Python newt library module is called "snack", so be careful
not to get get confused with the sound library of the same name.

It's available for most Linux distros and requires the "slang"
library.

If your distro doesn't have a pre-built newt library you can
get it from here:

http://www.python.org/pyvault/SRPMS/repodata/repoview/newt-0-0.52.0-3.html
 
G

Grant Edwards

On 2005-09-26 said:
Could it be that ncurses doesn't work on Windows? At least, it
didn't last time I looked. There was a curses library for
Windows, but you'll have to google for it.

I think there used to be something called pdcurses that
supposedly worked under windows. That was quite a while ago, I
never tried it, and I may be misremembering the name.

I've no idea if there was a pdcurses module for python.
 
G

Grant Edwards

S

Sinan Nalkaya

thank you very much for your suggestions and links, also slang got my
attention.
thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,264
Messages
2,571,323
Members
48,006
Latest member
TerranceCo

Latest Threads

Top