Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.


+7 votes

When I run the code below, I get the output of win32. I was wondering if that meant my system is running on Windows 32bit as opposed to Windows 64bit or if that doesn't matter and it just means that it is a Windows computer?
>>>import sys
>>> print(sys.platform)

asked in CSC201 Spring 2021 by (1 point)

1 Answer

+3 votes
Best answer

Nope, it looks like sys.platform will refer to any modern Windows as "win32", even if it's a 64-bit OS running 64-bit Python. In general when you're programming in Python you're unlikely to need to worry about whether the machine you're executing on is using a 64-bit or 32-bit OS. If it is truly necessary for some reason, there are other ways to get information about your system, including a lot of functions in the platform module.

import platform
answered by (508 points)
selected by