-
-
Save Airr/2d9823b9f261fe1f9cea to your computer and use it in GitHub Desktop.
macOS PyObjc Computername
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SystemConfiguration | |
prefs = SystemConfiguration.SCPreferencesCreate(None, "SystemConfiguration", None) | |
print SystemConfiguration.SCPreferencesGetValue(prefs, "System")["System"]["ComputerName"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment