I have Python app and I would like to show users the name of their operating system. I know that current OS can be obtained as follows:
import platform
print(platform.platform())
However this name is very long. Is there any standardized way to extract only name of OS and version (or name of distribution and version when it's linux)? Instead of this:
Linux-4.15.0-111-generic-x86_64-with-Ubuntu-18.04-bionic
Windows-10-10.0.17763-SP0
I would like this:
Ubuntu 18.04
Windows 10
Or do I have to do it manually e. g. using regex? There is problem, because I don't know what will be the output on macOS, Fedora or other OS.