Python template improved