OS version script
This commit is contained in:
parent
cad73c3f26
commit
449ae53fe9
1 changed files with 16 additions and 1 deletions
|
@ -1 +1,16 @@
|
|||
print("hello python !")
|
||||
import platform
|
||||
import distro
|
||||
|
||||
def detect_os():
|
||||
os_name = platform.system()
|
||||
if os_name == "Linux":
|
||||
linux_dist = distro.name()
|
||||
linux_version = distro.version()
|
||||
print(f"Operating System: GNU/Linux")
|
||||
print(f"Distribution: {linux_dist}")
|
||||
print(f"Version: {linux_version}")
|
||||
else:
|
||||
print(f"Operating System: {os_name}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
detect_os()
|
Loading…
Add table
Reference in a new issue