Python templater/interpreter and fixed a bug for the generator