[Python] Python code to retrieve system info in format [closed]

Discussão em 'Python' iniciado por Stack, Setembro 29, 2024.

  1. Stack

    Stack Membro Participativo

    I have to make a python script for a course I’m doing. It has to retrieve the following:

    • Computer Name
    • IP-address, MAC-address, Active ports
    • Processor Model Operation
    • System time
    • Internet connection speed

    And print to a csv with the following formats:

    PF1VKNRQ, 192.168.1.2, 54-05-DB-3B-71-31, i7, Windows 10, 6//10/2023 8:00:01, 3Mb/s, 21;25;443;1234


    Code I have so far is:

    import csv
    import os
    import platform
    import psutil
    import socket
    import struct
    import datetime

    def get_system_info():
    system_info = {}

    system_info[“Computer_Name”] = platform.node()
    system_info[“IP_Address”] =
    system_info[“MAC_Address”] =
    system_info[“Processor_Model”] =
    system_info[“OS”] = platform.system() + platform.version([release])
    system_info[ “Sys_Time”] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
    system_info[“Net_Con_Spd”] =
    system_info[“Active_Ports”] =
    print(system_info)

    get_system_info()


    Can anyone help me find out how to fill in the other details to meet the reporting requirements?

    Continue reading...

Compartilhe esta Página