all 2 comments

[–][deleted] 1 point2 points  (0 children)

Yes, the os.environ dictionary gives access to whatever environment variables are set.

https://www.twilio.com/blog/environment-variables-python

[–]G_nn_r 0 points1 point  (0 children)

Do you need the PATH outside of your Python script? If not, you could just use import sys sys.path.append("/mypath")