Hackerss.com

Hackerss.com is a community of amazing hackers

Hackerss is a community for developers, data scientitst, ethical hackers, hardware enthusiasts or any person that want to learn / share their knowledge of any aspect of digital technology.

Create account Log in
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)