determine 32 or 64 bit architecture with python 2.2

K

Kai Rosenthal

Hello,
how can I determine the architecture (32 or 64bit) with python 2.2 on
Windows or Unix (AIX, Solaris) OS, without the modul platform?
Thanks for your hints, Kai
 
J

John Machin

Hello,
how can I determine the architecture (32 or 64bit) with python 2.2 on
Windows or Unix (AIX, Solaris) OS, without the modul platform?
Thanks for your hints, Kai

What happens when you fire up a 64-bit Python and type
import sys; sys.maxint
at it?
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Kai said:
how can I determine the architecture (32 or 64bit) with python 2.2 on
Windows or Unix (AIX, Solaris) OS, without the modul platform?

On Windows, the architecture is always 32-bit, as Python 2.2 does not
support Win64. On Unix, looking for sys.maxint is enough for AIX
and Solaris.

Regards,
Martin
 
E

Evan Klitzke

Hello,
how can I determine the architecture (32 or 64bit) with python 2.2 on
Windows or Unix (AIX, Solaris) OS, without the modul platform?
Thanks for your hints, Kai

For Unix systems you can probably use os.uname() and check what
architecture the kernel is built for. For example,

evan@thinkpad ~ $ python -c 'import os; print os.uname()[4]'
i686

As you can see, I'm on a 32 bit system.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top