import subprocess import sys def list_hardware_info(): # Replace this with the actual command to list hardware info result = subprocess.run(['listHardwareInfo'], capture_output=True, text=True) return result.stdout def save_hardware_info(output_file): hardware_info = list_hardware_info() lines = hardware_info.splitlines() if len(lines) > 1: with open(output_file, 'w') as f: f.write('\n'.join(lines[1:])) if __name__ == "__main__": if len(sys.argv) != 2: print("Usage: python InventarioHardware.py ") sys.exit(1) save_hardware_info(sys.argv[1])