<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Aug 2, 2014 at 12:53 AM, Phil Thompson <span dir="ltr"><<a href="mailto:phil@riverbankcomputing.com" target="_blank">phil@riverbankcomputing.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
To me the issue is whether, for a particular value of sys.platform, the programmer can expect a particular Python stdlib API. If so then Android needs a different value for sys.platform.<br></blockquote><div><br></div><div>

sys.platform is for a broad indication of the OS kernel. It can be used to distinguish Windows, Mac and Linux (and BSD, Solaris etc.). Since Android is Linux it should have the same sys.platform as other Linux systems ('linux2'). If you want to know whether a specific syscall is there, check for the presence of the method in the os module.<br>

<br>The platform module is suitable for additional vendor-specific info about the platform, and I'd hope that there's something there that indicates Android. Again, what values does the platform module return on SL4A or Kivy, which have already ported Python to Android? In particular, I'd expect platform.linux_distribution() to return a clue that it's Android. There should also be clues in /etc/lsb-release (assuming Android supports it :-).<br>

</div><div> </div></div>-- <br>--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)
</div></div>