title: Temporarly Prevent Forced Sleep on Mac OS X through Python/Terminal
body: <p>How can one disable <em>forced</em> sleep (sleep caused by the user - often by closing lid/pressing Sleep under the apple menu) through Terminal, preferably with a Python script, on OS X?  I would like to be able to run the following or similiar...</p>
  
  <pre><code>import os
  cmd = """ *?*Sleep Disable Command*?* """
  def fullVolume():
       os.system(cmd)
  
  while True:
      fullVolume()
  </code></pre>
  
  <p>...to accomplish said task.</p>
  
  <p>I have done a fair share of research, and I couldn't find much, bar this: <a href="https://developer.apple.com/library/mac/qa/qa1340/_index.html" rel="nofollow">https://developer.apple.com/library/mac/qa/qa1340/_index.html</a></p>
  
  <p>And this:
  <a href="https://code.google.com/p/macosx-nosleep-extension/" rel="nofollow">https://code.google.com/p/macosx-nosleep-extension/</a>
  <a href="https://github.com/integralpro/nosleep/releases" rel="nofollow">https://github.com/integralpro/nosleep/releases</a></p>
  
  <p>I believe there may be some way to incorporate code from the NoSleep extension into this script, but I am quite unsure on how to do so.  Help is much appreciated! =)</p>