get system release in python

To get the system release information in Python, you can use the platform module. Specifically, the platform.release() method returns the operating system release. Here's an example code snippet:

main.py
import platform

release = platform.release()
print("The system release is:", release)
87 chars
5 lines

This code will output the system release information, such as "10.0.18362" on Windows or "18.7.0" on macOS.

gistlibby LogSnag