How to detect my OS info?

Mark McEahern marklists at mceahern.com
Wed Feb 26 04:55:46 CET 2003


> 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.

Have you tried:

  import sys
  print sys.platform

// m
-






More information about the Python-list mailing list