title: Run python script each time mac wakes from sleep
body: <p>I have a python file that I want to run every time the mac comes out of its sleep.
  I have turned the .py file into an dmg file and placed into login items section of the mac this is in settings -&gt; users -&gt; login items.
  My problem is that this seems to only run the DMG file when i fully logout of the the mac. I always just click the sleep option on the mac. Is there a way to run the python script each time the computer wakes up from a sleep?
  <a href="https://i.stack.imgur.com/TMw4a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TMw4a.png" alt="enter image description here" /></a></p>