python+ncurses: I can't display accents

Carsten Haese carsten at uniqsys.com
Sat Jan 27 03:34:15 EST 2007


On 27 Jan 2007 07:43:59 GMT, Fabrice DELENTE wrote
> Incidentally, I noticed something about the environment: in my 
> script, I use the LINES and COLUMNS environment vars that are set in 
> my shell:
> 
> columns=int(os.environ.get("COLUMNS"))
> lines=int(os.environ.get("LINES"))
> 
> In the shell, I get
> 
> $ echo $LINES $COLUMNS
> 89 199
> 
> but python doesn't get these values. I have to start the script with
> 
> $ LINES=$LINES COLUMNS=$COLUMNS ./sort_entries.py
> 
> How come?

There is a distinction between shell variables and environment variables. In
all likelihood, LINES and COLUMNS are shell variables, not environment
variables. Try "export LINES COLUMNS" to set them as environment variables.

HTH,

Carsten.




More information about the Python-list mailing list