Skip to content

Instantly share code, notes, and snippets.

@atifazad
Created July 27, 2017 12:19
Show Gist options
  • Save atifazad/72cce0c3828f80f99368504f7cb1b270 to your computer and use it in GitHub Desktop.
Save atifazad/72cce0c3828f80f99368504f7cb1b270 to your computer and use it in GitHub Desktop.
Python script to shutdown mac
# -*- coding: utf-8 -*-
import subprocess
subprocess.call(['osascript', '-e', 'tell app "loginwindow" to «event aevtrsdn»'])
#usage: > python mac_shutdown.py
# For further similar system commands: https://gist.github.com/atifazad/6afd3cbedb8819dd7ed7be92dec2dc0d
@AkulaSrujana
Copy link

can you explain what's written in the subprocess.call function about?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment