How do I determine if my python shell is executing in 32bit or 64bit?

前端 未结 18 1319
北恋
北恋 2020-11-22 04:25

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.<

18条回答
  •  无人共我
    2020-11-22 04:45

    Open python console:

    import platform
    platform.architecture()[0]
    

    it should display the '64bit' or '32bit' according to your platform.

    Alternatively( in case of OS X binaries ):

    import sys
    sys.maxsize > 2**32 
    # it should display True in case of 64bit and False in case of 32bit
    

提交回复
热议问题