paddie/SOxServer — Issue #4: Simplify the collection of machine data..
Author: paddie
Created: 2012-01-11 15:33:23+00:00
State: open

python:

```>>> import subprocess
>>> import plistlib
>>> info= subprocess.Popen(["/usr/sbin/system_profiler","-xml","SPHardwareDataType"], stdout=subprocess.PIPE).communicate()[0]
>>> plist = plistlib.readPlistFromString(info)
>>> print plist[0]["_items"][0]["serial_number"]
W80362D0ATP
>>> print plist[0]["_items"][0].keys()
['platform_UUID', 'current_processor_speed', 'machine_name', 'SMC_version_system', 'number_processors', '_name', 'l2_cache', 'bus_speed', 'machine_model', 'cpu_type', 'MMM_entry', 'serial_number', 'boot_rom_version', 'packages', 'physical_memory']```