On Thu, Sep 22, 2011 at 11:42 AM, Steven D'Aprano <steve+comp.lang.pyt...@pearwood.info> wrote: > I don't understand why some environment variables are not visible from > Python. > > [steve@wow-wow ~]$ echo $LINES $COLUMNS $TERM > 30 140 xterm > [steve@wow-wow ~]$ python2.6 > Python 2.6.6 (r266:84292, Dec 21 2010, 18:12:50) > [GCC 4.1.2 20070925 (Red Hat 4.1.2-27)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> import os >>>> (os.getenv('LINES'), os.getenv('COLUMNS'), os.getenv('TERM')) > (None, None, 'xterm') > >
I have this: $ python Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import os >>> os.getenv('LINES') >>> $ python -S Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56) [GCC 4.4.5] on linux2 >>> import os >>> os.getenv('LINES') '35' >>> I hope it helps narrow things down somewhat. -- regards, kushal -- http://mail.python.org/mailman/listinfo/python-list