Write a Linux inspection script using Python

Okay, here is a simple Python script that can be used to inspect the basic information of the Linux system:

importplatform

def check_system_info():
    # 获取操作系统名称及版本
    os_name = platform.system()
    os_release = platform.release()
    print("操作系统名称: ", os_name)
    print("操作系统版本: ", os_release)
    
    # 获取系统的主机名
    host_name = platform.node()
    print(

Guess you like

Origin blog.csdn.net/weixin_42576410/article/details/129576143