Skip to content

Instantly share code, notes, and snippets.

@souenzzo

souenzzo/test.py

Created Aug 19, 2016
Embed
What would you like to do?
#!/usr/bin/env python2
from jinja2 import Template
from yaml import load
JYAML="""
- name: Minimal
# comment
tasks:
- name: "Testando 1 2 3 {{ nome }}"
ping:
"""
PPY="""
[ { "name": "Minimal"
# comment
, "tasks":
[ { "name": "Testando 1 2 3 %s"%nome
, "ping": None
}
]
}
]
"""
env = {"nome":"Teste"}
obj1 = load(Template(JYAML).render(env))
print(obj1)
obj2 = eval(PPY, env)
print(obj2)
print (obj1 == obj2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.