data: START_DT: '202001' END_DT: '202104' schema: products
i have the above YAML file.
I want to be able to use it such that i get:
set START_DT='202001';set END_DT='202104';set schema = products
notice that the dates are in quotes and the products isn't.
with open("data.yml", "r") as ymlfile: cfg = yaml.load(ymlfile) lines=[]for k,v in cfg['data'].items(): print("SET" +''+ k+'='+ v) var = ("SET" +''+ k+'='+ v) lines.append(var)
prints:
SET START_DT=201901SET END_DT=202104 SET SCHEMA=products
but now i have lost the quotation marks in the original config for the dates.. how can i retrieve these back?