Skip to content

Instantly share code, notes, and snippets.

@alexras
Created September 24, 2011 18:04
Show Gist options
  • Save alexras/1239641 to your computer and use it in GitHub Desktop.
Save alexras/1239641 to your computer and use it in GitHub Desktop.
Search for PPC-only or Classic apps on a Mac
#!/usr/bin/python
import plistlib
import subprocess
ppc_apps = []
command = ["system_profiler", "-xml", "SPApplicationsDataType"]
task = subprocess.Popen(command, stdout=subprocess.PIPE)
(stdout, unused_stderr) = task.communicate()
apps = plistlib.readPlistFromString(stdout)[0]["_items"]
for app in apps:
if "runtime_environment" in app:
if app["runtime_environment"] in ["classic", "arch_ppc"]:
ppc_apps.append((app["path"], app["runtime_environment"]))
for (app, runtime_env) in ppc_apps:
print app, '\t', runtime_env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment