Possible values for platform.machine()

Question:

platform.machine()
Returns the machine type, e.g. ‘i386’. An empty string is returned if the value cannot be determined.

What are the possible values for this field?

Asked By: Jonathon Reinhart

||

Answers:

On platforms with os.uname(), this information comes directly from the result of that API call. That is to say, platform.machine() returns the same thing as the uname -m command.

Thus, the answer really depends on the kernel’s implementation of the uname(2) system call. For that, see this question and answer:

Possible values for `uname -m` (utsname.machine)

Answered By: Jonathon Reinhart

Possible values are listed there. For Unix and Linux based OSs, platform.machine() gives you the same answer than the command uname -m.

For Windows though it’s a bit more complicated. uname doesn’t exist on this platform and though Cygwin gives you the possibility to use uname -m it won’t give you the same result as platform.machine() (respectively x86_64 and AMD64 on my Windows machine).
That’s because of a choice made with the platform module.

Answered By: Kenshin9977
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.