Created
April 7, 2021 20:20
-
-
Save poteznyKrolik/9cffe40f3dde0e34867acabfdd3bd215 to your computer and use it in GitHub Desktop.
py_list_shel_vars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ 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