Skip to content

Instantly share code, notes, and snippets.

@poteznyKrolik
Created April 7, 2021 20:20
Show Gist options
  • Select an option

  • Save poteznyKrolik/9cffe40f3dde0e34867acabfdd3bd215 to your computer and use it in GitHub Desktop.

Select an option

Save poteznyKrolik/9cffe40f3dde0e34867acabfdd3bd215 to your computer and use it in GitHub Desktop.
py_list_shel_vars
""" lists environment variables, and splits elements in path variable """
import os
for k, v in sorted(os.environ.items()):
print(k+':', v)
print('\n')
# list elements in path environment variable
[print(item) for item in os.environ['PATH'].split(';')]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment