Re: Detecting 64bit vs. 32bit Linux

2006-07-11 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, Robin Becker <[EMAIL PROTECTED]> wrote: >Michael Yanowitz wrote: >.. >> >>> I need to detect whether the operating system I am running on (not the >>> Python version) is 64bit or 32bit. One requirement is that I need to >>> include support for non-Intel/AMD

Re: Detecting 64bit vs. 32bit Linux

2006-07-10 Thread Robert Kern
Michael Yanowitz wrote: > The one thing I observed (just an observation) is that: > a) on 32-bit machines: > sizeof(int) = 32 > sizeof(long) = 32 > b) on 64-bit machines: > sizeof(int) = 32 > sizeof(long) = 64 > > This in C and Python. As I've said previously in this threa

Re: Detecting 64bit vs. 32bit Linux

2006-07-10 Thread Robin Becker
Michael Yanowitz wrote: .. > >> I need to detect whether the operating system I am running on (not the >> Python version) is 64bit or 32bit. One requirement is that I need to >> include support for non-Intel/AMD architectures. > > The standard C way would be to check sizeof(void *). so on t

RE: Detecting 64bit vs. 32bit Linux

2006-07-10 Thread Michael Yanowitz
PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Lawrence D'Oliveiro Sent: Monday, July 10, 2006 3:11 AM To: python-list@python.org Subject: Re: Detecting 64bit vs. 32bit Linux In article <[EMAIL PROTECTED]>, dwelch91 <[EMAIL PROTECTED]> wrote: >I need to detect whether the o

Re: Detecting 64bit vs. 32bit Linux

2006-07-10 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, dwelch91 <[EMAIL PROTECTED]> wrote: >I need to detect whether the operating system I am running on (not the >Python version) is 64bit or 32bit. One requirement is that I need to >include support for non-Intel/AMD architectures. The standard C way would be to che

Re: Detecting 64bit vs. 32bit Linux

2006-07-08 Thread Robert Kern
Jim Segrave wrote: > In article <[EMAIL PROTECTED]>, > dwelch91 <[EMAIL PROTECTED]> wrote: >> I need to detect whether the operating system I am running on (not the >> Python version) is 64bit or 32bit. One requirement is that I need to >> include support for non-Intel/AMD architectures. >> >> T

Re: Detecting 64bit vs. 32bit Linux

2006-07-08 Thread Paul McGuire
"MrJean1" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Try function architecture() from the platform module in Python 2.3 and > 2.4. The first item of the returned tuple shows whether the underlying > system is 64-bit capable. > > Here is what it returns on RedHat Fedora Core 2 Li

Re: Detecting 64bit vs. 32bit Linux

2006-07-08 Thread MrJean1
Try function architecture() from the platform module in Python 2.3 and 2.4. The first item of the returned tuple shows whether the underlying system is 64-bit capable. Here is what it returns on RedHat Fedora Core 2 Linux on Opteron: >>> platform.architecture() ('64bit', 'ELF') >>> platform.unam

Re: Detecting 64bit vs. 32bit Linux

2006-07-08 Thread Jim Segrave
In article <[EMAIL PROTECTED]>, dwelch91 <[EMAIL PROTECTED]> wrote: >I need to detect whether the operating system I am running on (not the >Python version) is 64bit or 32bit. One requirement is that I need to >include support for non-Intel/AMD architectures. > >The 2 ways I have thought detecti

Detecting 64bit vs. 32bit Linux

2006-07-07 Thread dwelch91
I need to detect whether the operating system I am running on (not the Python version) is 64bit or 32bit. One requirement is that I need to include support for non-Intel/AMD architectures. The 2 ways I have thought detecting 64bit are: 1. struct.calcsize("P") == 8 2. '64' in os.uname()[4] I'm