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.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to