Reputation: 57
I want to know the system type(os) through python code. I have tried platform.architecture() which returns 32 bit, Windows PE as my os is 64-bit.
If system type(os) is 32-bit what it will return ?
Thanks in advance!
Upvotes: 2
Views: 169
Reputation: 628
import platform
platform.architecture()
('32bit', 'WindowsPE')
On 64-bit Windows, 32-bit Python returns:
('32bit', 'WindowsPE') # Don't know why.
A good method is to write a function like
def check_os_type():
if platform.machine().endswith('64'):
return '64 bit'
if platform.machine().endswith('32'):
return '32 bit'
Upvotes: 2