擅长:python、mysql、java
<p>我不认为这是一个特定于Python的问题。在运行64位操作系统时,Windows确实有32位进程的有趣之处。在这种情况下,运行32位python时,Windows可能会将C:\ Windows\SysWOW64\的内容显示为system32。SysWOW64包含用于32位兼容层的各种Windows组件的32位版本。</p>
<p>以下是在Windows 7 x64系统上运行的;explorer.exe(在本例中是64位)肯定会显示这些文件夹的不同内容,但是:</p>
<pre><code>Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import os
>>>
>>> s32 = set(os.listdir('C:/Windows/System32'))
>>> s64 = set(os.listdir('C:/Windows/SysWOW64'))
>>> s32-s64 # the difference is an empty set!
set([])
</code></pre>