Windows server and windows desktop deference with python script

Viewed 168

I want to make a script in python which can differentiate between windows server and windows desktop. OS and platform are giving same result for both, is there any way to differ them on the basis of python script? The main problem I'm facing is script is giving same output for server and desktop no difference it's showing.

1 Answers

Use platform.release()

Ex:

import platform
print(platform.release())

if OS is Desktop:

7

If OS is Server:

2008ServerR2
Related