Created
December 17, 2019 19:22
-
-
Save wordswords/3fba54fdc919797de12a9db00bccf4aa to your computer and use it in GitHub Desktop.
This file contains 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 yaml | |
from os.path import expanduser | |
home = expanduser("~") | |
my_config = open(home + '/.secrets/codingmode/secrets.d/hue.yml') | |
my_config_dict = yaml.load(my_config.read(), Loader=yaml.FullLoader) | |
result = map(lambda x : x['Prompt'] # return prompt associated with variable \ | |
if x['Variable'] \ | |
== 'user_email' \ | |
else \ | |
None \ | |
, my_config_dict) | |
print(list(r for r in result if r)) # list comprehension, remove all Nones | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment