To retrieve the system platform in Python, you can use the platform
module in conjunction with the os
module. The platform.system()
function will return the name of the operating system, while the platform.release()
function will return the version of the operating system.
Alternatively, you can use the os.uname()
function to retrieve detailed information about the system, including the operating system name and version.
Here's an example of how to use these functions:
main.py458 chars16 lines
This code will output something like:
main.py201 chars10 lines
gistlibby LogSnag