Hackerss.com

hackerss
hackerss

Posted on

Python Determine if a python shell is executing in 32bit or 64bit mode on os


import struct

def get_arch():
    """
    Determine if the python interpreter is running in 32bit or 64bit mode.

    Returns
    -------
    str
        Either '32bit' or '64bit'.
    """

    return struct.calcsize("P") * 8
Enter fullscreen mode Exit fullscreen mode

Top comments (0)