如何查看Python的位数
方法一:
如何查看python是32位还是64位:
1 2 | import struct struct.calcsize("P") |
如果是4,说明是32位的;如果是其他的是,64位的。struct.calcsize用于计算格式字符串所对应的结果长度。
方法二:
1 2 3 4 5 6 7 8 9 10 11 | C:\Users\chinasoft_lhrxxt>python Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. C:\Users\chinasoft_lhrxxt>python Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. |