Python を使用して Linux 検査スクリプトを作成する

さて、Linux システムの基本情報を検査するために使用できる簡単な Python スクリプトを次に示します。

importplatform

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

おすすめ

転載: blog.csdn.net/weixin_42576410/article/details/129576143