os.environ gives you access to the current processes environment as a dictionary. If you want to set an environment variable in your shell from inside a child Python process it's not possible
Per @IainShelvington's comment re the current process. Note also that this is a dictionary, so do os.environ['something']='some/file/path/name' Also note that variables that you set in the environment will be automatically inherited by child processes. In bash there is a distinction between variables that are exported and those that are not, but this doesn't really exist in Python (except perhaps that ordinary Python variables are not environment variables).
os.environgives you access to the current processes environment as a dictionary. If you want to set an environment variable in your shell from inside a child Python process it's not possibleos.environ['something']='some/file/path/name'Also note that variables that you set in the environment will be automatically inherited by child processes. In bash there is a distinction between variables that are exported and those that are not, but this doesn't really exist in Python (except perhaps that ordinary Python variables are not environment variables).