<br><font size=2 face="sans-serif">I've long been successfully using this
hack I found at macosxhints.com:</font>
<br>
<br><font size=2 face="sans-serif">/usr/bin/awk '/ComputerName/ {{{getline}
print substr($0,12,length($0)-20)} exit}' /Library/Preferences/SystemConfiguration/preferences.plist</font>
<br>
<br><font size=2 face="sans-serif">The output of this command can of course
be parsed by Python.</font>
<br>
<br><font size=2 face="sans-serif">A better way would be to use plistlib
to parse the preferences.plist file, but I just never</font>
<br><font size=2 face="sans-serif">got around to it since the awk thing
has been working reliably.<br>
<br>
<b><br>
Brad Allen</b><br>
IT Desktop Support<br>
</font><img src=cid:_2_0B4FE0180B4FDED00000021A86257055><font size=2 color=blue face="sans-serif"><u><br>
</u></font><a href=mailto:brad.allen@omsdal.com><font size=2 color=blue face="sans-serif"><u>brad.allen@omsdal.com</u></font></a>
<br>
<br>