Python 学习(一) 32位还是64位
2016-10-29 23:25
323 查看
打开Python看到如下信息:
第三种解释:
如何查看python是32位还是64位:参见 :http://blog.csdn.net/waleking/article/details/7566842
import struct
struct.calcsize("P")
如果是4,说明是32位的;如果是其他的是,64位的。struct.calcsize用于计算格式字符串所对应的结果长度。
Python 2.7(r27:82525,Jul 42010, 07:43:08)[MSC v.150064 bit (AMD64)] on win32Type"help","copyright","credits" or"license" for more information.
>>> import sys, platform
>>> platform.architecture()
('64bit','WindowsPE')
>>> sys.maxint2147483647
总是有些疑惑:我的python到底是32位还是64位呢?解释各不相同,
<code><span class="pun">第一种解释:<span class="pun"><span style="font-family:Arial;">I've installed Python 2.7 from the python-2.7.amd64.msi package from python.org. It installs and runs correctly, but seems to be in 32-bit mode, despite the fact that the installer was a 64 bit installer.参见:<a target=_blank target="_blank" href="http://stackoverflow.com/questions/3411079/why-does-the-python-2-7-amd-64-installer-seem-to-run-python-in-32-bit-mode%E3%80%82">http://stackoverflow.com/questions/3411079/why-does-the-python-2-7-amd-64-installer-seem-to-run-python-in-32-bit-mode。</a></span></span></span></code>
<code><span class="pun"><span class="pun"><span style="font-family:Arial;"><span style="font-family:Courier New;">系统仍然维持了一个sys<span class="pun">.</span><span class="pln">maxint的变量,值为 </span><span class="lit">2147483647。但是并不一定说这个python就是32位的。</span></span></span></span></span></code>
<code><span class="pun"><span class="pun"><span style="font-family:Arial;">第二种解释:</span></span></span></code>
<code><span class="pun">Python 2.7: Python的版本是2.7的</span></code>
<code><span class="pun">Win32 -> 指的就是Windows系统;</span></code>
<code><span class="pun">64 bit- > 指的是Windows是64位的;</span></code>
<code><span class="pun">AMD64 -> 指的就是 CPU是x64的</span><span class="pln"> </span></code>
第三种解释:
如何查看python是32位还是64位:参见 :http://blog.csdn.net/waleking/article/details/7566842
import struct
struct.calcsize("P")
如果是4,说明是32位的;如果是其他的是,64位的。struct.calcsize用于计算格式字符串所对应的结果长度。
相关文章推荐
- Python 学习(一) 32位还是64位
- Solaris如何确定安装的Python是32位还是64位
- 查看python是32位还是64位
- 如何查看Python是32位还是64位
- 怎么查看python是32位还是64位的
- python 查看32位还是64位的
- python查看是32位还是64位版本
- Linux学习笔记——查询系统是32位还是64位
- 查看python是32位的还是64位的
- python判断windows系统是32位还是64位的方法
- 64位Windows系统,32位Python, 判断系统是32位还是64位
- 如何判断安装的python是64位还是32位?
- python查看是32位还是64位版本
- java学习-【转】32位jvm还是64位jvm?
- python判断windows系统是32位还是64位的方法
- 学习windows驱动(32位与64位兼容)
- 如何查询centos查看系统内核版本,系统版本,32位还是64位
- 判断Machine到底是32位还是64位的方法
- Anaconda conda 32位python2.7与64位python3+共存 常见命令
- 查看Linux是32位还是64位