How to detect my OS info?
Peter Wu
peterwu at hotmail.com
Wed Feb 26 21:38:10 EST 2003
>>>>> "Mark" == Mark McEahern <marklists at mceahern.com> writes:
>> I use Windows and FreeBSD interchangeably. I want to write a
>> .signature script that can detect my OS respectively.
>>
>> Under FreeBSD, I can fire 'uname -rs' to get the information I need
>> and under Windows, I may need to leverage 'ver' to get the info.
>>
>> Is there a one-stop solution from Python? I mean I just write one
>> python script and it can work both on Windows and FreeBSD? Thanks.
Mark> Have you tried:
Mark> import sys print sys.platform
Under FreeBSD, it reports 'freebsd4';
Under Win32, it reports 'win32'.
How can I have more detailed information, such as version?
--
Peter Wu
More information about the Python-list
mailing list