Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
Python + ncurses problem
Results 1 to 7 of 7

Thread: Python + ncurses problem

  1. #1
    absolute
    Guest

    Python + ncurses problem

    How do you display with python+ncurses all those slick looking lines and blocks that you
    can do easily with DOS ?

    I try with
    Code:
    scr.addch(5,5,chr(221))
    (half-thick block) but on the Mandrake 8.0 console I
    get the correct character with white backgroud and black foreground attribute, not the one
    I set. With the 80x25 console I get blinking attribute.

  2. #2

    Re: Python + ncurses problem

    I haven't done any curses programming, but from what I can see this is the site you need.

    http://py-howto.sourceforge.net/curses/node7.html
    If you give a man a fire he'll be warm, if you light the man on fire he'll be warm for life.

  3. #3

    Re: Python + ncurses problem

    This is a rough idea of what the function should look like, atleast in my mind, for which I have just woke up so I could be totally off, especially since I"ve never used curses.

    Code:
    import curses
    
    def main():
       
       stdscr = curses.initscr()
    
       stdscr.start_color()
    
        if stdscr.has_color():
    
           curses.initpair(1, curses.COLOR_RED, 
                               curses.COLOR_WHITE)
           stdscr.addstr(0,0,chr(221),curses.COLOR_PAIR(1))
    
        else:
           print "Sorry your terminal is not capable of displaying\
                  color"
    
    main()
    See if that does anything....I don't know if it will or not! I am at work otherwise I would try it out for ya!

    Aragorn
    If you give a man a fire he'll be warm, if you light the man on fire he'll be warm for life.

  4. #4

    Re: Python + ncurses problem

    Nice to have another Python programmer around here! hehe

    Aragorn
    If you give a man a fire he'll be warm, if you light the man on fire he'll be warm for life.

  5. #5
    absolute
    Guest

    Re: Python + ncurses problem

    well it didn't work Aragorn, could it be Mandrake 8's termcap anomality
    And'bout the py-howto, thx that what exactly what I'm reading while posting this.

    Python still a very cool languange though
    8)

  6. #6

    Re: Python + ncurses problem


    well it didn't work Aragorn, could it be Mandrake 8's termcap anomality
    And'bout the py-howto, thx that what exactly what I'm reading while posting this.

    Python still a very cool languange though
    8)
    Sorry it didn't work. I am not sure what to tell you, I'll look into it some more. I didn't try it on a Linux box yet, but it worked fine in Winblows(only thing I had available to me at the time). I'll toy around with it when I get home and get my Redhat Box set up!

    Aragorn
    If you give a man a fire he'll be warm, if you light the man on fire he'll be warm for life.

  7. #7
    JimH
    Guest

    Re: Python + ncurses problem

    Another link from IBM developer works on Python programming. This one is about programming with Ncurses. Also has some links to more infromation.

    http://www-106.ibm.com/developerwork...l-python6.html

    Jim H

Similar Threads

  1. Python Help
    By jmn0729 in forum Linux - General Topics
    Replies: 1
    Last Post: 11-02-2008, 11:44 AM
  2. Python Tutorials
    By zenmatt in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 10-29-2006, 05:20 PM
  3. Python or C
    By wmartino in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 01-20-2005, 09:06 PM
  4. problems with ncurses
    By seanmclemon in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 12-07-2002, 11:07 PM
  5. Python
    By behnam in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 09-26-2002, 11:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •