[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

What Does sys.platform Return On 64 Bit Windows Systems?

Tim Daneliuk

3/17/2010 9:30:00 PM

On older 32 bit Windows systems, sys.platform returns: 'win32'

What does it return on 64-bit Windows systems? I'd check myself, but
I don't have access to 64-bit Windows.

TIA,

--
----------------------------------------------------------------------------
Tim Daneliuk tundra@tundraware.com
PGP Key: http://www.tundrawar...

2 Answers

Steven D'Aprano

3/17/2010 10:49:00 PM

0

On Wed, 17 Mar 2010 16:30:19 -0500, Tim Daneliuk wrote:

> On older 32 bit Windows systems, sys.platform returns: 'win32'
>
> What does it return on 64-bit Windows systems? I'd check myself, but I
> don't have access to 64-bit Windows.

According to the docs, it returns win32:

http://docs.python.org/librar...

If anyone knows different, this should be reported as a documentation
bug. But 30 seconds of googling suggests that sys.platform is 'win32'
even on 64-bit builds of Windows, by design:

http://stackoverflow.com/questions/2144748/is-it-safe-to-use-sys-platformwin32-check-on-64-...



--
Steven

Christian Heimes

3/17/2010 11:17:00 PM

0

Tim Daneliuk schrieb:
> On older 32 bit Windows systems, sys.platform returns: 'win32'
>
> What does it return on 64-bit Windows systems? I'd check myself, but
> I don't have access to 64-bit Windows.

Do you want to know if the current build of Python is a 32 or 64bit build?

>>> import struct
>>> struct.calcsize("P") * 8
64

Christian