Message12276

Author jeff.allen
Recipients jeff.allen, k870611
Date 2019-01-05.10:38:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1546684709.62.0.698582018488.issue2726@roundup.psfhosted.org>
In-reply-to
Content
You can use this:

>>> import os
>>> os.name
'java'
>>> os._name
'nt'

It is reasonable to say that the "platform" is Java, and so that is what we return as os.name. But many programs actually want to know what the file system is like, so practicality suggests os.name really ought to tell you that. Unfortunately, practicality came too late to change things, but we added os._name to compensate. Portable code looks something like:

if os.name=='nt' or (os.name=='java' and os._name=='nt'):
    # Do windows stuff
History
Date User Action Args
2019-01-05 10:38:29jeff.allensetmessageid: <1546684709.62.0.698582018488.issue2726@roundup.psfhosted.org>
2019-01-05 10:38:29jeff.allensetrecipients: + jeff.allen, k870611
2019-01-05 10:38:29jeff.allenlinkissue2726 messages
2019-01-05 10:38:29jeff.allencreate