I am trying to set a environmental variable permanently. but temporarily it is working.
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 printenv LD_LIBRARY_PATH nothing will print. 
#!/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()
please help me.
 
     
     
     
     
    