Tuesday, 7 August 2018

setting environment variable in Python from bash wrapper

I am trying to run Python script through a wrapper script which sets path to different directories and handle log file & script execution.



While running shell scripts through this wrapper we assign the paths by using ${temp_data_path} in the ksh&bash scripts ,so now I want the same path but in my python script.



I am trying below,as I believe i have to set environment variable first by reading the value set for temp_data_path by my wrapper:



os.environ[temp_data_path] = ??not sure how I can assign the value from wrapper here

print os.environ[temp_data_path]

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...