title: Running python script as root
body: <p>I have the following script:</p>
  
  <pre><code>#!/usr/bin/env python                                                           
  
  import sys                                                                      
  import pyttsx                                                                   
  
  def main():                                                                     
          print 'running speech-text.py...'                                       
          engine = pyttsx.init()                                                  
          str = "Hi..."                                    
          if len(sys.argv) &gt; 1:                                                   
                  str = sys.argv[1]                                               
          engine.say(str)                                                         
          engine.runAndWait()                                                     
  
  if __name__ == '__main__':                                                      
          main() 
  </code></pre>
  
  <p>and I have placed it in <code>/usr/bin/speech-test.py</code></p>
  
  <p>I have also given it executable permissions and ownership to root:</p>
  
  <pre><code>sudo chown root:root /usr/bin/speech-test.py
  sudo chmod 4755 /usr/bin/speech-test.py
  </code></pre>
  
  <p>However, this script will only run correctly if I run as <code>sudo speec-test.py</code>. If I try to run it as just <code>speech-test.py</code> it complains about not finding a bunch of ALSA lib files.</p>
  
  <p>Am I missing something to have my script run with root privileges?</p>