Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 877575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:37:55+00:00 2026-05-15T11:37:55+00:00

I’m trying to display a lot of unicode text in my curses application. My

  • 0

I’m trying to display a lot of unicode text in my curses application. My development machine is MacOSx 10.6 and I use the default python shipped with Apple.

Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin

When I added unicode text to the screen, the screen all messed up. I tried to Google for solution and other people has suggested to link the _curses module with libncursesw library instead of libncurse library.

I checked my path and I found (see below) in /opt/local/lib

libncurses++.a
libncurses++w.a
libncurses.5.dylib
libncurses.a
libncurses.dylib
libncursesw.5.dylib
libncursesw.a
libncursesw.dylib

How do I check which library my curses module linked to, and how can I link against other library? Is it possible to do it without recompile my Python?


This is kind of embarrassed, but I figure the solution to print unicode properly in my environment. I think at some point time I did install curses libraries from Macports and forgot I have it already.

The problem that the text did not display the first time is because I need to set the locale within my python program. I thought the locale setting would inherit from the shell I’m running, but simply added two lines of code fixed my problem:

import locale
locale.setlocale(locale.LC_ALL,"")

Though, it’s good to know where the python external library lives and how to check them.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:37:56+00:00Added an answer on May 15, 2026 at 11:37 am

    To check which other .sos a .so uses, use otool -L — for example:

    $ otool -L /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_curses.so
    /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_curses.so:
        /Library/Frameworks/Python.framework/Versions/2.6/lib/libncurses.5.dylib (compatibility version 5.0.0, current version 5.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.10)
    

    This is what I have on my Python 2.6.4 install on OSX 10.5 — since you’re using Apple’s own Python on 10.6, the exact location of your _curses.so will be different, just do

    $ python
    >>> import _curses
    >>> _curses.__file__
    

    to see exactly where the _curses.so of interest in, then call otool -L on it.

    Replacing a .so on the system-installed Python seems fraught with danger to me — you could break something and end up having to reinstall the OS, etc. Why not install a Python download from python.org instead?

    Get both the .dmg and the sources for the most recent release of 2.6 (unless you’re so adventurous you want to try a release candidate 2.7;-), then you can install the .dmg (it will go to /usr/local, not overwriting the system Python; set your PATH appropriately in your .bashrc or wherever to have /usr/local/bin in your PATH ahead of /usr/bin), then, if your problem persists, you can rebuild from sources with whatever options you want, and replace the specific _curses.so in the local install, without disturbing the system directory at all (seems most prudent to me…).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am confused How to use looping for Json response Array in another Array.
I am trying to render a haml file in a javascript response like so:
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.