1import os
2os.environ['USER']
3os.environ.get('USER')In python itself,
In terminal (we have to retype whenever we use),
In
.bashrc or .zshrc (we don’t have to retype whenever we use),Store in a file (Don’t forget to ignore this file from git) → then use python-dotenv.