Expand Environment Variable in Python on Mac - DevPops-Inc/python GitHub Wiki
• Type python3
and press the return key to go into the Python interactive shell.
•
• Type import os.path
and press the return key to import the os.path module.
•
• Type print(“$< environment variable >”)
and press the return key to get the environment variable literally and without expansion.
•
• Type os.path.expandvars(“$< environment variable >”)
and press the return key to get the expanded environment variable this time around.
•