Created
March 5, 2020 12:10
-
-
Save jordanst3wart/a6f903236b0f024dea7ffd55f851cb97 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
#!/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 | |
from jinja2 import Environment, FileSystemLoader | |
import yaml | |
import os | |
env = Environment(loader = FileSystemLoader(os.getcwd()), trim_blocks=True, lstrip_blocks=True) | |
template = env.get_template('somefile.j2') | |
config_data = yaml.load(open('vars.yml')) | |
page = template.render(config_data) | |
print(page) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment