Re: Environment variables not visible from Python

2011-09-22 Thread Peter Pearson
On Thu, 22 Sep 2011 09:21:59 +0200, Thomas Rachel wrote: [snip] > $ python -c 'import os; print "\n".join(sorted("%s=%s" % (k,v) for k,v > in os.environ.iteritems()))' | diff -u - <(env|LANG=C sort) [standing ovation] -- To email me, substitute nowhere->spamcop, invalid->net. -- http://mail.py

Re: Environment variables not visible from Python

2011-09-22 Thread Ben Finney
Thomas Rachel writes: > Am 22.09.2011 12:16 schrieb Ben Finney: > > -- > > \ “As far as the laws of mathematics refer to reality, they are | > >`\not certain, and as far as they are certain, they do not refer | > > _o__) to reality.” —Albert Einstein, 1

Re: Environment variables not visible from Python

2011-09-22 Thread Thomas Rachel
Am 22.09.2011 12:16 schrieb Ben Finney: -- \ “As far as the laws of mathematics refer to reality, they are | `\not certain, and as far as they are certain, they do not refer | _o__) to reality.” —Albert Einstein, 1983 | Ben Finney So, he said what in

Re: Environment variables not visible from Python

2011-09-22 Thread Steven D'Aprano
Ben Finney wrote: > Steven D'Aprano writes: > >> I don't understand why some environment variables are not visible from >> Python. > > Not all variables are environment variables. Variables only become > environment variables if exported to the environment; the ‘export’ > command is one way to

Re: Environment variables not visible from Python

2011-09-22 Thread Ben Finney
Steven D'Aprano writes: > I don't understand why some environment variables are not visible from > Python. Not all variables are environment variables. Variables only become environment variables if exported to the environment; the ‘export’ command is one way to do that. -- \ “As far a

Re: Environment variables not visible from Python

2011-09-22 Thread Thomas Rachel
Am 22.09.2011 08:12 schrieb Steven D'Aprano: 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-

Re: Environment variables not visible from Python

2011-09-21 Thread Hegedüs , Ervin
hello, On Thu, Sep 22, 2011 at 06:12:01AM +, Steven D'Aprano 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:1

Re: Environment variables not visible from Python

2011-09-21 Thread Kushal Kumaran
On Thu, Sep 22, 2011 at 11:42 AM, Steven D'Aprano 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.

Environment variables not visible from Python

2011-09-21 Thread Steven D'Aprano
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", "cred