[Tutor] why does platform.architecture default to sys.executable?

eryksun eryksun at gmail.com
Sun Oct 27 00:45:11 CEST 2013


On Sat, Oct 26, 2013 at 12:39 PM, Albert-Jan Roskam <fomcl at yahoo.com> wrote:
>
> Why does the "executable" parameter default to sys.executable?

In general platform.architecture() parses the output of the UNIX
"file" command. But on Windows the linkage is hard coded to
'WindowsPE', and bits is the default value calculated from the pointer
size in the current process (i.e. python.exe). Use ctypes or PyWin32
instead.

ctypes: windll.kernel32.GetBinaryTypeW
PyWin32: win32file.GetBinaryType, win32file.SCS_64BIT_BINARY, etc

http://msdn.microsoft.com/en-us/library/aa364819


More information about the Tutor mailing list