I need a way to tell what mode the shell is in from within the shell.
While I'm primarily an OS X user, I'd be interested in knowing about other platforms as well.
I've tried looking at the platform module but it seems only to tell you about "about the bit architecture and the linkage format used for the executable": the binary is compiled as 64bit though (I'm running on OS X 10.6) so it seems to always report 64bit even though I'm using the methods described here to force 32bit mode).
Best Answer
One way is to look at
sys.maxsize
as documented here:sys.maxsize
was introduced in Python 2.6. If you need a test for older systems, this slightly more complicated test should work on all Python 2 and 3 releases:BTW, you might be tempted to use
platform.architecture()
for this. Unfortunately, its results are not always reliable, particularly in the case of OS X universal binaries.