[Python-talk] recognizing XP systems
Ray Cote
rgacote at AppropriateSolutions.com
Mon Apr 17 14:39:56 EDT 2006
Try platform.uname()
Returns a tuple, third element of which says 'XP' and fourth element
of which is 5.1.2600 (at least on my machine).
--Ray
At 12:31 PM -0400 4/17/06, hewitt_tech wrote:
>I should have been more specific in my response. The os.uname method
>was unavailable so I used os.name which returned 'nt' on my XP Pro
>system. I'm assuming that the os module varies depending on the base
>platform since uname is a common UNIX function available in the C
>runtime library.
>
>-Alex
>
>----- Original Message ----- From: "Bill McGonigle" <bill at bfccomputing.com>
>To: "Bill Sconce" <sconce at in-spec-inc.com>
>Cc: "Python - Live Free or Die" <python-talk at dlslug.org>
>Sent: Monday, April 17, 2006 11:21 AM
>Subject: Re: [Python-talk] recognizing XP systems
>
>>On Apr 14, 2006, at 16:55, Bill Sconce wrote:
>>
>>>Hm. Tougher than it looks.
>>>
>>>The Library Reference and MartelliBible (the Nutshell) both say you'll
>>>get 'nt'. The Nutshell says specifically, "'nt' (all kinds of 32-bit
>>>Windows platforms)" (p 172).
>>
>>interestingly on Win2K3 I don't get a result for os.uname(). Other
>>os. methods work OK.
>>
>>os.name gives 'nt'
>>sys.platform gives 'win32'
>>platform.platform() gives 'Microsoft-Windows-32bit-WindowsPE'
>>
>>-----
>>Bill McGonigle, Owner Work: 603.448.4440
>>BFC Computing, LLC Home: 603.448.1668
>>bill at bfccomputing.com Cell: 603.252.2606
>>http://www.bfccomputing.com/ Page: 603.442.1833
>>Blog: http://blog.bfccomputing.com/
>>VCard: http://bfccomputing.com/vcard/bill.vcf
>>
>>_______________________________________________
>>Python-talk mailing list
>>Python-talk at dlslug.org
>>http://dlslug.org/mailman/listinfo/python-talk
>>
>
>_______________________________________________
>Python-talk mailing list
>Python-talk at dlslug.org
>http://dlslug.org/mailman/listinfo/python-talk
--
Raymond Cote
Appropriate Solutions, Inc.
PO Box 458 ~ Peterborough, NH 03458-0458
Phone: 603.924.6079 ~ Fax: 603.924.8668
rgacote(at)AppropriateSolutions.com
www.AppropriateSolutions.com
More information about the Python-talk
mailing list