How do I detect if Python is running as a 64-bit application? [duplicate]

import platform
platform.architecture()

From the Python docs:

Queries the given executable (defaults
to the Python interpreter binary) for
various architecture information.

Returns a tuple (bits, linkage) which
contain information about the bit
architecture and the linkage format
used for the executable. Both values
are returned as strings.

Leave a Comment