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

Albert-Jan Roskam fomcl at yahoo.com
Sat Oct 26 18:39:58 CEST 2013


Hi,

Why does the "executable" parameter default to sys.executable? Yesterday I was surprised to see platform.architecture return "32bit" on a 64-bit system, just because a 32-bit Python interpreter was installed. Wouldn't this make more sense:

import sys, platform

pf = sys.platform.lower()[:3]
executable = "iexplore.exe" if pf[:3] == "win" else "/bin/ls"
arch = platform.architecture(executable)[0]
 

Regards, 
Albert-Jan 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a 
fresh water system, and public health, what have the Romans ever done for us? 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20131026/804ca4b8/attachment.html>


More information about the Tutor mailing list