Skip to content

Instantly share code, notes, and snippets.

@erikng
Last active April 16, 2018 11:46
Show Gist options
  • Select an option

  • Save erikng/add9fabe43a9afc46b959f2844940271 to your computer and use it in GitHub Desktop.

Select an option

Save erikng/add9fabe43a9afc46b959f2844940271 to your computer and use it in GitHub Desktop.

Revisions

  1. erikng revised this gist Jan 11, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion 32bitapps.py
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,6 @@
    output, err = proc.communicate()
    plist = plistlib.readPlistFromString(output)
    items = plist[0]['_items']
    for item in items:
    for item in sorted(items, key=lambda x: x.get('path')):
    if 'no' in item.get('has64BitIntelCode'):
    print [item.get('path'), item.get('_name'), item.get('version')]
  2. erikng revised this gist Jan 11, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions 32bitapps.py
    Original file line number Diff line number Diff line change
    @@ -8,5 +8,5 @@
    plist = plistlib.readPlistFromString(output)
    items = plist[0]['_items']
    for item in items:
    if 'no' in item['has64BitIntelCode']:
    print [item['path'], item['_name'], item['version']]
    if 'no' in item.get('has64BitIntelCode'):
    print [item.get('path'), item.get('_name'), item.get('version')]
  3. erikng revised this gist Jan 11, 2018. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions 32bitapps.py
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@
    proc = subprocess.Popen(cmd, shell=False, bufsize=-1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    output, err = proc.communicate()
    plist = plistlib.readPlistFromString(output)
    test = plist[0]['_items']
    for x in test:
    if 'no' in x['has64BitIntelCode']:
    print [x['path'], x['_name']]
    items = plist[0]['_items']
    for item in items:
    if 'no' in item['has64BitIntelCode']:
    print [item['path'], item['_name'], item['version']]
  4. erikng revised this gist Jan 10, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions 32bitapps.py
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    #!/usr/bin/python

    import subprocess
    import plistlib
    cmd = ['/usr/sbin/system_profiler', '-xml', 'SPApplicationsDataType']
  5. erikng created this gist Jan 10, 2018.
    10 changes: 10 additions & 0 deletions 32bitapps.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    import subprocess
    import plistlib
    cmd = ['/usr/sbin/system_profiler', '-xml', 'SPApplicationsDataType']
    proc = subprocess.Popen(cmd, shell=False, bufsize=-1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    output, err = proc.communicate()
    plist = plistlib.readPlistFromString(output)
    test = plist[0]['_items']
    for x in test:
    if 'no' in x['has64BitIntelCode']:
    print [x['path'], x['_name']]