os.name
Emile van Sebille
emile at fenx.com
Fri Jul 30 20:59:02 EDT 1999
<oops...>
Well, now both 95 and 98 say:
>>> import os
>>> os.environ['OS']
Traceback (innermost last):
File "<pyshell#1>", line 1, in ?
os.environ['OS']
File "D:\Program Files\Python\Lib\os.py", line 247, in __getitem__
return self.data[string.upper(key)]
KeyError: OS
>>>
I've-got-to-get-a-bigger-monitor-for-1600x1200-ly yr's
--
Emile van Sebille
emile at fenx.com
-------------------
Fredrik Lundh <fredrik at pythonware.com> wrote in message
news:001e01beda8e$2111d2e0$f29b12c2 at secret.pythonware.com...
> Emile van Sebille <emile at fenx.com> wrote:
> > >>> os.name
> > 'nt'
> > >>> os.environ('OS')
> > Traceback (innermost last):
> > File "<pyshell#8>", line 1, in ?
> > os.environ('OS')
> > AttributeError: no __call__ method defined
>
> Gordon asked you to try os.environ['OS'],
> not os.environ('OS') ;-)
>
> </F>
>
More information about the Python-list
mailing list