ncurses programming

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sinan Nalkaya

    #1

    ncurses programming

    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 ;

    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.


  • ncf

    #2
    Re: ncurses programming

    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

    Comment

    • ncf

      #3
      Re: ncurses programming

      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

      Comment

      • Torsten Bronger

        #4
        Re: ncurses programming

        Hallöchen!

        "ncf" <nothingcanfulf ill@gmail.com> writes:
        [color=blue]
        > [...]
        >
        > Py Docs: http://docs.python.org/lib/module-curses.html[/color]

        This document suggests that Python+ncurses won't work on windows.
        What's the reason for this?

        Tschö,
        Torsten.

        --
        Torsten Bronger, aquisgrana, europa vetus ICQ 264-296-646

        Comment

        • Grant Edwards

          #5
          Re: ncurses programming

          On 2005-09-26, Sinan Nalkaya <erchamion.bere n@gmail.com> wrote:
          [color=blue]
          > 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.[/color]

          Here's an introductory page:



          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:



          --
          Grant Edwards grante Yow! Imagine--a WORLD
          at without POODLES...
          visi.com

          Comment

          • Mike Meyer

            #6
            Re: ncurses programming

            Torsten Bronger <bronger@physik .rwth-aachen.de> writes:
            [color=blue]
            > Hallöchen!
            >
            > "ncf" <nothingcanfulf ill@gmail.com> writes:
            >[color=green]
            >> [...]
            >>
            >> Py Docs: http://docs.python.org/lib/module-curses.html[/color]
            >
            > This document suggests that Python+ncurses won't work on windows.
            > What's the reason for this?[/color]

            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.

            <mike
            --
            Mike Meyer <mwm@mired.or g> http://www.mired.org/home/mwm/
            Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

            Comment

            • Grant Edwards

              #7
              Re: ncurses programming

              On 2005-09-26, Mike Meyer <mwm@mired.or g> wrote:
              [...][color=blue][color=green][color=darkred]
              >>> Py Docs: http://docs.python.org/lib/module-curses.html[/color]
              >>
              >> This document suggests that Python+ncurses won't work on windows.
              >> What's the reason for this?[/color]
              >
              > 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.[/color]

              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.

              --
              Grant Edwards grante Yow! I will SHAVE and
              at buy JELL-O and bring my
              visi.com MARRIAGE MANUAL!!

              Comment

              • Grant Edwards

                #8
                Re: ncurses programming

                On 2005-09-26, Grant Edwards <grante@visi.co m> wrote:[color=blue]
                > On 2005-09-26, Mike Meyer <mwm@mired.or g> wrote:
                > [...][color=green][color=darkred]
                >>>> Py Docs: http://docs.python.org/lib/module-curses.html
                >>>
                >>> This document suggests that Python+ncurses won't work on windows.
                >>> What's the reason for this?[/color]
                >>
                >> 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.[/color]
                >
                > 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.[/color]


                [color=blue]
                > I've no idea if there was a pdcurses module for python.[/color]

                Apparently there was at one time:



                A more recent reference:



                --
                Grant Edwards grante Yow! I wish I was a
                at sex-starved manicurist
                visi.com found dead in the Bronx!!

                Comment

                • Torsten Bronger

                  #9
                  Re: ncurses programming

                  Hallöchen!

                  Grant Edwards <grante@visi.co m> writes:
                  [color=blue]
                  > On 2005-09-26, Mike Meyer <mwm@mired.or g> wrote:
                  > [...][color=green][color=darkred]
                  >>>> Py Docs: http://docs.python.org/lib/module-curses.html
                  >>>
                  >>> This document suggests that Python+ncurses won't work on windows.
                  >>> What's the reason for this?[/color]
                  >>
                  >> 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.[/color]
                  >
                  > I think there used to be something called pdcurses that
                  > supposedly worked under windows.[/color]

                  Wouldn't http://gnuwin32.sourceforge.net/packages/ncurses.htm be a
                  good starting point?

                  Tschö,
                  Torsten.

                  --
                  Torsten Bronger, aquisgrana, europa vetus ICQ 264-296-646

                  Comment

                  • Sinan Nalkaya

                    #10
                    Re: ncurses programming

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

                    Comment

                    Working...