<p dir="ltr"><br>
On Oct 27, 2013 2:51 AM, "Amit Saha" <<a href="mailto:amitsaha.in@gmail.com">amitsaha.in@gmail.com</a>> wrote:<br>
><br>
> On Sun, Oct 27, 2013 at 2:39 AM, Albert-Jan Roskam <<a href="mailto:fomcl@yahoo.com">fomcl@yahoo.com</a>> wrote:<br>
> > Hi,<br>
> ><br>
> > Why does the "executable" parameter default to sys.executable? Yesterday I<br>
> > was surprised to see platform.architecture return "32bit" on a 64-bit<br>
> > system, just because a 32-bit Python interpreter was installed. Wouldn't<br>
> > this make more sense:<br>
> ><br>
> > import sys, platform<br>
> > pf = sys.platform.lower()[:3]<br>
> > executable = "iexplore.exe" if pf[:3] == "win" else "/bin/ls"<br>
><br>
> I think it's mainly because of avoiding choosing arbitrary programs,<br>
> although they are most certainly guaranteed to be present. Besides,<br>
> there are better ways to find the platform architecture, I think.<br>
> os.uname() comes to mind.</p>
<p dir="ltr">Although that will lie if you have, for example a 32-bit os installed on a 64-bit system. Then, you can read /proc/cpuinfo and look for the lm flag. If it is present, it is a 64-bit system, else  a 32-bit one. This is specific to Intel, i think.<br>
</p>
<p dir="ltr">><br>
> -Amit.<br>
</p>