Created
June 25, 2025 20:07
-
-
Save fepegar/6b576276ba331124a6fe5c671fd61239 to your computer and use it in GitHub Desktop.
Print environment variables.
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
import os | |
longest_env_var = max(os.environ, key=lambda k: len(k)) | |
for k in sorted(os.environ): | |
padded = k.ljust(len(longest_env_var), ".") | |
print(f"{padded} {os.environ[k]}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment