[SciPy-dev] new buld process in CVS
Pearu Peterson
pearu at cens.ioc.ee
Thu Jan 10 11:22:43 CST 2002
On Thu, 10 Jan 2002, eric wrote:
> > In [1]: import os
> > In [2]: print os.environ['DISPLAY']
> > :0.0
> >
> > On a remote telnet session this will cause a KeyError.
> >
> > $ python -c "import os; print os.environ.get('DISPLAY')"
> > None
>
> Good. Thanks. I'll try and work this into the code in the needed places.
However, there must be some better way for that as checking DISPLAY is not
very reliable. For example, one can have DISPLAY variable not set also in
X terminals:
pearu at localhost:~$ python -c "import os;print repr(os.environ.get('DISPLAY'))"
':0.0'
pearu at localhost:~$ unset DISPLAY
pearu at localhost:~$ python -c "import os;print repr(os.environ.get('DISPLAY'))"
None
Regards,
Pearu
More information about the Scipy-dev
mailing list