title: how to set environmental variables permanently in posix(unix/linux) machine using python script
body: <p>I am trying to set a environmental variable permanently. but temporarily it is working. </p>
  
  <p>if i run below program i got the variable path. after close it and open new terminal to find the variable path using the command <code>printenv LD_LIBRARY_PATH</code> nothing will print. </p>
  
  <pre><code>#!/usr/bin/python
  
  
  import os
  import subprocess
  
  def setenv_var():
      env_var = "LD_LIBRARY_PATH"
      env_path = "/usr/local/lib"`enter code here`
      os.environ[env_var] = env_path
      process = subprocess.Popen('printenv ' + env_var, stdout=subprocess.PIPE, shell=True)
      result = process.communicate()[0]
      return result
  
  if __name__ == '__main__':
      print setenv_var()
  </code></pre>
  
  <p>please help me. </p>